summaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/LICM.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-01-09 18:12:03 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-01-09 18:12:03 +0000
commitd9cc865787d673a8d1021d0b9659fd438feba845 (patch)
treead03fc51a9930de1119408a9229deae295953723 /lib/Transforms/Scalar/LICM.cpp
parent12cd49ae1d3c8f45f3e41b6cce681b667b99ef07 (diff)
downloadexternal_llvm-d9cc865787d673a8d1021d0b9659fd438feba845.zip
external_llvm-d9cc865787d673a8d1021d0b9659fd438feba845.tar.gz
external_llvm-d9cc865787d673a8d1021d0b9659fd438feba845.tar.bz2
LICM: Hoist insertvalue/extractvalue out of loops.
Fixes PR14854. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171984 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LICM.cpp')
-rw-r--r--lib/Transforms/Scalar/LICM.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index dc6bef7..f94cd2a 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/lib/Transforms/Scalar/LICM.cpp
@@ -440,13 +440,12 @@ bool LICM::canSinkOrHoistInst(Instruction &I) {
}
// Only these instructions are hoistable/sinkable.
- bool HoistableKind = (isa<BinaryOperator>(I) || isa<CastInst>(I) ||
- isa<SelectInst>(I) || isa<GetElementPtrInst>(I) ||
- isa<CmpInst>(I) || isa<InsertElementInst>(I) ||
- isa<ExtractElementInst>(I) ||
- isa<ShuffleVectorInst>(I));
- if (!HoistableKind)
- return false;
+ if (!isa<BinaryOperator>(I) && !isa<CastInst>(I) && !isa<SelectInst>(I) &&
+ !isa<GetElementPtrInst>(I) && !isa<CmpInst>(I) &&
+ !isa<InsertElementInst>(I) && !isa<ExtractElementInst>(I) &&
+ !isa<ShuffleVectorInst>(I) && !isa<ExtractValueInst>(I) &&
+ !isa<InsertValueInst>(I))
+ return false;
return isSafeToExecuteUnconditionally(I);
}