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
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/CodeGen/ExecutionDepsFix.cpp | ||
---|---|---|
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. |
Comment Actions
LGTM with a small nit about the naming.
include/llvm/Target/TargetRegisterInfo.h | ||
---|---|---|
92 ↗ | (On Diff #68156) | 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! |
If the only thing you use rx for is OpRC->getRegister(), can you just iterate over OpRC directly? This will make it less confusing.
I see TargetRegisterClass has a begin()/end(), but I don't see a method that returns a range - perhaps it's worth adding as well, so you can use a range for here.