According to the LoongArch Toolchain Conventions
it is possible to specify the ABI modifier (the "D" part of "LP64D")
via the environment field in the target triple. This is needed for
proper support for Debian-style multiarch tuples as well, so add triple
awareness to LoongArchSubtarget via addition of
LoongArchABI::computeTargetABI. Let the explicit --target-abi
argument intuitively take precedence over the triple-implied ABI.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks. Overall LGTM except the handling of FeatureBits (maybe can be handled in a seperate patch) and some nits.
llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.cpp | ||
---|---|---|
24 | Shall we handle FeatureBits as well? | |
50–52 | Missing test? | |
llvm/test/CodeGen/LoongArch/target-abi-from-triple.ll | ||
2 | Is this test autogenerated? | |
3 | I'm not sure whether we should add tests causing crash that may slow down testing. I remeber @MaskRay once suggested me not to do so. | |
81–85 | Are these lines useful? |
llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.cpp | ||
---|---|---|
24 | I saw RISCV include FeatureBits in their computeTargetABI, but right now we're not making use of it (we don't base our selection of bitness on the parsed FeatureBits). I'd say let's add it later when needed. | |
50–52 | Thanks for checking, I'll cover this branch later. | |
llvm/test/CodeGen/LoongArch/target-abi-from-triple.ll | ||
2 | The generated code is, but the other isn't. Given you already hesitated on this matter, let me adjust then. | |
3 | I vaguely remember such an occasion too, let me remove the crash assertions and replace with simple comments then. It's not like I'm not coming back to remove the TODOs ;-) | |
81–85 | They're added automatically by the update_llc_test_checks.py script. I'll remove them. |
Shall we handle FeatureBits as well?