projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f363ce2
)
Fix Transforms/InstCombine/2006-06-28-infloop.ll
author
Chris Lattner
<sabre@nondot.org>
Wed, 28 Jun 2006 17:34:50 +0000
(17:34 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Wed, 28 Jun 2006 17:34:50 +0000
(17:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28961
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/InstructionCombining.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/InstructionCombining.cpp
b/lib/Transforms/Scalar/InstructionCombining.cpp
index 63cd256dc57670e6fb5f26999512674fcd2396cd..797b2b8db2e2b6e4622600a3f3734110da86cffc 100644
(file)
--- a/
lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/
lib/Transforms/Scalar/InstructionCombining.cpp
@@
-4934,6
+4934,12
@@
static bool CanEvaluateInDifferentType(Value *V, const Type *Ty,
// If this is a cast from the destination type, we can trivially eliminate
// it, and this will remove a cast overall.
if (I->getOperand(0)->getType() == Ty) {
+ // If the first operand is itself a cast, and is eliminable, do not count
+ // this as an eliminable cast. We would prefer to eliminate those two
+ // casts first.
+ if (CastInst *OpCast = dyn_cast<CastInst>(I->getOperand(0)))
+ return true;
+
++NumCastsRemoved;
return true;
}