summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-05-07 19:43:39 +0000
committerDan Gohman <gohman@apple.com>2009-05-07 19:43:39 +0000
commit140a6f24f0ca2bdc7694add39c0b84063eeb1174 (patch)
treecda545c74f1209b4749ca4ba4a031b01c6b4a064 /llvm/lib/Transforms
parent6840b65ab7dcf4506a57451145aaf7dc2f89291c (diff)
downloadbcm5719-llvm-140a6f24f0ca2bdc7694add39c0b84063eeb1174.tar.gz
bcm5719-llvm-140a6f24f0ca2bdc7694add39c0b84063eeb1174.zip
Perform constant folding on operands of instructions with non-void
types, such as loads and calls. llvm-svn: 71175
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 9feb442df97..c285c324ddb 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -12770,7 +12770,9 @@ bool InstCombiner::DoOneIteration(Function &F, unsigned Iteration) {
continue;
}
- if (TD && I->getType()->getTypeID() == Type::VoidTyID) {
+ if (TD &&
+ (I->getType()->getTypeID() == Type::VoidTyID ||
+ I->isTrapping())) {
// See if we can constant fold its operands.
for (User::op_iterator i = I->op_begin(), e = I->op_end(); i != e; ++i)
if (ConstantExpr *CE = dyn_cast<ConstantExpr>(i))
OpenPOWER on IntegriCloud