[Mlir-commits] [mlir] 80fcc92 - [mlir][AMDGPU] Actually update the default ABI version, add comments (#79185)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Jan 23 10:16:23 PST 2024
Author: Krzysztof Drewniak
Date: 2024-01-23T12:16:18-06:00
New Revision: 80fcc9247a166ca056f049fc4662417b2ae157ce
URL: https://github.com/llvm/llvm-project/commit/80fcc9247a166ca056f049fc4662417b2ae157ce
DIFF: https://github.com/llvm/llvm-project/commit/80fcc9247a166ca056f049fc4662417b2ae157ce.diff
LOG: [mlir][AMDGPU] Actually update the default ABI version, add comments (#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.
Added:
Modified:
mlir/include/mlir/Dialect/GPU/Transforms/Passes.td
mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
Removed:
################################################################################
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