aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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
commit95b95de580fb8121e134511b34893f9426a8f1f7 (patch)
treeb0d67f4301a47eb370d86921b14a388c6dddcf6d /lib
parent6e10db1ec76496177bc2a9978d7019a6bb80e5c1 (diff)
downloadexternal_llvm-95b95de580fb8121e134511b34893f9426a8f1f7.zip
external_llvm-95b95de580fb8121e134511b34893f9426a8f1f7.tar.gz
external_llvm-95b95de580fb8121e134511b34893f9426a8f1f7.tar.bz2
Perform constant folding on operands of instructions with non-void
types, such as loads and calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71175 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 9feb442..c285c32 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/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))