[llvm] AMDGPU: Validate processor and features in TargetID parsing (PR #209304)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 13 13:58:13 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- llvm/include/llvm/TargetParser/AMDGPUTargetParser.h llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp llvm/lib/Target/AMDGPU/GCNSubtarget.h llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp llvm/lib/TargetParser/AMDGPUTargetParser.cpp llvm/unittests/TargetParser/TargetParserTest.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/TargetParser/AMDGPUTargetParser.cpp b/llvm/lib/TargetParser/AMDGPUTargetParser.cpp
index 9af562113..e6e0050c2 100644
--- a/llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+++ b/llvm/lib/TargetParser/AMDGPUTargetParser.cpp
@@ -918,7 +918,8 @@ static TargetIDSetting getTargetIDSettingFromFeatureString(StringRef Sign) {
return TargetIDSetting::Unsupported;
}
-StringRef AMDGPU::splitTargetID(StringRef TargetID, TargetIDSetting &XnackSetting,
+StringRef AMDGPU::splitTargetID(StringRef TargetID,
+ TargetIDSetting &XnackSetting,
TargetIDSetting &SramEccSetting) {
XnackSetting = TargetIDSetting::Unsupported;
SramEccSetting = TargetIDSetting::Unsupported;
diff --git a/llvm/unittests/TargetParser/TargetParserTest.cpp b/llvm/unittests/TargetParser/TargetParserTest.cpp
index acde2ca2b..80acea3ae 100644
--- a/llvm/unittests/TargetParser/TargetParserTest.cpp
+++ b/llvm/unittests/TargetParser/TargetParserTest.cpp
@@ -2958,8 +2958,8 @@ TEST(TargetParserTest, testAMDGPUSplitTargetID) {
std::make_tuple(StringRef("gfx90a"), TargetIDSetting::Off,
TargetIDSetting::On));
- // The processor may be a multi-component prefix (e.g. a full bundle-entry id);
- // splitTargetID is purely syntactic and does not validate it.
+ // The processor may be a multi-component prefix (e.g. a full bundle-entry
+ // id); splitTargetID is purely syntactic and does not validate it.
EXPECT_EQ(Split("hip-amdgcn-amd-amdhsa-gfx906:xnack+"),
std::make_tuple(StringRef("hip-amdgcn-amd-amdhsa-gfx906"),
TargetIDSetting::On, TargetIDSetting::Any));
``````````
</details>
https://github.com/llvm/llvm-project/pull/209304
More information about the llvm-commits
mailing list