[llvm] d713f0e - Revert "[MachineSSAUpdater] compile time improvement in GetValueInMiddleOfBlock"
Serguei Katkov via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 14 06:27:39 PDT 2022
Author: Serguei Katkov
Date: 2022-06-14T20:27:21+07:00
New Revision: d713f0eab8c4604c6308f1a0135b1d726bdc889b
URL: https://github.com/llvm/llvm-project/commit/d713f0eab8c4604c6308f1a0135b1d726bdc889b
DIFF: https://github.com/llvm/llvm-project/commit/d713f0eab8c4604c6308f1a0135b1d726bdc889b.diff
LOG: Revert "[MachineSSAUpdater] compile time improvement in GetValueInMiddleOfBlock"
It looks like it causes buildbot failures.
As an example: https://lab.llvm.org/buildbot/#/builders/121/builds/20364
Revert to investigate...
This reverts commit 6bf27918144cb843cf5ae9a93cb5f936730f3cce.
Added:
Modified:
llvm/lib/CodeGen/MachineSSAUpdater.cpp
llvm/lib/Transforms/Utils/SSAUpdater.cpp
Removed:
################################################################################
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<Instruction>(defV))
- if (isa<PHINode>(I) || I->getParent() != BB)
- return defV;
-
// Otherwise, we have the hard case. Get the live-in values for each
// predecessor.
SmallVector<std::pair<BasicBlock *, Value *>, 8> PredValues;
More information about the llvm-commits
mailing list