-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV][GISEL] instruction-select vmclr (#110782)
This is stacked on #110778. This PR adds and tests renderVLOp too, as that is needed from vmclr.
- Loading branch information
1 parent
78089d5
commit f873fc3
Showing
7 changed files
with
506 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
llvm/test/CodeGen/RISCV/GlobalISel/instruction-select/rvv/render-vlop-rv32.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5 | ||
# RUN: llc -mtriple=riscv32 -mattr=+v,+m -run-pass=instruction-select \ | ||
# RUN: -verify-machineinstrs %s -o - | FileCheck %s | ||
|
||
--- | ||
name: negative_vl | ||
legalized: true | ||
regBankSelected: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.1: | ||
; CHECK-LABEL: name: negative_vl | ||
; CHECK: [[ADDI:%[0-9]+]]:gprnox0 = ADDI $x0, -2 | ||
; CHECK-NEXT: [[PseudoVMCLR_M_B1_:%[0-9]+]]:vr = PseudoVMCLR_M_B1 [[ADDI]], 0 /* e8 */ | ||
; CHECK-NEXT: $v0 = COPY [[PseudoVMCLR_M_B1_]] | ||
; CHECK-NEXT: PseudoRET implicit $v0 | ||
%0:gprb(s32) = G_CONSTANT i32 -2 | ||
%1:vrb(<vscale x 1 x s1>) = G_VMCLR_VL %0(s32) | ||
$v0 = COPY %1(<vscale x 1 x s1>) | ||
PseudoRET implicit $v0 | ||
... | ||
--- | ||
name: nonconst_vl | ||
legalized: true | ||
regBankSelected: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.1: | ||
liveins: $x10 | ||
; CHECK-LABEL: name: nonconst_vl | ||
; CHECK: liveins: $x10 | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x10 | ||
; CHECK-NEXT: [[PseudoVMCLR_M_B1_:%[0-9]+]]:vr = PseudoVMCLR_M_B1 [[COPY]], 0 /* e8 */ | ||
; CHECK-NEXT: $v0 = COPY [[PseudoVMCLR_M_B1_]] | ||
; CHECK-NEXT: PseudoRET implicit $v0 | ||
%0:gprb(s32) = COPY $x10 | ||
%1:vrb(<vscale x 1 x s1>) = G_VMCLR_VL %0(s32) | ||
$v0 = COPY %1(<vscale x 1 x s1>) | ||
PseudoRET implicit $v0 | ||
... | ||
|
||
--- | ||
name: nonzero_vl | ||
legalized: true | ||
regBankSelected: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.1: | ||
; CHECK-LABEL: name: nonzero_vl | ||
; CHECK: [[PseudoVMCLR_M_B1_:%[0-9]+]]:vr = PseudoVMCLR_M_B1 1, 0 /* e8 */ | ||
; CHECK-NEXT: $v0 = COPY [[PseudoVMCLR_M_B1_]] | ||
; CHECK-NEXT: PseudoRET implicit $v0 | ||
%0:gprb(s32) = G_CONSTANT i32 1 | ||
%1:vrb(<vscale x 1 x s1>) = G_VMCLR_VL %0(s32) | ||
$v0 = COPY %1(<vscale x 1 x s1>) | ||
PseudoRET implicit $v0 | ||
... | ||
|
||
--- | ||
name: zero_vl | ||
legalized: true | ||
regBankSelected: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.1: | ||
; CHECK-LABEL: name: zero_vl | ||
; CHECK: [[PseudoVMCLR_M_B1_:%[0-9]+]]:vr = PseudoVMCLR_M_B1 0, 0 /* e8 */ | ||
; CHECK-NEXT: $v0 = COPY [[PseudoVMCLR_M_B1_]] | ||
; CHECK-NEXT: PseudoRET implicit $v0 | ||
%0:gprb(s32) = G_CONSTANT i32 0 | ||
%1:vrb(<vscale x 1 x s1>) = G_VMCLR_VL %0(s32) | ||
$v0 = COPY %1(<vscale x 1 x s1>) | ||
PseudoRET implicit $v0 | ||
... | ||
|
76 changes: 76 additions & 0 deletions
76
llvm/test/CodeGen/RISCV/GlobalISel/instruction-select/rvv/render-vlop-rv64.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5 | ||
# RUN: llc -mtriple=riscv64 -mattr=+v,+m -run-pass=instruction-select \ | ||
# RUN: -verify-machineinstrs %s -o - | FileCheck %s | ||
|
||
--- | ||
name: negative_vl | ||
legalized: true | ||
regBankSelected: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.1: | ||
; CHECK-LABEL: name: negative_vl | ||
; CHECK: [[ADDI:%[0-9]+]]:gprnox0 = ADDI $x0, -2 | ||
; CHECK-NEXT: [[PseudoVMCLR_M_B1_:%[0-9]+]]:vr = PseudoVMCLR_M_B1 [[ADDI]], 0 /* e8 */ | ||
; CHECK-NEXT: $v0 = COPY [[PseudoVMCLR_M_B1_]] | ||
; CHECK-NEXT: PseudoRET implicit $v0 | ||
%0:gprb(s64) = G_CONSTANT i64 -2 | ||
%1:vrb(<vscale x 1 x s1>) = G_VMCLR_VL %0(s64) | ||
$v0 = COPY %1(<vscale x 1 x s1>) | ||
PseudoRET implicit $v0 | ||
... | ||
--- | ||
name: nonconst_vl | ||
legalized: true | ||
regBankSelected: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.1: | ||
liveins: $x10 | ||
; CHECK-LABEL: name: nonconst_vl | ||
; CHECK: liveins: $x10 | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x10 | ||
; CHECK-NEXT: [[PseudoVMCLR_M_B1_:%[0-9]+]]:vr = PseudoVMCLR_M_B1 [[COPY]], 0 /* e8 */ | ||
; CHECK-NEXT: $v0 = COPY [[PseudoVMCLR_M_B1_]] | ||
; CHECK-NEXT: PseudoRET implicit $v0 | ||
%0:gprb(s64) = COPY $x10 | ||
%1:vrb(<vscale x 1 x s1>) = G_VMCLR_VL %0(s64) | ||
$v0 = COPY %1(<vscale x 1 x s1>) | ||
PseudoRET implicit $v0 | ||
... | ||
|
||
--- | ||
name: nonzero_vl | ||
legalized: true | ||
regBankSelected: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.1: | ||
; CHECK-LABEL: name: nonzero_vl | ||
; CHECK: [[PseudoVMCLR_M_B1_:%[0-9]+]]:vr = PseudoVMCLR_M_B1 1, 0 /* e8 */ | ||
; CHECK-NEXT: $v0 = COPY [[PseudoVMCLR_M_B1_]] | ||
; CHECK-NEXT: PseudoRET implicit $v0 | ||
%0:gprb(s64) = G_CONSTANT i64 1 | ||
%1:vrb(<vscale x 1 x s1>) = G_VMCLR_VL %0(s64) | ||
$v0 = COPY %1(<vscale x 1 x s1>) | ||
PseudoRET implicit $v0 | ||
... | ||
|
||
--- | ||
name: zero_vl | ||
legalized: true | ||
regBankSelected: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.1: | ||
; CHECK-LABEL: name: zero_vl | ||
; CHECK: [[PseudoVMCLR_M_B1_:%[0-9]+]]:vr = PseudoVMCLR_M_B1 0, 0 /* e8 */ | ||
; CHECK-NEXT: $v0 = COPY [[PseudoVMCLR_M_B1_]] | ||
; CHECK-NEXT: PseudoRET implicit $v0 | ||
%0:gprb(s64) = G_CONSTANT i64 0 | ||
%1:vrb(<vscale x 1 x s1>) = G_VMCLR_VL %0(s64) | ||
$v0 = COPY %1(<vscale x 1 x s1>) | ||
PseudoRET implicit $v0 | ||
... | ||
|
124 changes: 124 additions & 0 deletions
124
llvm/test/CodeGen/RISCV/GlobalISel/instruction-select/rvv/vmclr-rv32.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py | ||
# RUN: llc -mtriple=riscv32 -mattr=+v,+m -run-pass=instruction-select \ | ||
# RUN: -simplify-mir -verify-machineinstrs %s -o - | FileCheck %s | ||
|
||
--- | ||
name: splat_zero_nxv1i1 | ||
legalized: true | ||
regBankSelected: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.1: | ||
; CHECK-LABEL: name: splat_zero_nxv1i1 | ||
; CHECK: [[PseudoVMCLR_M_B1_:%[0-9]+]]:vr = PseudoVMCLR_M_B1 -1, 0 /* e8 */ | ||
; CHECK-NEXT: $v0 = COPY [[PseudoVMCLR_M_B1_]] | ||
; CHECK-NEXT: PseudoRET implicit $v0 | ||
%0:gprb(s32) = G_CONSTANT i32 -1 | ||
%1:vrb(<vscale x 1 x s1>) = G_VMCLR_VL %0(s32) | ||
$v0 = COPY %1(<vscale x 1 x s1>) | ||
PseudoRET implicit $v0 | ||
... | ||
--- | ||
name: splat_zero_nxv2i1 | ||
legalized: true | ||
regBankSelected: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.1: | ||
; CHECK-LABEL: name: splat_zero_nxv2i1 | ||
; CHECK: [[PseudoVMCLR_M_B2_:%[0-9]+]]:vr = PseudoVMCLR_M_B2 -1, 0 /* e8 */ | ||
; CHECK-NEXT: $v0 = COPY [[PseudoVMCLR_M_B2_]] | ||
; CHECK-NEXT: PseudoRET implicit $v0 | ||
%0:gprb(s32) = G_CONSTANT i32 -1 | ||
%1:vrb(<vscale x 2 x s1>) = G_VMCLR_VL %0(s32) | ||
$v0 = COPY %1(<vscale x 2 x s1>) | ||
PseudoRET implicit $v0 | ||
... | ||
--- | ||
name: splat_zero_nxv4i1 | ||
legalized: true | ||
regBankSelected: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.1: | ||
; CHECK-LABEL: name: splat_zero_nxv4i1 | ||
; CHECK: [[PseudoVMCLR_M_B4_:%[0-9]+]]:vr = PseudoVMCLR_M_B4 -1, 0 /* e8 */ | ||
; CHECK-NEXT: $v0 = COPY [[PseudoVMCLR_M_B4_]] | ||
; CHECK-NEXT: PseudoRET implicit $v0 | ||
%0:gprb(s32) = G_CONSTANT i32 -1 | ||
%1:vrb(<vscale x 4 x s1>) = G_VMCLR_VL %0(s32) | ||
$v0 = COPY %1(<vscale x 4 x s1>) | ||
PseudoRET implicit $v0 | ||
... | ||
--- | ||
name: splat_zero_nxv8i1 | ||
legalized: true | ||
regBankSelected: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.1: | ||
; CHECK-LABEL: name: splat_zero_nxv8i1 | ||
; CHECK: [[PseudoVMCLR_M_B8_:%[0-9]+]]:vr = PseudoVMCLR_M_B8 -1, 0 /* e8 */ | ||
; CHECK-NEXT: $v0 = COPY [[PseudoVMCLR_M_B8_]] | ||
; CHECK-NEXT: PseudoRET implicit $v0 | ||
%0:gprb(s32) = G_CONSTANT i32 -1 | ||
%1:vrb(<vscale x 8 x s1>) = G_VMCLR_VL %0(s32) | ||
$v0 = COPY %1(<vscale x 8 x s1>) | ||
PseudoRET implicit $v0 | ||
... | ||
--- | ||
name: splat_zero_nxv16i1 | ||
legalized: true | ||
regBankSelected: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.1: | ||
; CHECK-LABEL: name: splat_zero_nxv16i1 | ||
; CHECK: [[PseudoVMCLR_M_B16_:%[0-9]+]]:vr = PseudoVMCLR_M_B16 -1, 0 /* e8 */ | ||
; CHECK-NEXT: $v0 = COPY [[PseudoVMCLR_M_B16_]] | ||
; CHECK-NEXT: PseudoRET implicit $v0 | ||
%0:gprb(s32) = G_CONSTANT i32 -1 | ||
%1:vrb(<vscale x 16 x s1>) = G_VMCLR_VL %0(s32) | ||
$v0 = COPY %1(<vscale x 16 x s1>) | ||
PseudoRET implicit $v0 | ||
... | ||
--- | ||
name: splat_zero_nxv32i1 | ||
legalized: true | ||
regBankSelected: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.1: | ||
; CHECK-LABEL: name: splat_zero_nxv32i1 | ||
; CHECK: [[PseudoVMCLR_M_B32_:%[0-9]+]]:vr = PseudoVMCLR_M_B32 -1, 0 /* e8 */ | ||
; CHECK-NEXT: $v0 = COPY [[PseudoVMCLR_M_B32_]] | ||
; CHECK-NEXT: PseudoRET implicit $v0 | ||
%0:gprb(s32) = G_CONSTANT i32 -1 | ||
%1:vrb(<vscale x 32 x s1>) = G_VMCLR_VL %0(s32) | ||
$v0 = COPY %1(<vscale x 32 x s1>) | ||
PseudoRET implicit $v0 | ||
... | ||
--- | ||
name: splat_zero_nxv64i1 | ||
legalized: true | ||
regBankSelected: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.1: | ||
; CHECK-LABEL: name: splat_zero_nxv64i1 | ||
; CHECK: [[PseudoVMCLR_M_B64_:%[0-9]+]]:vr = PseudoVMCLR_M_B64 -1, 0 /* e8 */ | ||
; CHECK-NEXT: $v0 = COPY [[PseudoVMCLR_M_B64_]] | ||
; CHECK-NEXT: PseudoRET implicit $v0 | ||
%0:gprb(s32) = G_CONSTANT i32 -1 | ||
%1:vrb(<vscale x 64 x s1>) = G_VMCLR_VL %0(s32) | ||
$v0 = COPY %1(<vscale x 64 x s1>) | ||
PseudoRET implicit $v0 | ||
... | ||
|
Oops, something went wrong.