[llvm] [LV] Don't predicate divs with invariant divisor when folding tail (PR #98904)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 24 14:31:21 PDT 2024


================
@@ -380,41 +380,40 @@ define i16 @reduce_udiv(ptr %src, i16 %x, i64 %N) #0 {
 ; PRED-NEXT:    br i1 false, label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
 ; PRED:       vector.ph:
 ; PRED-NEXT:    [[TMP1:%.*]] = call i64 @llvm.vscale.i64()
-; PRED-NEXT:    [[TMP2:%.*]] = mul i64 [[TMP1]], 8
+; PRED-NEXT:    [[TMP2:%.*]] = mul i64 [[TMP1]], 4
----------------
fhahn wrote:

The costs of both options are very close together. Previously the need to have a vector select in addition to the vector udiv made the difference in favor of 8. So for the current costs, this seems to be working as intended

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


More information about the llvm-commits mailing list