summaryrefslogtreecommitdiff
path: root/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
diff options
context:
space:
mode:
authorVictor Hernandez <vhernandez@apple.com>2010-01-21 23:07:15 +0000
committerVictor Hernandez <vhernandez@apple.com>2010-01-21 23:07:15 +0000
commita4c77622f7f9f7546f0eae7c171ab56df125dc9a (patch)
treea585ef381cd59b3ea8231788e630129213b3ee66 /lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
parent6c146eefbf75875250af37a0f1ea70fc6b4716ee (diff)
downloadllvm-a4c77622f7f9f7546f0eae7c171ab56df125dc9a.tar.gz
llvm-a4c77622f7f9f7546f0eae7c171ab56df125dc9a.tar.bz2
llvm-a4c77622f7f9f7546f0eae7c171ab56df125dc9a.tar.xz
No need to look through bitcasts for DbgInfoIntrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94112 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index cdb338de85..91219c45ad 100644
--- a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
@@ -406,12 +406,8 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) {
for (unsigned ScanInsts = 6; BBI != SI.getParent()->begin() && ScanInsts;
--ScanInsts) {
--BBI;
- // Don't count debug info directives, lest they affect codegen,
- // and we skip pointer-to-pointer bitcasts, which are NOPs.
- // It is necessary for correctness to skip those that feed into a
- // llvm.dbg.declare, as these are not present when debugging is off.
- if (isa<DbgInfoIntrinsic>(BBI) ||
- (isa<BitCastInst>(BBI) && isa<PointerType>(BBI->getType()))) {
+ // Don't count debug info directives, lest they affect codegen
+ if (isa<DbgInfoIntrinsic>(BBI)) {
ScanInsts++;
continue;
}
@@ -475,14 +471,12 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) {
// If this store is the last instruction in the basic block (possibly
- // excepting debug info instructions and the pointer bitcasts that feed
- // into them), and if the block ends with an unconditional branch, try
- // to move it to the successor block.
+ // excepting debug info instructions), and if the block ends with an
+ // unconditional branch, try to move it to the successor block.
BBI = &SI;
do {
++BBI;
- } while (isa<DbgInfoIntrinsic>(BBI) ||
- (isa<BitCastInst>(BBI) && isa<PointerType>(BBI->getType())));
+ } while (isa<DbgInfoIntrinsic>(BBI));
if (BranchInst *BI = dyn_cast<BranchInst>(BBI))
if (BI->isUnconditional())
if (SimplifyStoreAtEndOfBlock(SI))
@@ -542,8 +536,7 @@ bool InstCombiner::SimplifyStoreAtEndOfBlock(StoreInst &SI) {
if (OtherBr->isUnconditional()) {
--BBI;
// Skip over debugging info.
- while (isa<DbgInfoIntrinsic>(BBI) ||
- (isa<BitCastInst>(BBI) && isa<PointerType>(BBI->getType()))) {
+ while (isa<DbgInfoIntrinsic>(BBI)) {
if (BBI==OtherBB->begin())
return false;
--BBI;