diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td @@ -171,6 +171,22 @@ } } +class MTypeInfo { + ValueType Mask = Mas; + string BX = bx; +} + +defset list AllMasks = { + // vbool_t, = SEW/LMUL. + def : MTypeInfo; + def : MTypeInfo; + def : MTypeInfo; + def : MTypeInfo; + def : MTypeInfo; + def : MTypeInfo; + def : MTypeInfo; +} + class VTypeInfoToWide { VTypeInfo Vti = vti; @@ -607,7 +623,6 @@ //===----------------------------------------------------------------------===// multiclass VPatUSLoadStoreSDNode { foreach vti = AllVectors in - defm "" : VPatUSLoadStoreSDNode; + foreach vti = AllMasks in + defm "" : VPatUSLoadStoreSDNode; } class VPatBinarySDNode* %pa, * %pb) { +; CHECK-LABEL: test_load_mask_64: +; CHECK: # %bb.0: +; CHECK-NEXT: vsetvli a2, zero, e8,m1,ta,mu +; CHECK-NEXT: vle8.v v25, (a0) +; CHECK-NEXT: vse8.v v25, (a1) +; CHECK-NEXT: ret + %a = load , * %pa + store %a, * %pb + ret void +} + +define void @test_load_mask_32(* %pa, * %pb) { +; CHECK-LABEL: test_load_mask_32: +; CHECK: # %bb.0: +; CHECK-NEXT: vsetvli a2, zero, e8,m1,ta,mu +; CHECK-NEXT: vle8.v v25, (a0) +; CHECK-NEXT: vse8.v v25, (a1) +; CHECK-NEXT: ret + %a = load , * %pa + store %a, * %pb + ret void +} + +define void @test_load_mask_16(* %pa, * %pb) { +; CHECK-LABEL: test_load_mask_16: +; CHECK: # %bb.0: +; CHECK-NEXT: vsetvli a2, zero, e8,m1,ta,mu +; CHECK-NEXT: vle8.v v25, (a0) +; CHECK-NEXT: vse8.v v25, (a1) +; CHECK-NEXT: ret + %a = load , * %pa + store %a, * %pb + ret void +} + +define void @test_load_mask_8(* %pa, * %pb) { +; CHECK-LABEL: test_load_mask_8: +; CHECK: # %bb.0: +; CHECK-NEXT: vsetvli a2, zero, e8,m1,ta,mu +; CHECK-NEXT: vle8.v v25, (a0) +; CHECK-NEXT: vse8.v v25, (a1) +; CHECK-NEXT: ret + %a = load , * %pa + store %a, * %pb + ret void +} + +define void @test_load_mask_4(* %pa, * %pb) { +; CHECK-LABEL: test_load_mask_4: +; CHECK: # %bb.0: +; CHECK-NEXT: vsetvli a2, zero, e8,m1,ta,mu +; CHECK-NEXT: vle8.v v25, (a0) +; CHECK-NEXT: vse8.v v25, (a1) +; CHECK-NEXT: ret + %a = load , * %pa + store %a, * %pb + ret void +} + +define void @test_load_mask_2(* %pa, * %pb) { +; CHECK-LABEL: test_load_mask_2: +; CHECK: # %bb.0: +; CHECK-NEXT: vsetvli a2, zero, e8,m1,ta,mu +; CHECK-NEXT: vle8.v v25, (a0) +; CHECK-NEXT: vse8.v v25, (a1) +; CHECK-NEXT: ret + %a = load , * %pa + store %a, * %pb + ret void +} + +define void @test_load_mask_1(* %pa, * %pb) { +; CHECK-LABEL: test_load_mask_1: +; CHECK: # %bb.0: +; CHECK-NEXT: vsetvli a2, zero, e8,m1,ta,mu +; CHECK-NEXT: vle8.v v25, (a0) +; CHECK-NEXT: vse8.v v25, (a1) +; CHECK-NEXT: ret + %a = load , * %pa + store %a, * %pb + ret void +}