GEP instructions can never be constant propogated.
authorChris Lattner <sabre@nondot.org>
Thu, 18 Apr 2002 14:44:13 +0000 (14:44 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 18 Apr 2002 14:44:13 +0000 (14:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2284 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/SCCP.cpp

index e6cf765e55557cce47b8f507387b6ac516544cf4..e7e8f4177cb19140e66c3496f9f76010900165fa 100644 (file)
@@ -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...
   //