RegScavenger::backward is preferred because it does not rely on accurate
kill flags.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/AArch64/AArch64SpeculationHardening.cpp | ||
---|---|---|
299–303 | It is unfortunate that RegScavenger::backward(MachineBasicBlock::iterator) does not provide a way to step back to the state right at the start of the MBB. |
llvm/lib/Target/AArch64/AArch64SpeculationHardening.cpp | ||
---|---|---|
299–303 | Would it help to use reverse_iterator? When I first looked into doing this I think I got hung up on making reverse_iterator work just as well |
llvm/lib/Target/AArch64/AArch64SpeculationHardening.cpp | ||
---|---|---|
299–303 | I don't think using reverse_iterator in AArch64SpeculationHardening would help. Did you mean also changing the RegScavenger API to take reverse_iterators? That might make sense, I'm not sure. I think a proper fix would change both the RegScavenger API and the internals to track liveness into *MBBI instead of out of it. But I don't want to change any of that yet. The API lets me do what I need, just in an ugly way. |
llvm/lib/Target/AArch64/AArch64SpeculationHardening.cpp | ||
---|---|---|
299–303 | Yes, I think I had a full set of reverse_iterator APIs but it wasn't particularly usable with everything else expecting forward iterators |
llvm/lib/Target/AArch64/AArch64SpeculationHardening.cpp | ||
---|---|---|
299–303 | FWIW A reverse iterator can be converted to a normal iterator with I.getReverse(). |
It is unfortunate that RegScavenger::backward(MachineBasicBlock::iterator) does not provide a way to step back to the state right at the start of the MBB.