[llvm] [PPC] Lower unreachable IR instruction to a trap. (PR #101379)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 9 13:02:13 PDT 2024
RolandF77 wrote:
> I don't think it's appropriate to do this as a per-target opt-in (as long as there is no technical requirement that is actually target specific). If you want to do this change, it should happen globally in clang, for all targets.
I think the target requirement is having way to terminate that is lightweight and non-intrusive. PPC has a h/w instruction trap so it can do this with single inline instruction that has no dependencies. Other targets may require a branching sequence, or maybe a call. The unreachable may be assumed to be hit rarely but a heavier implementation may impact the code around it, the processor state, or the containing function ABI overhead.
https://github.com/llvm/llvm-project/pull/101379
More information about the llvm-commits
mailing list