summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-04-18 14:44:13 +0000
committerChris Lattner <sabre@nondot.org>2002-04-18 14:44:13 +0000
commit587390070932ac942f7d606c6be15870c2100e11 (patch)
treee7daa9181c4ddd3c1b85b7d1cc705f181258064d
parentf40379e40317569e014fb1ae901e55601db90b5e (diff)
downloadbcm5719-llvm-587390070932ac942f7d606c6be15870c2100e11.tar.gz
bcm5719-llvm-587390070932ac942f7d606c6be15870c2100e11.zip
GEP instructions can never be constant propogated.
llvm-svn: 2284
-rw-r--r--llvm/lib/Transforms/Scalar/SCCP.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index e6cf765e555..e7e8f4177cb 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -429,14 +429,9 @@ void SCCP::UpdateInstruction(Instruction *I) {
//===-------------------------------------------------------------------===//
- // Handle Unary instructions...
- // Also treated as unary here, are cast instructions and getelementptr
- // instructions on struct* operands.
+ // Handle Unary and cast instructions...
//
- if (isa<UnaryOperator>(I) || isa<CastInst>(I) ||
- (isa<GetElementPtrInst>(I) &&
- cast<GetElementPtrInst>(I)->isStructSelector())) {
-
+ if (isa<UnaryOperator>(I) || isa<CastInst>(I)) {
Value *V = I->getOperand(0);
InstVal &VState = getValueState(V);
if (VState.isOverdefined()) { // Inherit overdefinedness of operand
@@ -456,6 +451,16 @@ void SCCP::UpdateInstruction(Instruction *I) {
return;
}
+
+ //===-----------------------------------------------------------------===//
+ // Handle GetElementPtr instructions...
+ //
+ if (isa<GetElementPtrInst>(I)) {
+ markOverdefined(I);
+ return;
+ }
+
+
//===-----------------------------------------------------------------===//
// Handle Binary instructions...
//
OpenPOWER on IntegriCloud