[llvm] [LAA] Relax HasSameSize check on couldPrevertStoreLoadForward (PR #159537)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 3 01:34:06 PDT 2026


================
@@ -483,15 +522,12 @@ exit:
 
 ; Same as the above, but here, the store size should not prevent
 ; ld->st forwarding.
-; TODO: Relax the HasSameSize check; this test should report a
-; forward dependence.
 define void @different_type_sizes_store_size_cannot_prevent_forwarding(ptr %A, ptr noalias %B) {
 ; CHECK-LABEL: 'different_type_sizes_store_size_cannot_prevent_forwarding'
 ; CHECK-NEXT:    loop:
-; CHECK-NEXT:      Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
-; CHECK-NEXT:  Forward loop carried data dependence that prevents store-to-load forwarding.
+; CHECK-NEXT:      Memory dependences are safe
 ; CHECK-NEXT:      Dependences:
-; CHECK-NEXT:        ForwardButPreventsForwarding:
+; CHECK-NEXT:        Forward:
----------------
david-arm wrote:

After load-store forwarding what does the optimised IR look like? Presumably we abandon the load and reuse the bottom 16 bits of the stored value, which in this case is 0. Does the optimised IR look correct for both little and big endian?

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


More information about the llvm-commits mailing list