Skip to content

Conversation

@GiuseppeCesarano
Copy link
Contributor

Closes #156312

@github-actions
Copy link

github-actions bot commented Sep 1, 2025

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot
Copy link
Member

llvmbot commented Sep 1, 2025

@llvm/pr-subscribers-backend-aarch64

Author: Giuseppe Cesarano (GiuseppeCesarano)

Changes

Closes #156312


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

2 Files Affected:

  • (modified) llvm/lib/Target/AArch64/AArch64ISelLowering.cpp (+8-3)
  • (added) llvm/test/CodeGen/AArch64/vector-to-scalar-bitmask.ll (+89)
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index b7011e0ea1669..ea83e9d12069b 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -24168,6 +24168,7 @@ static SDValue vectorToScalarBitmask(SDNode *N, SelectionDAG &DAG) {
   // Ensure that all elements' bits are either 0s or 1s.
   ComparisonResult = DAG.getSExtOrTrunc(ComparisonResult, DL, VecVT);
 
+  bool IsLE = DAG.getDataLayout().isLittleEndian();
   SmallVector<SDValue, 16> MaskConstants;
   if (DAG.getSubtarget<AArch64Subtarget>().isNeonAvailable() &&
       VecVT == MVT::v16i8) {
@@ -24175,7 +24176,10 @@ static SDValue vectorToScalarBitmask(SDNode *N, SelectionDAG &DAG) {
     // per entry. We split it into two halves, apply the mask, zip the halves to
     // create 8x 16-bit values, and the perform the vector reduce.
     for (unsigned Half = 0; Half < 2; ++Half) {
-      for (unsigned MaskBit = 1; MaskBit <= 128; MaskBit *= 2) {
+      for (unsigned I = 0; I < 8; ++I) {
+        // On big-endian targets, the lane order in sub-byte vector elements
+        // gets reversed, so we need to flip the bit index.
+        unsigned MaskBit = IsLE ? (1u << I) : (1u << (7 - I));
         MaskConstants.push_back(DAG.getConstant(MaskBit, DL, MVT::i32));
       }
     }
@@ -24193,8 +24197,9 @@ static SDValue vectorToScalarBitmask(SDNode *N, SelectionDAG &DAG) {
   }
 
   // All other vector sizes.
-  unsigned MaxBitMask = 1u << (VecVT.getVectorNumElements() - 1);
-  for (unsigned MaskBit = 1; MaskBit <= MaxBitMask; MaskBit *= 2) {
+  unsigned NumEl = VecVT.getVectorNumElements();
+  for (unsigned I = 0; I < NumEl; ++I) {
+    unsigned MaskBit = IsLE ? (1u << I) : (1u << (NumEl - 1 - I));
     MaskConstants.push_back(DAG.getConstant(MaskBit, DL, MVT::i64));
   }
 
diff --git a/llvm/test/CodeGen/AArch64/vector-to-scalar-bitmask.ll b/llvm/test/CodeGen/AArch64/vector-to-scalar-bitmask.ll
new file mode 100644
index 0000000000000..59c8b7389db54
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/vector-to-scalar-bitmask.ll
@@ -0,0 +1,89 @@
+; RUN: llc -O0 -mtriple=aarch64-linux-gnu %s -o - | FileCheck %s --check-prefix=CHECK-LE
+; RUN: llc -O0 -mtriple=aarch64_be-linux-gnu %s -o - | FileCheck %s --check-prefix=CHECK-BE
+
+@haystack4 = internal unnamed_addr constant [4 x i32] [i32 0, i32 1, i32 2, i32 3], align 4
+@haystack16 = internal unnamed_addr constant [16 x i8] [i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15], align 16
+
+
+define i8 @test4() {
+  %matches = alloca <4 x i1>, align 1
+  %index_ptr = alloca i64, align 8
+  store i64 0, ptr %index_ptr, align 8
+  %index_val = load i64, ptr %index_ptr, align 8
+  %haystack = getelementptr inbounds i32, ptr getelementptr inbounds (i8, ptr @haystack4, i64 0), i64 %index_val
+  %h_vec = load <4 x i32>, ptr %haystack, align 4
+  %cmp_vec = icmp eq <4 x i32> %h_vec, <i32 2, i32 2, i32 2, i32 2>
+  store <4 x i1> %cmp_vec, ptr %matches, align 1
+  %cmp_load = load <4 x i1>, ptr %matches, align 1
+  %extr = extractelement <4 x i1> %cmp_load, i64 2
+  %ret = zext i1 %extr to i8
+  ret i8 %ret
+}
+
+define i8 @test16() {
+  %matches = alloca <16 x i1>, align 2
+  %index_ptr = alloca i64, align 8
+  store i64 0, ptr %index_ptr, align 8
+  %index_val = load i64, ptr %index_ptr, align 8
+  %haystack = getelementptr inbounds i8, ptr getelementptr inbounds (i8, ptr @haystack16, i64 0), i64 %index_val
+  %h_vec = load <16 x i8>, ptr %haystack, align 16
+  %cmp_vec = icmp eq <16 x i8> %h_vec, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
+  store <16 x i1> %cmp_vec, ptr %matches, align 2
+  %cmp_load = load <16 x i1>, ptr %matches, align 2
+  %extr = extractelement <16 x i1> %cmp_load, i64 7
+  %ret = zext i1 %extr to i8
+  ret i8 %ret
+}
+
+; Little endian
+
+; CHECK-LE-LABEL: .LCPI0_0:
+; CHECK-LE-NEXT: .word 1
+; CHECK-LE-NEXT: .word 2
+; CHECK-LE-NEXT: .word 4
+; CHECK-LE-NEXT: .word 8
+
+; CHECK-LE-LABEL: .LCPI1_0:
+; CHECK-LE-NEXT: .byte 1
+; CHECK-LE-NEXT: .byte 2
+; CHECK-LE-NEXT: .byte 4
+; CHECK-LE-NEXT: .byte 8
+; CHECK-LE-NEXT: .byte 16
+; CHECK-LE-NEXT: .byte 32
+; CHECK-LE-NEXT: .byte 64
+; CHECK-LE-NEXT: .byte 128
+; CHECK-LE-NEXT: .byte 1
+; CHECK-LE-NEXT: .byte 2
+; CHECK-LE-NEXT: .byte 4
+; CHECK-LE-NEXT: .byte 8
+; CHECK-LE-NEXT: .byte 16
+; CHECK-LE-NEXT: .byte 32
+; CHECK-LE-NEXT: .byte 64
+; CHECK-LE-NEXT: .byte 128
+
+
+; Big endian
+
+; CHECK-BE-LABEL: .LCPI0_0:
+; CHECK-BE-NEXT: .word 8
+; CHECK-BE-NEXT: .word 4
+; CHECK-BE-NEXT: .word 2
+; CHECK-BE-NEXT: .word 1
+
+; CHECK-BE-LABEL: .LCPI1_0:
+; CHECK-BE-NEXT: .byte 128
+; CHECK-BE-NEXT: .byte 64
+; CHECK-BE-NEXT: .byte 32
+; CHECK-BE-NEXT: .byte 16
+; CHECK-BE-NEXT: .byte 8
+; CHECK-BE-NEXT: .byte 4
+; CHECK-BE-NEXT: .byte 2
+; CHECK-BE-NEXT: .byte 1
+; CHECK-BE-NEXT: .byte 128
+; CHECK-BE-NEXT: .byte 64
+; CHECK-BE-NEXT: .byte 32
+; CHECK-BE-NEXT: .byte 16
+; CHECK-BE-NEXT: .byte 8
+; CHECK-BE-NEXT: .byte 4
+; CHECK-BE-NEXT: .byte 2
+; CHECK-BE-NEXT: .byte 1

@hstk30-hw hstk30-hw requested a review from davemgreen September 1, 2025 11:51
@davemgreen davemgreen requested a review from lawben September 2, 2025 18:41
Copy link
Collaborator

@davemgreen davemgreen left a comment

Choose a reason for hiding this comment

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

Is it possible to add a test that cannot be optimized away and does not require -O0? Or reuse one of the existing ones? This seems difficult to test as the input often includes a bitcast.

@GiuseppeCesarano
Copy link
Contributor Author

Applying volatile to the vector load and store seems to force the compiler to emit the extraction mask, even at higher levels of optimization. Now, the test doesn't depend on -O0 anymore.

Unfortunately, it doesn't seem to be a test that specifically wants to generate this mask, so a completely new one is needed.

If other changes are necessary, please let me know.

@davemgreen
Copy link
Collaborator

Applying volatile to the vector load and store seems to force the compiler to emit the extraction mask, even at higher levels of optimization. Now, the test doesn't depend on -O0 anymore.

Unfortunately, it doesn't seem to be a test that specifically wants to generate this mask, so a completely new one is needed.

If other changes are necessary, please let me know.

Thank that looks a little better, I still worry about the whole global access + compare getting opimized away, and the test just becoming a (volatile) store of a pre-calculated value. I did manage to convince myself that this seems correct for BE.
Can we add a test that looks like one of the llvm/test/CodeGen/AArch64/vec-combine-compare-to-bitmask.ll (maybe convert_to_bitmask16 and convert_to_bitmask8) to the new test file, and then run update_test_checks but also add check lines for the constants produced. The tests in vec-combine-compare-to-bitmask.ll originally included check lines for the constant, but they were lost along the way.

@GiuseppeCesarano
Copy link
Contributor Author

Thank that looks a little better, I still worry about the whole global access + compare getting opimized away, and the test just becoming a (volatile) store of a pre-calculated value

I can see what you mean, I've changed the test as you suggested basically coping and pasting the functions which you pointed out.

The only issue is that I would like to avoid using update_test_checks because the generated checks will test behavior outside the scope of this patch. This makes the test itself more brittle and susceptible to small variations in code generation, causing the test to fail even if the mask is correctly generated and used in the same manner.

It may even prompt the user to rerun update_test_checks without rewriting the mask checks.

@davemgreen
Copy link
Collaborator

I can see what you mean, I've changed the test as you suggested basically coping and pasting the functions which you pointed out.

The only issue is that I would like to avoid using update_test_checks because the generated checks will test behavior outside the scope of this patch. This makes the test itself more brittle and susceptible to small variations in code generation, causing the test to fail even if the mask is correctly generated and used in the same manner.

It may even prompt the user to rerun update_test_checks without rewriting the mask checks.

I see what you mean, but often they can be intertwined and if the codegen changes the lane masks should be changed to accommodate.

Lets go with this version and we can always add extra lines in the future if needed.

Copy link
Collaborator

@davemgreen davemgreen left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix.

Are you happy for me to to hit submit?

@GiuseppeCesarano
Copy link
Contributor Author

I see what you mean, but often they can be intertwined and if the codegen changes the lane masks should be changed to accommodate.

I see your point. I think both versions have their own issues. The current version relies on the correspondence between bits and lanes:

LE:
lane0 = bit0
lane1 = bit1
...

BE:
lane0 = bit(N-1)
lane1 = bit(N-2)
...

This correspondence holds today, but it is not explicitly checked.

I’ve seen other issues caused by this endianness differences, and in those cases the problem was fixed in the surrounding logic and not in the bit–lane mapping itself. For that reason I think this correspondence is unlikely to change, or at least such patch would require special care if it ever did.

If you have a suggestion for how to assert or verify this mapping, I’ll be happy to add it. Otherwise, I’m fine with the patch being merged as is.

@davemgreen davemgreen merged commit 9892dc1 into llvm:main Sep 7, 2025
9 checks passed
@github-actions
Copy link

github-actions bot commented Sep 7, 2025

@GiuseppeCesarano Congratulations on having your first Pull Request (PR) merged into the LLVM Project!

Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR.

Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues.

How to do this, and the rest of the post-merge process, is covered in detail here.

If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again.

If you don't get any reports, no action is required from you. Your changes are working as expected, well done!

@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 7, 2025

LLVM Buildbot has detected a new failure on builder sanitizer-aarch64-linux-bootstrap-asan running on sanitizer-buildbot7 while building llvm at step 2 "annotate".

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

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:527: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:527: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:527: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:527: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/ld.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:527: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:527: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:527: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 90429 tests, 72 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
FAIL: lld :: MachO/read-workers.s (90096 of 90429)
******************** TEST 'lld :: MachO/read-workers.s' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/llvm-mc -filetype=obj -triple=x86_64-apple-darwin /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/lld/test/MachO/read-workers.s -o /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/tools/lld/test/MachO/Output/read-workers.s.tmp.o
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/llvm-mc -filetype=obj -triple=x86_64-apple-darwin /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/lld/test/MachO/read-workers.s -o /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/tools/lld/test/MachO/Output/read-workers.s.tmp.o
# note: command had no output on stdout or stderr
# RUN: at line 5
ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/lld/test/MachO/Inputs/MacOSX.sdk -lSystem -fatal_warnings --read-workers=0 /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/tools/lld/test/MachO/Output/read-workers.s.tmp.o -o /dev/null
# executed command: ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/lld/test/MachO/Inputs/MacOSX.sdk -lSystem -fatal_warnings --read-workers=0 /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/tools/lld/test/MachO/Output/read-workers.s.tmp.o -o /dev/null
# note: command had no output on stdout or stderr
# RUN: at line 6
ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/lld/test/MachO/Inputs/MacOSX.sdk -lSystem -fatal_warnings --read-workers=1 /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/tools/lld/test/MachO/Output/read-workers.s.tmp.o -o /dev/null
# executed command: ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/lld/test/MachO/Inputs/MacOSX.sdk -lSystem -fatal_warnings --read-workers=1 /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/tools/lld/test/MachO/Output/read-workers.s.tmp.o -o /dev/null
# note: command had no output on stdout or stderr
# error: command failed with exit status: 1

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
Slowest Tests:
--------------------------------------------------------------------------
222.48s: Clang :: Driver/fsanitize.c
155.22s: Clang :: Preprocessor/riscv-target-features.c
136.27s: Clang :: Driver/arm-cortex-cpus-2.c
134.10s: Clang :: Driver/arm-cortex-cpus-1.c
133.02s: Clang :: OpenMP/target_defaultmap_codegen_01.cpp
130.30s: Clang :: OpenMP/target_update_codegen.cpp
118.64s: Clang :: Preprocessor/arm-target-features.c
117.72s: Clang :: Preprocessor/aarch64-target-features.c
109.16s: LLVM :: CodeGen/AMDGPU/sched-group-barrier-pipeline-solver.mir
102.23s: LLVM :: CodeGen/RISCV/attributes.ll
99.43s: Clang :: Preprocessor/predefined-arch-macros.c
90.13s: Clang :: Driver/linux-ld.c
87.02s: Clang :: Analysis/a_flaky_crash.cpp
Step 11 (stage2/asan check) failure: stage2/asan check (failure)
...
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:527: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:527: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:527: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:527: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/ld.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:527: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:527: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:527: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 90429 tests, 72 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
FAIL: lld :: MachO/read-workers.s (90096 of 90429)
******************** TEST 'lld :: MachO/read-workers.s' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/llvm-mc -filetype=obj -triple=x86_64-apple-darwin /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/lld/test/MachO/read-workers.s -o /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/tools/lld/test/MachO/Output/read-workers.s.tmp.o
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/llvm-mc -filetype=obj -triple=x86_64-apple-darwin /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/lld/test/MachO/read-workers.s -o /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/tools/lld/test/MachO/Output/read-workers.s.tmp.o
# note: command had no output on stdout or stderr
# RUN: at line 5
ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/lld/test/MachO/Inputs/MacOSX.sdk -lSystem -fatal_warnings --read-workers=0 /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/tools/lld/test/MachO/Output/read-workers.s.tmp.o -o /dev/null
# executed command: ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/lld/test/MachO/Inputs/MacOSX.sdk -lSystem -fatal_warnings --read-workers=0 /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/tools/lld/test/MachO/Output/read-workers.s.tmp.o -o /dev/null
# note: command had no output on stdout or stderr
# RUN: at line 6
ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/lld/test/MachO/Inputs/MacOSX.sdk -lSystem -fatal_warnings --read-workers=1 /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/tools/lld/test/MachO/Output/read-workers.s.tmp.o -o /dev/null
# executed command: ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/lld/test/MachO/Inputs/MacOSX.sdk -lSystem -fatal_warnings --read-workers=1 /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/tools/lld/test/MachO/Output/read-workers.s.tmp.o -o /dev/null
# note: command had no output on stdout or stderr
# error: command failed with exit status: 1

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
Slowest Tests:
--------------------------------------------------------------------------
222.48s: Clang :: Driver/fsanitize.c
155.22s: Clang :: Preprocessor/riscv-target-features.c
136.27s: Clang :: Driver/arm-cortex-cpus-2.c
134.10s: Clang :: Driver/arm-cortex-cpus-1.c
133.02s: Clang :: OpenMP/target_defaultmap_codegen_01.cpp
130.30s: Clang :: OpenMP/target_update_codegen.cpp
118.64s: Clang :: Preprocessor/arm-target-features.c
117.72s: Clang :: Preprocessor/aarch64-target-features.c
109.16s: LLVM :: CodeGen/AMDGPU/sched-group-barrier-pipeline-solver.mir
102.23s: LLVM :: CodeGen/RISCV/attributes.ll
99.43s: Clang :: Preprocessor/predefined-arch-macros.c
90.13s: Clang :: Driver/linux-ld.c
87.02s: Clang :: Analysis/a_flaky_crash.cpp

@GiuseppeCesarano
Copy link
Contributor Author

ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/lld/test/MachO/Inputs/MacOSX.sdk -lSystem -fatal_warnings --read-workers=1 /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/tools/lld/test/MachO/Output/read-workers.s.tmp.o -o /dev/null

The error seems to be unrelated with this patch, it occurs in linking for x86 targets while the current patch only changes aarch64_be codegen

GiuseppeCesarano added a commit to GiuseppeCesarano/llvm-project that referenced this pull request Sep 9, 2025
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.

[AArch64] vector of u1 extraction broken under big endian targets

4 participants