diff --git a/llvm/test/CodeGen/X86/combine-srem.ll b/llvm/test/CodeGen/X86/combine-srem.ll index 575f37117f2d..254f2a698f93 100644 --- a/llvm/test/CodeGen/X86/combine-srem.ll +++ b/llvm/test/CodeGen/X86/combine-srem.ll @@ -371,6 +371,18 @@ define <4 x i32> @combine_vec_srem_by_pow2b_neg(<4 x i32> %x) { ret <4 x i32> %1 } +; FIXME: PR55271 - srem(undef, 3) != undef +; Use PSLLI intrinsic to postpone the undef creation until after urem-by-constant expansion +define <4 x i32> @combine_vec_srem_undef_by_3(<4 x i32> %in) { +; CHECK-LABEL: combine_vec_srem_undef_by_3: +; CHECK: # %bb.0: +; CHECK-NEXT: retq + %x = call <4 x i32> @llvm.x86.sse2.pslli.d(<4 x i32> undef, i32 0) + %y = srem <4 x i32> %x, + ret <4 x i32> %y +} +declare <4 x i32> @llvm.x86.sse2.pslli.d(<4 x i32>, i32) + ; OSS-Fuzz #6883 ; https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6883 define i32 @ossfuzz6883() { diff --git a/llvm/test/CodeGen/X86/combine-urem.ll b/llvm/test/CodeGen/X86/combine-urem.ll index e0faa355f791..27c209aa6728 100644 --- a/llvm/test/CodeGen/X86/combine-urem.ll +++ b/llvm/test/CodeGen/X86/combine-urem.ll @@ -336,6 +336,18 @@ define <4 x i32> @combine_vec_urem_by_shl_pow2b(<4 x i32> %x, <4 x i32> %y) { ret <4 x i32> %2 } +; FIXME: PR55271 - urem(undef, 3) != undef +; Use PSLLI intrinsic to postpone the undef creation until after urem-by-constant expansion +define <4 x i32> @combine_vec_urem_undef_by_3(<4 x i32> %in) { +; CHECK-LABEL: combine_vec_urem_undef_by_3: +; CHECK: # %bb.0: +; CHECK-NEXT: retq + %x = call <4 x i32> @llvm.x86.sse2.pslli.d(<4 x i32> undef, i32 0) + %y = urem <4 x i32> %x, + ret <4 x i32> %y +} +declare <4 x i32> @llvm.x86.sse2.pslli.d(<4 x i32>, i32) + define i1 @bool_urem(i1 %x, i1 %y) { ; CHECK-LABEL: bool_urem: ; CHECK: # %bb.0: