summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit5f5abd598c8ef460a0158c7b273a5bb7067496fd (patch)
tree287c6106510113ccfcce6329933a81080d2cf908 /llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
parent1df65186d1d46600627d1631e737f09cc7297ef8 (diff)
downloadbcm5719-llvm-5f5abd598c8ef460a0158c7b273a5bb7067496fd.tar.gz
bcm5719-llvm-5f5abd598c8ef460a0158c7b273a5bb7067496fd.zip
No need to look through bitcasts for DbgInfoIntrinsic
llvm-svn: 94112
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index cdb338de853..91219c45ad7 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud