-
Notifications
You must be signed in to change notification settings - Fork 13.7k
[TargetParser] Parse Amazon Linux triple and handle RuntimeLibcalls #136114
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
Open
MacDue
wants to merge
1
commit into
llvm:main
Choose a base branch
from
MacDue:amz_triple
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
llvm/test/Transforms/LoopVectorize/AArch64/multiple-result-intrinsics.ll
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Adding a TT.isAmazonLinux() condition doesn't scale as there are many isGNUEnvironment conditions.
Ideally you should switch to
aarch64-amazon-linux-gnu
. As an alternative (but it's not a good idea to not switch tolinux-gnu
, setEnvironment
to GNU, perhaps inTriple::Triple
.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.
I agree, but I don't think that's a change I can make. AFAIK this is just the triple Amazon Linux uses.
That would seem to go against the documentation for
Triple
.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.
It looks like setting in the environment within
Triple::normalize
could work though.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.
I've tried that. I've set
LLVM_DEFAULT_TARGET_TRIPLE=aarch64-amazon-linux-gnu
in CMake. The compiler built that way has proven to be useless on Amazon Linux, not to mention it is not passing anymake check
tests, it fails very quickly like this:And the reason for this is pretty obvious, Amazon Linux treats its triple pretty seriously and uses it wherever it can, e.g., where is libstdc++.so?:
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.
@MaskRay any thoughts on the above, or the possible alternative solution with
Triple::normalize
in #140070?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.
Thanks for trying multiple solutions. #140070 looks cleaner and avoids adding isAmazonlinux to other places isGNUEnvironment is used. Will we treat aarch64-amazon-linux-gnu as the triple and prefer it elsewhere? Perhaps yes.
So we just need a way to recognize the aarch64-amazon-linux gcc installation.
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.
@MaskRay that's an interesting proposal worth pursuing. Do you have any specific mechanism of doing so in mind? At what level such recognition activity could be implemented?
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.
To restore LLVM's consistency, LLVM internally should use aarch64-amazon-linux-gnu. The configure-time LLVM_DEFAULT_TARGET_TRIPLE, and the target triple in clang --version output, in the runtime library directory (lib/target/$triple), and the clang -S -emit-llvm output, should all use linux-gnu.
Perhaps we need a llvm/cmake/config.guess change.
clang driver needs a way to pick up aarch64-amazon-linux GCC installation. The user should specify
--gcc-triple=
correctly, or perhaps we can have a small hack within clang driver to do it.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.
Yes, that's one way we could explore, perhaps after restoring LLVM's consistency (and neutrality). This can happen in parallel, meanwhile we'd have to propose something that would fit into the LLVM21 timeframe.
We should not require the user to do anything more on AArch64 than they do on x86_64, and nothing more on Amazon Linux than they do on RedHat. That's consistency and neutrality.