diff --git a/llvm/test/Transforms/LoopVectorize/RISCV/pr88802.ll b/llvm/test/Transforms/LoopVectorize/RISCV/pr88802.ll new file mode 100644 index 0000000000000..df3680abbf906 --- /dev/null +++ b/llvm/test/Transforms/LoopVectorize/RISCV/pr88802.ll @@ -0,0 +1,31 @@ +; REQUIRES: asserts +; RUN: not --crash opt -passes=loop-vectorize -mtriple=riscv64 -mattr=+v -disable-output %s + +define void @test(ptr %p, i64 %a, i8 %b) { +entry: + br label %for.cond + +for.cond: ; preds = %for.body, %entry + %iv = phi i32 [ 0, %entry ], [ %add, %for.body ] + %add = add i32 %iv, 1 + %cmp.slt = icmp slt i32 %iv, 2 + %shl = shl i64 %a, 48 + %ashr = ashr i64 %shl, 52 + %trunc.i32 = trunc i64 %ashr to i32 + br i1 %cmp.slt, label %cond.false, label %for.body + +cond.false: ; preds = %for.cond + %zext = zext i8 %b to i32 + br label %for.body + +for.body: ; preds = %cond.false, %for.cond + %cond = phi i32 [ %trunc.i32, %for.cond ], [ %zext, %cond.false ] + %shl.i32 = shl i32 %cond, 8 + %trunc = trunc i32 %shl.i32 to i8 + store i8 %trunc, ptr %p, align 1 + %cmp = icmp slt i32 %iv, 2 + br i1 %cmp, label %for.cond, label %exit + +exit: ; preds = %for.body + ret void +} diff --git a/llvm/test/Transforms/LoopVectorize/SystemZ/pr47665.ll b/llvm/test/Transforms/LoopVectorize/SystemZ/pr47665.ll new file mode 100644 index 0000000000000..8451d4a4a5433 --- /dev/null +++ b/llvm/test/Transforms/LoopVectorize/SystemZ/pr47665.ll @@ -0,0 +1,25 @@ +; REQUIRES: asserts +; RUN: not --crash opt -passes=loop-vectorize -mtriple=s390x -mcpu=z14 -disable-output %s + +define void @test(ptr %p, i40 %a) { +entry: + br label %for.body + +for.body: ; preds = %for.body, %entry + %iv = phi i32 [ 0, %entry ], [ %iv.next, %for.body ] + %shl = shl i40 %a, 24 + %ashr = ashr i40 %shl, 28 + %trunc = trunc i40 %ashr to i32 + %icmp.eq = icmp eq i32 %trunc, 0 + %zext = zext i1 %icmp.eq to i32 + %icmp.ult = icmp ult i32 0, %zext + %or = or i1 %icmp.ult, true + %icmp.sgt = icmp sgt i1 %or, false + store i1 %icmp.sgt, ptr %p, align 1 + %iv.next = add i32 %iv, 1 + %cond = icmp ult i32 %iv.next, 10 + br i1 %cond, label %for.body, label %exit + +exit: ; preds = %for.body + ret void +}