D151036 adds an assertions that prohibits iterating over sub- and
super-registers of a null register. This is already the case when
iterating over register units of a null register, and worked by
accident for sub- and super-registers.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
D151036 adds an assertions that prohibits iterating over sub- and
super-registers of a null register. This is already the case when
iterating over register units of a null register, and worked by
accident for sub- and super-registers.
OK. I had been wondering if it made sense to treat 0 as a kind of empty register, i.e. no regunits, no subregs, no aliases, (not sure about superregs). But if the existing code did not allow you to iterate its regunits then I think it's pretty clear that this was not the intended design.
llvm/lib/Target/AMDGPU/SIFrameLowering.cpp | ||
---|---|---|
568 | @arsenm will ask you to "De Morgan" this :) |
I found only a few cases where this caused problems so far (see the stack). There may be more hidden, but overall I think this change is in the right direction.
I wish there was a way to enumerate all registers without a for-loop like for (i = 0( or 1?), e = TRI->getNumRegs(); i != e; ++i), this would halven the number of issues.
@arsenm will ask you to "De Morgan" this :)