diff --git a/llvm/lib/CodeGen/MachineSSAUpdater.cpp b/llvm/lib/CodeGen/MachineSSAUpdater.cpp index f58b0f77897d6..48076663ddf53 100644 --- a/llvm/lib/CodeGen/MachineSSAUpdater.cpp +++ b/llvm/lib/CodeGen/MachineSSAUpdater.cpp @@ -152,14 +152,6 @@ Register MachineSSAUpdater::GetValueInMiddleOfBlock(MachineBasicBlock *BB, if (!HasValueForBlock(BB)) return GetValueAtEndOfBlockInternal(BB, ExistingValueOnly); - // Ok, we have already got a value for this block. If it is out of our block - // or it is a phi - we can re-use it as it will be defined in the middle of - // block as well. - Register defR = getAvailableVals(AV).lookup(BB); - if (auto I = MRI->getVRegDef(defR)) - if (I->isPHI() || I->getParent() != BB) - return defR; - // If there are no predecessors, just return undef. if (BB->pred_empty()) { // If we cannot insert new instructions, just return $noreg. diff --git a/llvm/lib/Transforms/Utils/SSAUpdater.cpp b/llvm/lib/Transforms/Utils/SSAUpdater.cpp index 69c93b304260d..37019e3bf95be 100644 --- a/llvm/lib/Transforms/Utils/SSAUpdater.cpp +++ b/llvm/lib/Transforms/Utils/SSAUpdater.cpp @@ -100,14 +100,6 @@ Value *SSAUpdater::GetValueInMiddleOfBlock(BasicBlock *BB) { if (!HasValueForBlock(BB)) return GetValueAtEndOfBlock(BB); - // Ok, we have already got a value for this block. If it is out of our block - // or it is a phi - we can re-use it as it will be defined in the middle of - // block as well. - Value *defV = FindValueForBlock(BB); - if (auto I = dyn_cast(defV)) - if (isa(I) || I->getParent() != BB) - return defV; - // Otherwise, we have the hard case. Get the live-in values for each // predecessor. SmallVector, 8> PredValues;