This is needed since backend options do not make it to the backend when doing LTO.
Details
- Reviewers
t.p.northover echristo dexonsmith - Commits
- rG0a23fac13cbb: [ARM] Pass subtarget feature "+reserve-r9" instead of passing backend option "…
rG6b7fff9ce57f: [ARM] Pass subtarget feature "+reserve-r9" instead of passing backend option "…
rC242755: [ARM] Pass subtarget feature "+reserve-r9" instead of passing backend
rC242736: [ARM] Pass subtarget feature "+reserve-r9" instead of passing backend
rL242755: [ARM] Pass subtarget feature "+reserve-r9" instead of passing backend
rL242736: [ARM] Pass subtarget feature "+reserve-r9" instead of passing backend
Diff Detail
- Repository
- rL LLVM
Event Timeline
Question:
Would it be better to just use reserve=NUM and parse that rather than the single +/- per register? Or is it just not worth it here?
I guess it could be useful for debugging or testing code-gen passes (for example, register allocator).
AArch64 has a similar option "aarch64-reserve-x18". Are there other targets or use cases that require reserving registers?
The only other use case I can think of is something like the -ffixed-reg= option. I remember there being some issues with trying that in the register allocator, but it might make sense.
Thoughts?
-eric
This case sounds like r9 is a typical ABI difference on the ARM target. Unless there is an example of a real-world ARM ABI case that would benefit from reserving another register I'd not introduce a general reservation mechanism.
In any case this should be independent of switches to the test the register allocator. Testing switches should use cl::opts while proper ABI stuff should indeed use subtarget features.