aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineCombiner.cpp
diff options
context:
space:
mode:
authorJonas Paulsson <paulson1@linux.ibm.com>2024-03-14 11:47:29 -0400
committerGitHub <noreply@github.com>2024-03-14 11:47:29 -0400
commit6588ac3017df0095b160510f56dcb3e4c32a09f0 (patch)
tree4cec968a50bced77786c0561171a1d7ef3827d1b /llvm/lib/CodeGen/MachineCombiner.cpp
parent92a09c0165b87032e1bd05020a78ed845cf35661 (diff)
downloadllvm-6588ac3017df0095b160510f56dcb3e4c32a09f0.zip
llvm-6588ac3017df0095b160510f56dcb3e4c32a09f0.tar.gz
llvm-6588ac3017df0095b160510f56dcb3e4c32a09f0.tar.bz2
[MachineCombiner] Don't ignore PHI depths (#82025)
The depths of the Root and the NewRoot are to be compared in MachineCombiner::improvesCriticalPathLen(), and while the call to BlockTrace.getInstrCycles(*Root) includes the Depth of a PHI, for some reason PHI nodes have been ignored in getOperandDef(). This patch removes the special handling of PHIs in getOperandDef() so that Root and NewRoot get a fair comparison. This does not affect loop headers as MachineTraceMetrics handles that case by ignoring incoming PHI edges.
Diffstat (limited to 'llvm/lib/CodeGen/MachineCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCombiner.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineCombiner.cpp b/llvm/lib/CodeGen/MachineCombiner.cpp
index c659379..a4c87a7 100644
--- a/llvm/lib/CodeGen/MachineCombiner.cpp
+++ b/llvm/lib/CodeGen/MachineCombiner.cpp
@@ -155,9 +155,6 @@ MachineCombiner::getOperandDef(const MachineOperand &MO) {
// We need a virtual register definition.
if (MO.isReg() && MO.getReg().isVirtual())
DefInstr = MRI->getUniqueVRegDef(MO.getReg());
- // PHI's have no depth etc.
- if (DefInstr && DefInstr->isPHI())
- DefInstr = nullptr;
return DefInstr;
}