diff options
author | Anton Sidorenko <anton.sidorenko@syntacore.com> | 2022-11-18 12:33:02 +0300 |
---|---|---|
committer | Anton Sidorenko <anton.sidorenko@syntacore.com> | 2022-11-21 12:56:40 +0300 |
commit | fb47bb37e4fe7b67bde31bca93d9b31dd55c0caa (patch) | |
tree | ae652ab39755e59c6bb7ae8fb1220c36b16154a4 /llvm/lib/CodeGen/MachineTraceMetrics.cpp | |
parent | 0c22cdfdd1bff6b0fddba8124ab5478884d1629c (diff) | |
download | llvm-fb47bb37e4fe7b67bde31bca93d9b31dd55c0caa.zip llvm-fb47bb37e4fe7b67bde31bca93d9b31dd55c0caa.tar.gz llvm-fb47bb37e4fe7b67bde31bca93d9b31dd55c0caa.tar.bz2 |
[MachineTraceMetrics] Pick the trace successor for an entry block
We generate erroneous trace for a basic block if it does not have at least one
predecessor when MinInstr strategy is used. Currently only this strategy is
implemented, so we always have a wrong trace for any entry block. This results in
wrong instructions heights calculation and also leads to wrong critical path.
The described behavior is demonstrated on a simple test. It shows that early
if-conv pass makes wrong decisions due to incorrectly calculated critical path
lenght.
Differential Revision: https://reviews.llvm.org/D138272
Diffstat (limited to 'llvm/lib/CodeGen/MachineTraceMetrics.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineTraceMetrics.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineTraceMetrics.cpp b/llvm/lib/CodeGen/MachineTraceMetrics.cpp index 715e5da..dc6746e 100644 --- a/llvm/lib/CodeGen/MachineTraceMetrics.cpp +++ b/llvm/lib/CodeGen/MachineTraceMetrics.cpp @@ -352,7 +352,7 @@ MinInstrCountEnsemble::pickTracePred(const MachineBasicBlock *MBB) { // Select the preferred successor for MBB. const MachineBasicBlock* MinInstrCountEnsemble::pickTraceSucc(const MachineBasicBlock *MBB) { - if (MBB->pred_empty()) + if (MBB->succ_empty()) return nullptr; const MachineLoop *CurLoop = getLoopFor(MBB); const MachineBasicBlock *Best = nullptr; |