[llvm] [LoopIdiomVectorize] Preserve address space in FindFirstByte (PR #185226)

Ricardo Jesus via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 02:31:48 PDT 2026


================
@@ -974,6 +974,45 @@ exit:
   ret ptr %res
 }
 
+; Same as @find_first_of_i8 but with non-zero address space pointers.
+; This verifies that the vectorized loop correctly preserves address spaces.
+define ptr addrspace(1) @find_first_of_i8_addrspace(ptr addrspace(1) %search_start, ptr addrspace(1) %search_end, ptr addrspace(1) %needle_start, ptr addrspace(1) %needle_end) #0 {
----------------
rj-jesus wrote:

Could the needle pointers use `addrspace(2)` to ensure different address spaces are handled correctly too?

 It might also be worth moving the test before `@find_first_not_of_i8`, so that the whole IR is matched.

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


More information about the llvm-commits mailing list