[RewriteStatepointsForGC] Minor refactor to use shared implementation [NFC]
authorPhilip Reames <listmail@philipreames.com>
Thu, 10 Sep 2015 00:44:10 +0000 (00:44 +0000)
committerPhilip Reames <listmail@philipreames.com>
Thu, 10 Sep 2015 00:44:10 +0000 (00:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247223 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/RewriteStatepointsForGC.cpp

index 57687de..2bb0918 100644 (file)
@@ -1029,14 +1029,7 @@ static Value *findBasePointer(Value *I, DefiningValueMapTy &cache) {
       auto *BdvIE = cast<InsertElementInst>(BDV);
       auto UpdateOperand = [&](int OperandIdx) {
         Value *InVal = BdvIE->getOperand(OperandIdx);
-        Value *Base = findBaseOrBDV(InVal, cache);
-        if (!isKnownBaseResult(Base)) {
-          // Either conflict or base.
-          assert(States.count(Base));
-          Base = States[Base].getBase();
-          assert(Base != nullptr && "unknown BDVState!");
-        }
-        assert(Base && "can't be null");
+        Value *Base = getBaseForInput(InVal, BaseIE);
         BaseIE->setOperand(OperandIdx, Base);
       };
       UpdateOperand(0); // vector operand