Skip to content

Commit

Permalink
[SVE][InstCombine] Precommit tests for select + ptrue
Browse files Browse the repository at this point in the history
  • Loading branch information
vfdff committed Oct 13, 2023
1 parent ebaf8d4 commit 127cf4e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions llvm/test/Transforms/InstCombine/AArch64/sve-intrinsic-sel.ll
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ define <vscale x 4 x i32> @replace_sel_intrinsic(<vscale x 4 x i1> %p, <vscale x
ret <vscale x 4 x i32> %1
}

define <vscale x 4 x i32> @sel_ptrue(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
; CHECK-LABEL: @sel_ptrue(
; CHECK-NEXT: [[PRED:%.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.ptrue.nxv4i1(i32 31)
; CHECK-NEXT: [[RES:%.*]] = select <vscale x 4 x i1> [[PRED]], <vscale x 4 x i32> [[A:%.*]], <vscale x 4 x i32> [[B:%.*]]
; CHECK-NEXT: ret <vscale x 4 x i32> [[RES]]
;
%pred = call <vscale x 4 x i1> @llvm.aarch64.sve.ptrue.nxv4i1(i32 31)
%res = call <vscale x 4 x i32> @llvm.aarch64.sve.sel.nxv4i32(<vscale x 4 x i1> %pred, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
ret <vscale x 4 x i32> %res
}

declare <vscale x 4 x i1> @llvm.aarch64.sve.ptrue.nxv4i1(i32)
declare <vscale x 4 x i32> @llvm.aarch64.sve.sel.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>, <vscale x 4 x i32>)

attributes #0 = { "target-features"="+sve" }

0 comments on commit 127cf4e

Please sign in to comment.