This does not result in changes for any of the current tests, but it might
improve debug information in some cases.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This is technically correct, but looking at the other targets it seems that the hook is generally being used more restrictively for instructions where you actually have some expectation of it being a copy/move. Do we really want to go down this route? In principle we'd have to later expand this to e.g. all of the bitmanip instructions that can implement copies and so on, which seems a bit like a reductio ad absurdum. Having tests showing at least a little bit of benefit would help make the case for this patch :-)
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | ||
---|---|---|
541–542 | Do the ORI, XORI cases also provide a measurable benefit here, as they do for isAsCheapAsAMove? Taking a step back, is there a principled way to decide which instructions we include? I can see two cases that are easy to defend: (1) keeping only canonical move instructions; (2) adding all instructions that provide some benefit. Without tests it's not obvious to me that ORI and XORI fit the second case. Did you check if the commits for other uses of this hook had tests that we could adapt? |
I was hoping others would chime in regarding what instructions should be handled in this hook.
@arichardson How do you feel about removing the ORI/XORI and landing this patch? (I also have no major objections to just landing as is). We can always further improve it later. Ideally this would add tests, but if that's not easy I think it's OK to land it as is.
Yeah I agree without further info I think we should land just the canonical moves.
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | ||
---|---|---|
548 |
Do the ORI, XORI cases also provide a measurable benefit here, as they do for isAsCheapAsAMove? Taking a step back, is there a principled way to decide which instructions we include? I can see two cases that are easy to defend: (1) keeping only canonical move instructions; (2) adding all instructions that provide some benefit. Without tests it's not obvious to me that ORI and XORI fit the second case. Did you check if the commits for other uses of this hook had tests that we could adapt?