aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/SCCP.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-24 00:19:54 +0000
committerChris Lattner <sabre@nondot.org>2008-04-24 00:19:54 +0000
commit204cfdec4e5649c16f9fe27e7ffea7e92cada02a (patch)
treed95e2619aa8e142abd08d33851747a9d8c1502b7 /lib/Transforms/Scalar/SCCP.cpp
parentb6f89367553da76523ce4aff07b793e7e504d0f5 (diff)
downloadexternal_llvm-204cfdec4e5649c16f9fe27e7ffea7e92cada02a.zip
external_llvm-204cfdec4e5649c16f9fe27e7ffea7e92cada02a.tar.gz
external_llvm-204cfdec4e5649c16f9fe27e7ffea7e92cada02a.tar.bz2
Don't replace multiple result of calls with undef,
sccp tracks getresult values, not call values in this case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50202 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/SCCP.cpp')
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index bef13af..e849b2d 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -1516,7 +1516,8 @@ bool SCCP::runOnFunction(Function &F) {
//
for (BasicBlock::iterator BI = BB->begin(), E = BB->end(); BI != E; ) {
Instruction *Inst = BI++;
- if (Inst->getType() == Type::VoidTy ||
+ if (Inst->getType() == Type::VoidTy ||
+ isa<StructType>(Inst->getType()) ||
isa<TerminatorInst>(Inst))
continue;
@@ -1692,7 +1693,8 @@ bool IPSCCP::runOnModule(Module &M) {
} else {
for (BasicBlock::iterator BI = BB->begin(), E = BB->end(); BI != E; ) {
Instruction *Inst = BI++;
- if (Inst->getType() != Type::VoidTy) {
+ if (Inst->getType() != Type::VoidTy &&
+ !isa<StructType>(Inst->getType())) {
LatticeVal &IV = Values[Inst];
if (IV.isConstant() ||
(IV.isUndefined() && !isa<TerminatorInst>(Inst))) {