[llvm] [LV] Add early-exit-with-store tests (PR #140899)

Graham Hunter via llvm-commits llvm-commits at lists.llvm.org
Wed May 21 08:16:17 PDT 2025


================
@@ -470,6 +470,192 @@ loop.end:
   ret i64 %retval
 }
 
+define void @loop_contains_store_single_user(ptr dereferenceable(40) noalias %array, ptr align 2 dereferenceable(40) readonly %pred) {
----------------
huntergr-arm wrote:

Yeah, the name could be clearer, will change it. I'm referring to the number of users of the load that forms the exit IR; in the function above (`@loop_contains_store`) `%ld1` is used both as part of the exit condition and as data to be stored. The transformation code I have right now checks recipes in the exit IR for a single user (except for the IV), because otherwise I'd need to introduce a PHI node for the values -- after the transform, we're doing the load for the next vector iteration, not the current one.

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


More information about the llvm-commits mailing list