[llvm] [LV] Rewrite UDiv A, B -> UDiv A, UMax(B, 1) in trip counts if needed. (PR #92177)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 00:14:00 PDT 2024


================
@@ -527,6 +528,76 @@ exit:
   ret i64 %p
 }
 
+define i64 @multi_exit_4_exit_count_with_udiv_by_frozen_value_in_latch(ptr %dst, i64 %N) {
----------------
nikic wrote:

So the proposal here is to change the semantics of umin_seq from a select to a conditional branch, so it not only prevents poison propagation but also UB propagation?

Does that really cover all cases? What if we have one exit with a udiv exit count, but also a prior abnormal exit? Maybe not relevant to vectorization, but thinking more generally here.

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


More information about the llvm-commits mailing list