aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-03-04 01:53:05 +0000
committerDale Johannesen <dalej@apple.com>2009-03-04 01:53:05 +0000
commitcdb16aa5ab6013268d0ee0a8c8c29a8ebafb799b (patch)
tree97a52a9ec6449675d11d4cb378e9a2cdb5c722a0 /lib/Transforms/Scalar/InstructionCombining.cpp
parent599a6a88ce1925a6349ac7af9a9638aad1d832cc (diff)
Always skip ptr-to-ptr bitcasts when counting,
per Chris' suggestion. Slightly faster. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65999 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 5b50ab56a3..66ac48181e 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -11484,12 +11484,12 @@ 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.
- // Likewise, we skip bitcasts that feed into a llvm.dbg.declare; these are
- // not present when debugging is off.
+ // 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) && BBI->hasOneUse() &&
- isa<DbgDeclareInst>(BBI->use_begin()))) {
+ (isa<BitCastInst>(BBI) && isa<PointerType>(BBI->getType()))) {
ScanInsts++;
continue;
}