diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index e6cf765e555..e7e8f4177cb 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/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(I) || isa(I) || - (isa(I) && - cast(I)->isStructSelector())) { - + if (isa(I) || isa(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(I)) { + markOverdefined(I); + return; + } + + //===-----------------------------------------------------------------===// // Handle Binary instructions... //