In theory the indices of RC (and thus the index used for LiveRegs) may differ from the indices of OpRC.
Fixed the code to extract the correct RC index.
OpRC contains the first X consecutive elements of RC, and thus their indices are currently de facto the same, therefore a test cannot be added at this point.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/CodeGen/ExecutionDepsFix.cpp | ||
---|---|---|
511–512 | If the only thing you use rx for is OpRC->getRegister(), can you just iterate over OpRC directly? This will make it less confusing. |
LGTM with a small nit about the naming.
include/llvm/Target/TargetRegisterInfo.h | ||
---|---|---|
92 | For iterator_ranges, we tend to use names that follow the STL convention, not LLVM. So I'd suggest something like "registers()" or "regs()". |
llvm/trunk/include/llvm/Target/TargetRegisterInfo.h | ||
---|---|---|
91–94 ↗ | (On Diff #68334) | Why did you add this? for (unsigned Reg : RegClass) { } already worked! |
For iterator_ranges, we tend to use names that follow the STL convention, not LLVM. So I'd suggest something like "registers()" or "regs()".