[llvm] [LiveIntervals] Ignore artificial regs when adding kill flags (PR #116963)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 03:59:52 PST 2024


================
@@ -730,7 +730,16 @@ void LiveIntervals::addKillFlags(const VirtRegMap *VRM) {
     // Find the regunit intervals for the assigned register. They may overlap
     // the virtual register live range, cancelling any kills.
     RU.clear();
-    for (MCRegUnit Unit : TRI->regunits(PhysReg)) {
+    LaneBitmask ArtificialLanes = LaneBitmask::getNone();
+    for (MCRegUnitMaskIterator UI(PhysReg, TRI); UI.isValid(); ++UI) {
+      auto [Unit, Bitmask] = *UI;
+      // Record lane mask for all artificial RegUnits for this physreg.
----------------
sdesmalen-arm wrote:

Not directly, unless I generate a table for it. Iterating through the roots shouldn't be much of a problem in practice, since there can never be more than two roots. (It's actually not clear to me why there would ever be more than one root? What's the use-case for this?)

In either case, I'll move this to a special `isArtificial(MCRegUnit)` method to query this info, to avoid having to write this loop in various places in the future. If you think it's worth generating this in a table though, I'm happy to do so!

https://github.com/llvm/llvm-project/pull/116963


More information about the llvm-commits mailing list