[llvm] [X86] Use generic CPU tuning when tune-cpu is empty (PR #83631)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 4 10:02:49 PST 2024
https://github.com/AtariDreams updated https://github.com/llvm/llvm-project/pull/83631
>From 2c1e541a5d1ed7d9b28c50914886fdd85259a365 Mon Sep 17 00:00:00 2001
From: Rose <83477269+AtariDreams at users.noreply.github.com>
Date: Fri, 1 Mar 2024 17:52:58 -0500
Subject: [PATCH 1/2] [X86] Use generic CPU tuning when tune-cpu is empty
To prevent the test results from being bugged, I ensured this change did not affect 32-bit targets.
---
llvm/lib/Target/X86/X86Subtarget.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/Target/X86/X86Subtarget.cpp b/llvm/lib/Target/X86/X86Subtarget.cpp
index 07f535685e8f97..a2f3c49d48b052 100644
--- a/llvm/lib/Target/X86/X86Subtarget.cpp
+++ b/llvm/lib/Target/X86/X86Subtarget.cpp
@@ -252,7 +252,7 @@ void X86Subtarget::initSubtargetFeatures(StringRef CPU, StringRef TuneCPU,
CPU = "generic";
if (TuneCPU.empty())
- TuneCPU = "i586"; // FIXME: "generic" is more modern than llc tests expect.
+ TuneCPU = Is64Bit ? "generic" : "i586";
std::string FullFS = X86_MC::ParseX86Triple(TargetTriple);
assert(!FullFS.empty() && "Failed to parse X86 triple");
>From 48bfacd490a9bc5ef2e837db660b95e29b2bbf8c Mon Sep 17 00:00:00 2001
From: Rose <83477269+AtariDreams at users.noreply.github.com>
Date: Mon, 4 Mar 2024 12:28:36 -0500
Subject: [PATCH 2/2] Try with HasX86_64
---
llvm/lib/Target/X86/X86Subtarget.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/Target/X86/X86Subtarget.cpp b/llvm/lib/Target/X86/X86Subtarget.cpp
index a2f3c49d48b052..e0d7dccb4f9fb6 100644
--- a/llvm/lib/Target/X86/X86Subtarget.cpp
+++ b/llvm/lib/Target/X86/X86Subtarget.cpp
@@ -252,7 +252,7 @@ void X86Subtarget::initSubtargetFeatures(StringRef CPU, StringRef TuneCPU,
CPU = "generic";
if (TuneCPU.empty())
- TuneCPU = Is64Bit ? "generic" : "i586";
+ TuneCPU = HasX86_64 ? "generic" : "i586";
std::string FullFS = X86_MC::ParseX86Triple(TargetTriple);
assert(!FullFS.empty() && "Failed to parse X86 triple");
More information about the llvm-commits
mailing list