Skip to content

Commit 80fcc92

Browse files
authored
[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.
1 parent 5a7d68c commit 80fcc92

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

mlir/include/mlir/Dialect/GPU/Transforms/Passes.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ def GpuROCDLAttachTarget: Pass<"rocdl-attach-target", ""> {
178178
/*default=*/"\"\"",
179179
"Target features.">,
180180
Option<"abiVersion", "abi", "std::string",
181-
/*default=*/"\"400\"",
182-
"Optimization level.">,
181+
/*default=*/"\"500\"",
182+
"ABI version.">,
183183
Option<"optLevel", "O", "unsigned",
184184
/*default=*/"2",
185185
"Optimization level.">,

mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,9 @@ def ROCDL_TargettAttr :
635635
StringRefParameter<"Target triple.", "\"amdgcn-amd-amdhsa\"">:$triple,
636636
StringRefParameter<"Target chip.", "\"gfx900\"">:$chip,
637637
StringRefParameter<"Target chip features.", "\"\"">:$features,
638-
StringRefParameter<"ABI version.", "\"400\"">:$abi,
638+
// Also update the default builder below and rocdl-attach-target in
639+
// Dialect/GPU/Transforms/Passes.td .
640+
StringRefParameter<"ABI version.", "\"500\"">:$abi,
639641
OptionalParameter<"DictionaryAttr", "Target specific flags.">:$flags,
640642
OptionalParameter<"ArrayAttr", "Files to link to the LLVM module.">:$link
641643
);
@@ -647,7 +649,7 @@ def ROCDL_TargettAttr :
647649
CArg<"StringRef", "\"amdgcn-amd-amdhsa\"">:$triple,
648650
CArg<"StringRef", "\"gfx900\"">:$chip,
649651
CArg<"StringRef", "\"\"">:$features,
650-
CArg<"StringRef", "\"400\"">:$abiVersion,
652+
CArg<"StringRef", "\"500\"">:$abiVersion,
651653
CArg<"DictionaryAttr", "nullptr">:$targetFlags,
652654
CArg<"ArrayAttr", "nullptr">:$linkFiles), [{
653655
return Base::get($_ctxt, optLevel, triple, chip, features, abiVersion,

0 commit comments

Comments
 (0)