Skip to content

[compiler-rt][cmake] Test COMPILER_RT_HAS_AARCH64_SME with arm64 #141115

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
May 22, 2025

Conversation

usama54321
Copy link
Member

architecture only.

Apple configures CMake only once for compiler-rt, even when building for multiple architectures. As a result, we need to explicitly test for arm64 specific attributes by building for that architecture

architecture only.

Apple configures CMake only once for compiler-rt, even when building for
multiple architectures. As a result, we need to explicitly test for
arm64 specific attributes by building for that architecture

rdar://149068965
"
void foo(void) __arm_streaming_compatible {
asm(\".arch armv9-a+sme2\\n\"
\"smstart\\n\"
\"ldr zt0, [sp]\");
}
")
" "-target aarch64-linux-gnu")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we document somewhere which compilers are supported to build compiler-rt? If we support non-clang compilers, this test won't work on such compilers. (And if we don't support non-clang compilers, why are we checking this?)

Copy link
Contributor

Choose a reason for hiding this comment

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

This SME test is to check the clang being used is new enough to support compiling the builtins for SME.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So you're saying the only supported compiler is clang? What versions of clang?

Copy link
Contributor

Choose a reason for hiding this comment

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

The idea of this test is to check if the clang version is new enough in terms of features that it doesn't barf when given SME2 constructs and the keyword attributes __arm_streaming_compatible. It doesn't need to check for a specific clang version.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't need to hardcode versions here, but we need to have some idea, in general, of what compilers we support. Like, are we going to add code to support clang 3.0? Probably not, but have we written that down anywhere?

Copy link
Contributor

Choose a reason for hiding this comment

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

I was under the impression that LLVM_ENABLE_PROJECTS wasn't supposed to be used anymore for compiler-rt and it was only a matter of time before support is removed completely. On that basis it seems the expectation is that eventually they become rev-locked. At which point some of these tests will become redundant except for ones check a particular target has been built.

And yes, I know that's a self-incriminating statement. I believe we are trying to move to LLVM_ENABLE_RUNTIMES but software is hard.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The removal from LLVM_ENABLE_PROJECTS doesn't necessarily imply anything about the compiler; even in a "runtimes" build you can point to any compiler you want.

libcxx has a specific policy around this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, that's not what I thought it meant. @petrhosek your slides at https://llvm.org/devmtg/2023-10/slides/tutorials/Hosek-UnderstandingtheLLVMbuild.pdf on slide 18 indicate that RUNTIMES mean using the just-built compiler. Is that not strictly true?

Copy link
Collaborator

Choose a reason for hiding this comment

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

LLVM_ENABLE_RUNTIMES is always the just-built compiler, yes. But a "runtimes" build can also just invoked directly (see https://libcxx.llvm.org/VendorDocumentation.html#the-default-build ).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Err, I mean, passing LLVM_ENABLE_RUNTIMES to an LLVM build always uses the LLVM_ENABLE_RUNTIMES. I guess the option for choosing which runtimes are enabled if you directly invoke the runtimes build is also named LLVM_ENABLE_RUNTIMES .

@usama54321 usama54321 merged commit a2ce564 into main May 22, 2025
12 checks passed
@usama54321 usama54321 deleted the users/usama54321/compiler-rt-cmake-sme-fix branch May 22, 2025 22:08
@llvm-ci
Copy link
Collaborator

llvm-ci commented May 23, 2025

LLVM Buildbot has detected a new failure on builder clang-ppc64-aix running on aix-ppc64 while building compiler-rt at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/64/builds/3749

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'lit :: timeout-hang.py' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 13
not env -u FILECHECK_OPTS "/home/llvm/llvm-external-buildbots/workers/env/bin/python3.11" /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/utils/lit/lit.py -j1 --order=lexical Inputs/timeout-hang/run-nonexistent.txt  --timeout=1 --param external=0 | "/home/llvm/llvm-external-buildbots/workers/env/bin/python3.11" /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/build/utils/lit/tests/timeout-hang.py 1
# executed command: not env -u FILECHECK_OPTS /home/llvm/llvm-external-buildbots/workers/env/bin/python3.11 /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/utils/lit/lit.py -j1 --order=lexical Inputs/timeout-hang/run-nonexistent.txt --timeout=1 --param external=0
# .---command stderr------------
# | lit.py: /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/utils/lit/lit/main.py:72: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 1 seconds was requested on the command line. Forcing timeout to be 1 seconds.
# `-----------------------------
# executed command: /home/llvm/llvm-external-buildbots/workers/env/bin/python3.11 /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/build/utils/lit/tests/timeout-hang.py 1
# .---command stdout------------
# | Testing took as long or longer than timeout
# `-----------------------------
# error: command failed with exit status: 1

--

********************


usama54321 added a commit that referenced this pull request May 23, 2025
usama54321 added a commit that referenced this pull request May 23, 2025
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Jun 3, 2025
…m#141115)

architecture only.

Apple configures CMake only once for compiler-rt, even when building for
multiple architectures. As a result, we need to explicitly test for
arm64 specific attributes by building for that architecture
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Jun 3, 2025
ajaden-codes pushed a commit to Jaddyen/llvm-project that referenced this pull request Jun 6, 2025
…m#141115)

architecture only.

Apple configures CMake only once for compiler-rt, even when building for
multiple architectures. As a result, we need to explicitly test for
arm64 specific attributes by building for that architecture
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.

5 participants