Skip to content

[X86] Assign AVX10_1 feature priority to align with gcc. #94557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

FreddyLeaf
Copy link
Contributor

@llvmbot
Copy link
Member

llvmbot commented Jun 6, 2024

@llvm/pr-subscribers-backend-x86

Author: Freddy Ye (FreddyLeaf)

Changes

gcc patch: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=1f2ca510065a2033bac408eb5a960ef0126f25cc


Full diff: https://github.com/llvm/llvm-project/pull/94557.diff

1 Files Affected:

  • (modified) llvm/include/llvm/TargetParser/X86TargetParser.def (+2-2)
diff --git a/llvm/include/llvm/TargetParser/X86TargetParser.def b/llvm/include/llvm/TargetParser/X86TargetParser.def
index 8daa8a689c95f..f10cede0734e4 100644
--- a/llvm/include/llvm/TargetParser/X86TargetParser.def
+++ b/llvm/include/llvm/TargetParser/X86TargetParser.def
@@ -250,8 +250,8 @@ X86_FEATURE_COMPAT(SHA512,          "sha512",                 0)
 X86_FEATURE_COMPAT(SM4,             "sm4",                    0)
 X86_FEATURE       (EGPR,            "egpr")
 X86_FEATURE_COMPAT(USERMSR,         "usermsr",                0)
-X86_FEATURE_COMPAT(AVX10_1,         "avx10.1-256",            0)
-X86_FEATURE_COMPAT(AVX10_1_512,     "avx10.1-512",            0)
+X86_FEATURE_COMPAT(AVX10_1,         "avx10.1-256",           36)
+X86_FEATURE_COMPAT(AVX10_1_512,     "avx10.1-512",           37)
 // These features aren't really CPU features, but the frontend can set them.
 X86_FEATURE       (RETPOLINE_EXTERNAL_THUNK,    "retpoline-external-thunk")
 X86_FEATURE       (RETPOLINE_INDIRECT_BRANCHES, "retpoline-indirect-branches")

@FreddyLeaf FreddyLeaf requested a review from phoebewang June 6, 2024 02:42
Copy link
Contributor

@phoebewang phoebewang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gcc patch: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=1f2ca510065a2033bac408eb5a960ef0126f25cc

I don't understand the relationship with GCC, E.g., the GCC patch showes AVX10.1-256/512 are not successors to AVX512VP2INTERSECT but X86_64_V4.

@FreddyLeaf
Copy link
Contributor Author

gcc patch: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=1f2ca510065a2033bac408eb5a960ef0126f25cc

I don't understand the relationship with GCC, E.g., the GCC patch showes AVX10.1-256/512 are not successors to AVX512VP2INTERSECT but X86_64_V4.

The priorities of AVX512VP2INTERSECT and many others are added by a long time ago in llvm only. I kept them to not breack backward compatibility in llvm.

@FreddyLeaf
Copy link
Contributor Author

ping

Copy link
Contributor

@phoebewang phoebewang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@FreddyLeaf FreddyLeaf merged commit d843c02 into llvm:main Jun 7, 2024
6 of 9 checks passed
@FreddyLeaf FreddyLeaf deleted the avx10_priority_update branch June 7, 2024 06:17
@tbaederr
Copy link
Contributor

tbaederr commented Jun 7, 2024

I think this broke several codegen/attr tests with assertions enabled:

FAIL: Clang :: CodeGen/unique-internal-linkage-names.cpp (11739 of 22485)
******************** TEST 'Clang :: CodeGen/unique-internal-linkage-names.cpp' FAILED ********************
Exit Code: 2

Command Output (stderr):
--
RUN: at line 3: /root/llvm-project/build/bin/clang -cc1 -internal-isystem /root/llvm-project/build/lib/clang/19/include -nostdsysteminc -triple x86_64-linux-gnu -x c++ -emit-llvm -o - < /root/llvm-project/clang/test/CodeGen/unique-internal-linkage-names.cpp | /root/llvm-project/build/bin/FileCheck /root/llvm-project/clang/test/CodeGen/unique-internal-linkage-names.cpp --check-prefix=PLAIN
+ /root/llvm-project/build/bin/clang -cc1 -internal-isystem /root/llvm-project/build/lib/clang/19/include -nostdsysteminc -triple x86_64-linux-gnu -x c++ -emit-llvm -o -
+ /root/llvm-project/build/bin/FileCheck /root/llvm-project/clang/test/CodeGen/unique-internal-linkage-names.cpp --check-prefix=PLAIN
clang: /root/llvm-project/llvm/lib/TargetParser/X86TargetParser.cpp:763: unsigned int llvm::X86::getFeaturePriority(ProcessorFeatures): Assertion `std::is_permutation(HelperList.begin(), HelperList.end(), std::begin(Priorities), std::end(Priorities)) && "Priorities don't form consecutive range!"' failed.

@FreddyLeaf
Copy link
Contributor Author

Thanks for reminding, I think I forgot to build check-all debug build again. Sorry for that. Will revert first.

FreddyLeaf added a commit that referenced this pull request Jun 7, 2024
FreddyLeaf added a commit to FreddyLeaf/llvm-project that referenced this pull request Jun 7, 2024
FreddyLeaf added a commit to FreddyLeaf/llvm-project that referenced this pull request Jun 7, 2024
FreddyLeaf added a commit that referenced this pull request Jun 11, 2024
Lukacma pushed a commit to Lukacma/llvm-project that referenced this pull request Jun 12, 2024
@HerrCai0907 HerrCai0907 mentioned this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants