Skip to content

Commit a44aeab

Browse files
committed
[RISCV] Add MIR tests exposing missed InstAliases
The InstAlias framework cannot match registers against zero_reg, which RVV uses to encode unmasked operations. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D92228
1 parent 849e749 commit a44aeab

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# RUN: llc -mtriple riscv32 -mattr=+v -start-after riscv-expand-pseudo -o - %s | FileCheck %s
2+
# RUN: llc -mtriple riscv64 -mattr=+v -start-after riscv-expand-pseudo -o - %s | FileCheck %s
3+
4+
# FIXME: These should all use the 'vnot' alias despite some not having mask operands
5+
--- |
6+
define void @vnot_mask_1() {
7+
ret void
8+
}
9+
define void @vnot_mask_2() {
10+
ret void
11+
}
12+
define void @vnot_no_mask_1() {
13+
ret void
14+
}
15+
define void @vnot_no_mask_2() {
16+
ret void
17+
}
18+
...
19+
---
20+
name: vnot_mask_1
21+
body: |
22+
bb.0:
23+
liveins: $v0, $v25
24+
25+
; CHECK-LABEL: vnot_mask_1:
26+
; CHECK: vnot.v v25, v25, v0.t
27+
28+
$v25 = VXOR_VI killed $v25, -1, $v0, implicit $vtype, implicit $vl
29+
...
30+
---
31+
name: vnot_mask_2
32+
body: |
33+
bb.0:
34+
liveins: $v0, $v25
35+
36+
; CHECK-LABEL: vnot_mask_2:
37+
; CHECK: vnot.v v1, v25, v0.t
38+
39+
$v1 = VXOR_VI killed $v25, -1, $v0, implicit $vtype, implicit $vl
40+
...
41+
---
42+
name: vnot_no_mask_1
43+
body: |
44+
bb.0:
45+
liveins: $v25
46+
47+
; CHECK-LABEL: vnot_no_mask_1:
48+
; CHECK: vxor.vi v25, v25, -1
49+
50+
$v25 = VXOR_VI killed $v25, -1, $noreg, implicit $vtype, implicit $vl
51+
...
52+
---
53+
name: vnot_no_mask_2
54+
body: |
55+
bb.0:
56+
liveins: $v25
57+
58+
; CHECK-LABEL: vnot_no_mask_2:
59+
; CHECK: vxor.vi v1, v25, -1
60+
61+
$v1 = VXOR_VI killed $v25, -1, $noreg, implicit $vtype, implicit $vl
62+
...

0 commit comments

Comments
 (0)