[Mlir-commits] [mlir] [mlir][AMDGPU] Actually update the default ABI version, add comments (PR #79185)
Krzysztof Drewniak
llvmlistbot at llvm.org
Tue Jan 23 10:09:59 PST 2024
https://github.com/krzysz00 created https://github.com/llvm/llvm-project/pull/79185
Much confusion occurred earlier today when updating the fallback `int abi;` in addControlVariables() didn't do anything. THis was because that that value is the fallback for if the ABI version fails to parse ... which it always should, because it has a default value that comes from multiple different places.
This commit updates all the places said default variable can come from, namely:
1. The ROCDL target attribute definition
2. The ROCDL target attribute's builders
3. The rocdl-attach-target pass's default option values.
With this, the printf test is passing.
>From ff788461cf21af7a6290d91dced14fac7de26f2b Mon Sep 17 00:00:00 2001
From: Krzysztof Drewniak <Krzysztof.Drewniak at amd.com>
Date: Tue, 23 Jan 2024 18:06:14 +0000
Subject: [PATCH] [mlir][AMDGPU] Actually update the default ABI version, add
comments
Much confusion occurred earlier today when updating the fallback
`int abi;` in addControlVariables() didn't do anything. THis was
because that that value is the fallback for if the ABI version fails
to parse ... which it always should, because it has a default value
that comes from multiple different places.
This commit updates all the places said default variable can come
from, namely:
1. The ROCDL target attribute definition
2. The ROCDL target attribute's builders
3. The rocdl-attach-target pass's default option values.
With this, the printf test is passing.
---
mlir/include/mlir/Dialect/GPU/Transforms/Passes.td | 4 ++--
mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/mlir/include/mlir/Dialect/GPU/Transforms/Passes.td b/mlir/include/mlir/Dialect/GPU/Transforms/Passes.td
index 3e0f6a3022f935f..a8235bed6f27643 100644
--- a/mlir/include/mlir/Dialect/GPU/Transforms/Passes.td
+++ b/mlir/include/mlir/Dialect/GPU/Transforms/Passes.td
@@ -178,8 +178,8 @@ def GpuROCDLAttachTarget: Pass<"rocdl-attach-target", ""> {
/*default=*/"\"\"",
"Target features.">,
Option<"abiVersion", "abi", "std::string",
- /*default=*/"\"400\"",
- "Optimization level.">,
+ /*default=*/"\"500\"",
+ "ABI version.">,
Option<"optLevel", "O", "unsigned",
/*default=*/"2",
"Optimization level.">,
diff --git a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
index 48b830ae34f2922..516a984399ff815 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
@@ -635,7 +635,9 @@ def ROCDL_TargettAttr :
StringRefParameter<"Target triple.", "\"amdgcn-amd-amdhsa\"">:$triple,
StringRefParameter<"Target chip.", "\"gfx900\"">:$chip,
StringRefParameter<"Target chip features.", "\"\"">:$features,
- StringRefParameter<"ABI version.", "\"400\"">:$abi,
+ // Also update the default builder below and rocdl-attach-target in
+ // Dialect/GPU/Transforms/Passes.td .
+ StringRefParameter<"ABI version.", "\"500\"">:$abi,
OptionalParameter<"DictionaryAttr", "Target specific flags.">:$flags,
OptionalParameter<"ArrayAttr", "Files to link to the LLVM module.">:$link
);
@@ -647,7 +649,7 @@ def ROCDL_TargettAttr :
CArg<"StringRef", "\"amdgcn-amd-amdhsa\"">:$triple,
CArg<"StringRef", "\"gfx900\"">:$chip,
CArg<"StringRef", "\"\"">:$features,
- CArg<"StringRef", "\"400\"">:$abiVersion,
+ CArg<"StringRef", "\"500\"">:$abiVersion,
CArg<"DictionaryAttr", "nullptr">:$targetFlags,
CArg<"ArrayAttr", "nullptr">:$linkFiles), [{
return Base::get($_ctxt, optLevel, triple, chip, features, abiVersion,
More information about the Mlir-commits
mailing list