[llvm] [VPlan] Use llvm.masked.{u, s}{div, rem} for predicated division (PR #191377)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 17 05:23:18 PDT 2026
================
@@ -661,17 +661,22 @@ define void @sdiv_with_uniform_ops(i16 %0, i1 %c, ptr %dst) {
;
; VEC-LABEL: @sdiv_with_uniform_ops(
; VEC-NEXT: entry:
+; VEC-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <2 x i16> poison, i16 [[TMP0:%.*]], i64 0
+; VEC-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <2 x i16> [[BROADCAST_SPLATINSERT]], <2 x i16> poison, <2 x i32> zeroinitializer
+; VEC-NEXT: [[BROADCAST_SPLATINSERT1:%.*]] = insertelement <2 x i1> poison, i1 [[C:%.*]], i64 0
+; VEC-NEXT: [[BROADCAST_SPLAT2:%.*]] = shufflevector <2 x i1> [[BROADCAST_SPLATINSERT1]], <2 x i1> poison, <2 x i32> zeroinitializer
----------------
lukel97 wrote:
This and the diff in struct-return.ll come from the fact that when there's no target, TTI doesn't use BasicTTI and just returns a cost of 1 for the intrinsic. This won't affect anything in practice because targets will use BasicTTI which returns the same safe divisor cost as before.
https://github.com/llvm/llvm-project/pull/191377
More information about the llvm-commits
mailing list