[llvm] [DAG] Enable bitcast STLF for Constant/Undef (PR #172523)

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 10 09:36:08 PST 2026


Michael-Chen-NJU wrote:

> Here is a testcase showing the big-endian problem:
> 
> ```
> ; RUN: llc < %s -mtriple=armeb-eabi -mattr=+v7,+neon -o - | FileCheck %s
> 
> ; Test that store-to-load forwarding extracts the correct subvector on big-endian.
> ; Loading from offset 8 of a v4i32 store should get the HIGH elements (d17), not LOW (d16).
> 
> define <2 x i32> @test_offset_load(ptr %p, <4 x i32> %v) {
> ; CHECK-LABEL: test_offset_load:
> ; CHECK: vmov r1, r12, d17
> ; CHECK-NOT: vldr
> ; CHECK: mov r0, r12
>   store <4 x i32> %v, ptr %p, align 16
>   %p2 = getelementptr i8, ptr %p, i64 8
>   %res = load <2 x i32>, ptr %p2, align 8
>   ret <2 x i32> %res
> }
> ```
Hi @KennethHilmersson

Thank you very much for pointing this out and providing the fix logic along with the test case!

Since the original PR has been merged, I'm planning to create a follow-up PR to address this big-endian regression as you suggested. I'll make sure to include your test case and credit your contribution.

Please let me know if you’d prefer to submit the PR yourself, or if you're happy for me to move forward with it.

Best regards

https://github.com/llvm/llvm-project/pull/172523


More information about the llvm-commits mailing list