[clang] [CIR] Wire AMDGPU into the call-convention lowering pass (PR #220197)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 16 04:08:08 PDT 2026
================
@@ -969,10 +1004,25 @@ void CallConvLoweringPass::runOnOperation() {
static constexpr unsigned numAvxLevels =
static_cast<unsigned>(llvm::abi::X86AVXABILevel::Last) + 1;
bool isX86 = target == cir::CallConvTarget::X86_64;
- std::optional<mlir::abi::ABITypeMapper> x86TypeMapper;
+ bool isAMDGPU = target == cir::CallConvTarget::AMDGPU;
+ // The x86_64 and AMDGPU drivers classify with the LLVM ABI library and share
+ // the type mapper; the test and classification-attr drivers do neither.
+ bool useAbiClassifier = isX86 || isAMDGPU;
+ std::optional<mlir::abi::ABITypeMapper> abiTypeMapper;
std::array<std::unique_ptr<llvm::abi::TargetInfo>, numAvxLevels> x86Targets;
- if (isX86)
- x86TypeMapper.emplace(dl);
+ std::unique_ptr<llvm::abi::TargetInfo> amdgpuTarget;
+ if (useAbiClassifier)
+ abiTypeMapper.emplace(dl);
+ if (isAMDGPU) {
----------------
skc7 wrote:
Done. `targetInfoFor` now switches on the target.
https://github.com/llvm/llvm-project/pull/220197
More information about the cfe-commits
mailing list