-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
[X86] Use generic CPU tuning when tune-cpu is empty #83631
Conversation
@llvm/pr-subscribers-lld-coff @llvm/pr-subscribers-backend-x86 Author: AtariDreams (AtariDreams) ChangesFull diff: https://github.com/llvm/llvm-project/pull/83631.diff 1 Files Affected:
diff --git a/llvm/lib/Target/X86/X86Subtarget.cpp b/llvm/lib/Target/X86/X86Subtarget.cpp
index 07f535685e8f97..0c263a2e9c3dd8 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 = "generic";
std::string FullFS = X86_MC::ParseX86Triple(TargetTriple);
assert(!FullFS.empty() && "Failed to parse X86 triple");
|
|
This doesn't change any tests? |
It does now. |
005bd35
to
c028bc7
Compare
Please check the CI - these failures look relevant
|
they are and I am getting to them. |
This is a turbulent change to both upstream and downstream tests without any profit as far as I can tell. I did a similar change for 64-bit a few years ago: https://reviews.llvm.org/D129647 In comparison, this patch is not to solve a specific problem. It should not show any value because we don't care about 32-bit performance. Not to mention, we need to keep the test not changed as many as possible. The way we used in D129647 is to add an explicit "tune-cpu". We cannot blindly update tests in case distort the original intention. |
I think I probaby wrote the FIXME and I agree with @phoebewang |
Wait does this only affect 32 bit? |
bddb9fe
to
1f7d956
Compare
No, I took another look. It not only affects 32 bit. The 64 bit uses i586 tuning as well, which should be fixed. So there would be still a lot of tests need to update. |
48bfacd
to
4aeceb6
Compare
To prevent the test results from being bugged, I ensured this change did not affect 32-bit targets.
@phoebewang What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@phoebewang What do you think?
This happens only when both CPU
and TuneCPU
are empty. Front ends like Clang always sets a valid CPU
, while most llc tests are not sensitive to tuning targets (the rest already set target-cpu/tune-cpu). So I think the change doesn't have much value in reality.
Nevertheless, I think it's good to reduce one FIXME, so LGTM.
This did not fix the FIXME. Checking Is64Bit is the correct fix. Checking HasX86_64 is useless, that's never set if there is no CPU provided. |
Oh, right. The |
This reverts commit bafda89.
Reverts #83631 Using `HasX86_64` is incorrect.
Reverted it. |
Even |
To prevent the test results from being bugged, I had to edit the initializer of the vectorizer loop to ensure the command line parameters were heeded, and then updated the tests.