1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc %s -mtriple=riscv64 -mattr=v -riscv-v-vector-bits-min=128 -run-pass=finalize-isel -o - | FileCheck %s
4 # This test makes sure we peak through the COPY instruction between the
5 # IMPLICIT_DEF and PseudoVLE64_V_M8_MASK in order to select the tail agnostic
6 # policy. The test is working if the second argument to PseudoVSETVLI has bit 6
10 ; ModuleID = 'test.ll'
11 source_filename = "test.ll"
12 target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n64-S128"
13 target triple = "riscv64"
15 ; Function Attrs: nounwind
16 define <vscale x 8 x i64> @masked_load_nxv8i64(<vscale x 8 x i64>* %a, <vscale x 8 x i1> %mask) #0 {
17 %load = call <vscale x 8 x i64> @llvm.masked.load.nxv8i64.p0nxv8i64(<vscale x 8 x i64>* %a, i32 8, <vscale x 8 x i1> %mask, <vscale x 8 x i64> undef)
18 ret <vscale x 8 x i64> %load
21 ; Function Attrs: argmemonly nofree nosync nounwind readonly willreturn
22 declare <vscale x 8 x i64> @llvm.masked.load.nxv8i64.p0nxv8i64(<vscale x 8 x i64>*, i32 immarg, <vscale x 8 x i1>, <vscale x 8 x i64>) #1
24 attributes #0 = { nounwind "target-features"="+v" }
25 attributes #1 = { argmemonly nofree nosync nounwind readonly willreturn "target-features"="+v" }
29 name: masked_load_nxv8i64
31 tracksRegLiveness: true
33 - { id: 0, class: gpr }
34 - { id: 1, class: vr }
35 - { id: 2, class: vrm8nov0 }
36 - { id: 3, class: vrm8 }
37 - { id: 4, class: vrm8nov0 }
39 - { reg: '$x10', virtual-reg: '%0' }
40 - { reg: '$v0', virtual-reg: '%1' }
43 machineFunctionInfo: {}
48 ; CHECK-LABEL: name: masked_load_nxv8i64
49 ; CHECK: liveins: $x10, $v0
51 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vr = COPY $v0
52 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x10
53 ; CHECK-NEXT: $v0 = COPY [[COPY]]
54 ; CHECK-NEXT: [[DEF:%[0-9]+]]:vrm8 = IMPLICIT_DEF
55 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vrm8nov0 = COPY [[DEF]]
56 ; CHECK-NEXT: [[PseudoVLE64_V_M8_MASK:%[0-9]+]]:vrm8nov0 = PseudoVLE64_V_M8_MASK [[COPY2]], [[COPY1]], $v0, -1, 6 /* e64 */, 1 /* ta, mu */ :: (load (s512) from %ir.a, align 8)
57 ; CHECK-NEXT: $v8m8 = COPY [[PseudoVLE64_V_M8_MASK]]
58 ; CHECK-NEXT: PseudoRET implicit $v8m8
62 %3:vrm8 = IMPLICIT_DEF
64 %2:vrm8nov0 = PseudoVLE64_V_M8_MASK %4, %0, $v0, -1, 6, 1 :: (load (s512) from %ir.a, align 8)
66 PseudoRET implicit $v8m8