[llvm] [LV] Add extra check for signed oveflow for SDiv/SRem (PR #170818)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 5 01:29:05 PST 2025
================
@@ -599,7 +600,8 @@ define void @predicated_sdiv_by_minus_one(ptr noalias nocapture %a, i64 %n) {
; FIXED-NEXT: [[WIDE_LOAD1:%.*]] = load <32 x i8>, ptr [[TMP1]], align 1
; FIXED-NEXT: [[TMP5:%.*]] = icmp ne <32 x i8> [[WIDE_LOAD1]], splat (i8 -128)
; FIXED-NEXT: [[TMP7:%.*]] = select <32 x i1> [[TMP5]], <32 x i8> splat (i8 -1), <32 x i8> splat (i8 1)
-; FIXED-NEXT: [[TMP9:%.*]] = sdiv <32 x i8> [[WIDE_LOAD1]], [[TMP7]]
+; FIXED-NEXT: [[TMP3:%.*]] = select <32 x i1> [[TMP5]], <32 x i8> [[WIDE_LOAD1]], <32 x i8> zeroinitializer
+; FIXED-NEXT: [[TMP9:%.*]] = sdiv <32 x i8> [[TMP3]], [[TMP7]]
----------------
lukel97 wrote:
It looks like these tests all got predicated previously anyway. I think we need to add a new test where the divisor is loop invariant and the division isn't in a predicated block
https://github.com/llvm/llvm-project/pull/170818
More information about the llvm-commits
mailing list