[PATCH] D110182: [LiveIntervals] Find better anchoring end points when repairing ranges
Matthias Braun via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 8 09:10:19 PST 2021
MatzeB added a comment.
Change looks good to me, but I would apreciate a better test.
================
Comment at: llvm/lib/CodeGen/LiveIntervals.cpp:1665-1670
// Find anchor points, which are at the beginning/end of blocks or at
// instructions that already have indexes.
- while (Begin != MBB->begin() && !Indexes->hasIndex(*Begin))
+ while (Begin != MBB->begin() && !Indexes->hasIndex(*std::prev(Begin)))
--Begin;
while (End != MBB->end() && !Indexes->hasIndex(*End))
++End;
----------------
Would it be realistic to replace these two loops with an `assert()` and have the callers perform the adjustments only when necessary?
(just as a suggestions, we don't necessarily need to do this as part of this diff)
================
Comment at: llvm/test/CodeGen/Hexagon/mulhs.ll:2
; RUN: llc -march=hexagon < %s | FileCheck %s
+; RUN: llc -march=hexagon -early-live-intervals -verify-machineinstrs < %s | FileCheck %s
----------------
Could you create a test in `unittests/MI/LiveIntervalTest.cpp` that just does a single call to `repairIntervalsInRange` instead of having this very indirect form of testing?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110182/new/
https://reviews.llvm.org/D110182
More information about the llvm-commits
mailing list