Commit 12b78db6 authored by Chris Lattner's avatar Chris Lattner
Browse files

We might as well strip off any CPRs before propagation

llvm-svn: 9437
parent bf9584b0
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -103,7 +103,10 @@ bool IPCP::processFunction(Function &F) {
    // Do we have a constant argument!?
    if (!ArgumentConstants[i].second) {
      assert(ArgumentConstants[i].first && "Unknown constant value!");
      AI->replaceAllUsesWith(ArgumentConstants[i].first);
      Value *V = ArgumentConstants[i].first;
      if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(V))
        V = CPR->getValue();
      AI->replaceAllUsesWith(V);
      ++NumArgumentsProped;
    }
  return true;