[PATCH] D139732: [AMDGPU] Add pass to rewrite partially used virtual superregisters after RenameIndependentSubregs pass with registers of minimal size.

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 01:42:19 PST 2023


qcolombet added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/LiveInterval.h:713
                                    /// ranges.
-    const Register Reg; // the register or stack slot of this interval.
+    Register Reg;       // the register or stack slot of this interval.
     float Weight = 0.0; // weight of this interval
----------------
arsenm wrote:
> These generic header changes should be split into a separate patch, at first glance I don't understand why they are necessary
That change looks very wrong to me.

If we want to "update" a live interval so that it points to a different register, the proper way to do this is to create a new one and shrink/remove the old one.

We have plenty of helper functions to do that.
Look at `LiveIntervals::createEmptyInterval`, `LiveIntervals::extendSegmentsToUses`, `LiveIntervals::shrinkToUses`, etc.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139732/new/

https://reviews.llvm.org/D139732



More information about the llvm-commits mailing list