diff options
Diffstat (limited to 'llvm/test/Transforms/InstSimplify/rem.ll')
| -rw-r--r-- | llvm/test/Transforms/InstSimplify/rem.ll | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/rem.ll b/llvm/test/Transforms/InstSimplify/rem.ll index eaa59ba9108..90a0e658235 100644 --- a/llvm/test/Transforms/InstSimplify/rem.ll +++ b/llvm/test/Transforms/InstSimplify/rem.ll @@ -3,6 +3,22 @@ ; Division-by-zero is undef. UB in any vector lane means the whole op is undef. +define <2 x i8> @srem_zero_elt_vec_constfold(<2 x i8> %x) { +; CHECK-LABEL: @srem_zero_elt_vec_constfold( +; CHECK-NEXT: ret <2 x i8> <i8 undef, i8 2> +; + %rem = srem <2 x i8> <i8 1, i8 2>, <i8 0, i8 -42> + ret <2 x i8> %rem +} + +define <2 x i8> @urem_zero_elt_vec_constfold(<2 x i8> %x) { +; CHECK-LABEL: @urem_zero_elt_vec_constfold( +; CHECK-NEXT: ret <2 x i8> <i8 1, i8 undef> +; + %rem = urem <2 x i8> <i8 1, i8 2>, <i8 42, i8 0> + ret <2 x i8> %rem +} + define <2 x i8> @srem_zero_elt_vec(<2 x i8> %x) { ; CHECK-LABEL: @srem_zero_elt_vec( ; CHECK-NEXT: ret <2 x i8> undef |

