blob: 8033be0bc02d989267592a4c19fb09a65466c89f [file] [edit]
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
; RUN: opt -p instsimplify -S < %s | FileCheck %s
define <4 x i1> @v4i1_zero() {
; CHECK-LABEL: define <4 x i1> @v4i1_zero() {
; CHECK-NEXT: ret <4 x i1> splat (i1 true)
;
%res = call <4 x i1> @llvm.mask.beforefirst(<4 x i1> zeroinitializer)
ret <4 x i1> %res
}
define <4 x i1> @v4i1_ones() {
; CHECK-LABEL: define <4 x i1> @v4i1_ones() {
; CHECK-NEXT: ret <4 x i1> zeroinitializer
;
%res = call <4 x i1> @llvm.mask.beforefirst(<4 x i1> splat (i1 true))
ret <4 x i1> %res
}
define <4 x i1> @v4i1() {
; CHECK-LABEL: define <4 x i1> @v4i1() {
; CHECK-NEXT: ret <4 x i1> <i1 true, i1 false, i1 false, i1 false>
;
%res = call <4 x i1> @llvm.mask.beforefirst(<4 x i1> <i1 false, i1 true, i1 false, i1 true>)
ret <4 x i1> %res
}
define <4 x i1> @v4i1_poison() {
; CHECK-LABEL: define <4 x i1> @v4i1_poison() {
; CHECK-NEXT: ret <4 x i1> poison
;
%res = call <4 x i1> @llvm.mask.beforefirst(<4 x i1> <i1 false, i1 true, i1 poison, i1 false>)
ret <4 x i1> %res
}
define <vscale x 4 x i1> @nxv4i1_zero() {
; CHECK-LABEL: define <vscale x 4 x i1> @nxv4i1_zero() {
; CHECK-NEXT: ret <vscale x 4 x i1> splat (i1 true)
;
%res = call <vscale x 4 x i1> @llvm.mask.beforefirst(<vscale x 4 x i1> zeroinitializer)
ret <vscale x 4 x i1> %res
}
define <vscale x 4 x i1> @nxv4i1_ones() {
; CHECK-LABEL: define <vscale x 4 x i1> @nxv4i1_ones() {
; CHECK-NEXT: ret <vscale x 4 x i1> zeroinitializer
;
%res = call <vscale x 4 x i1> @llvm.mask.beforefirst(<vscale x 4 x i1> splat (i1 true))
ret <vscale x 4 x i1> %res
}
define <vscale x 4 x i1> @nxv4i1_poison() {
; CHECK-LABEL: define <vscale x 4 x i1> @nxv4i1_poison() {
; CHECK-NEXT: ret <vscale x 4 x i1> poison
;
%res = call <vscale x 4 x i1> @llvm.mask.beforefirst(<vscale x 4 x i1> poison)
ret <vscale x 4 x i1> %res
}