Convenience wrapper for removing the reg units of a physical register.
Diff Detail
Event Timeline
LGTM with nitpick.
include/llvm/CodeGen/LiveIntervals.h | ||
---|---|---|
422 | The line break between \p and the name of the argument looks weird. |
include/llvm/CodeGen/LiveIntervals.h | ||
---|---|---|
423 | Could this be called removePhysRegUnits? I think it would make it clearer what it actually does. |
include/llvm/CodeGen/LiveIntervals.h | ||
---|---|---|
423 | 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 |
include/llvm/CodeGen/LiveIntervals.h | ||
---|---|---|
423 | Agree with Matt. |
include/llvm/CodeGen/LiveIntervals.h | ||
---|---|---|
423 | 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". |
I'm not trying to block this from being committed, but I'm really not a fan of it. I think that register units are fundamental enough not to be treated as an "implementation detail". Besides, they are quite explicit in the public interface of LiveIntervals.
include/llvm/CodeGen/LiveIntervals.h | ||
---|---|---|
423 | What about an overly verbose name like "removeAllRegUnitsForPhysReg"? |
include/llvm/CodeGen/LiveIntervals.h | ||
---|---|---|
423 | Sure, why not. :) |
include/llvm/CodeGen/LiveIntervals.h | ||
---|---|---|
423 | Good point. Actually, this makes me wonder about the usefulness of this API. All in all, now I am not convinced we should add that. |
include/llvm/CodeGen/LiveIntervals.h | ||
---|---|---|
423 | There are a number of places that this is repeated. AMDGPU has a few places which should be doing this, but incorrectly remove only the first regunit in the iterator (in places where it's assumed the intervals will be recomputed as needed) I also use this a few places in D55301, where the live intervals just need to be deleted since they won't be needed again. Also for naming reference, RegScavenger::removeRegUnits |
include/llvm/CodeGen/LiveIntervals.h | ||
---|---|---|
423 | Alright sounds good then. |
The line break between \p and the name of the argument looks weird.