summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-11-07 08:54:19 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-11-07 08:54:19 +0000
commit2098b86f641eca28c800be7a2521b87d059caf48 (patch)
tree262102bb3cd19077376e0310a45e24beb563ca8e /llvm/lib
parent80ef110ccaab14f8bdadd01de989dea7139b956c (diff)
downloadbcm5719-llvm-2098b86f641eca28c800be7a2521b87d059caf48.tar.gz
bcm5719-llvm-2098b86f641eca28c800be7a2521b87d059caf48.zip
SCCP: overdefined calls cannot become constant
We would attempt to fold away a call instruction which had been marked overdefined. However, it's not valid to transition to constant from overdefined. This fixes PR21512. llvm-svn: 221513
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/SCCP.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index 32be3e0cdbf..e973cdbf44c 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -1107,6 +1107,9 @@ CallOverdefined:
Operands.push_back(State.getConstant());
}
+ if (getValueState(I).isOverdefined())
+ return;
+
// If we can constant fold this, mark the result of the call as a
// constant.
if (Constant *C = ConstantFoldCall(F, Operands, TLI))
OpenPOWER on IntegriCloud