[PATCH] D55295: LiveIntervals: Add removePhysReg

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 13 13:08:28 PST 2019

kparzysz accepted this revision.
kparzysz added inline comments.

Comment at: include/llvm/CodeGen/LiveIntervals.h:423
+    /// Reg. Subsequent uses should rely on on-demand recomputation.
+    void removePhysReg(unsigned Reg) {
+      for (MCRegUnitIterator Units(Reg, TRI); Units.isValid(); ++Units)
arsenm wrote:
> kparzysz wrote:
> > qcolombet wrote:
> > > arsenm wrote:
> > > > kparzysz wrote:
> > > > > Could this be called `removePhysRegUnits`?  I think it would make it clearer what it actually does.
> > > > You are passing it a physreg, not a regunit so I think that would be more confusing. This is sort of hiding the implementation detail that the liveness of RegUnits is tracked
> > > Agree with Matt.
> > There exist register units that are shared between physical registers, so removing all units contained in a phys reg A can affect units from phys reg B.  In that sense removing register A affects information about register B.  It appears counterintuitive when you think of it as "removing a register", but makes sense when you think about "removing register's units".
> What about an overly verbose name like "removeAllRegUnitsForPhysReg"?
Sure, why not. :)



More information about the llvm-commits mailing list