Skip to content

Commit acdf7c8

Browse files
author
Kai Luo
committed
[PowerPC] Precommit test to show impact of early-ifcvt on target without isel. NFC.
1 parent 3c037b7 commit acdf7c8

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
2+
# RUN: llc -mtriple=powerpc64-ibm-aix -mcpu=pwr7 -simplify-mir -verify-machineinstrs \
3+
# RUN: -run-pass=early-ifcvt %s -o - | FileCheck %s
4+
5+
--- |
6+
source_filename = "<stdin>"
7+
8+
define signext i32 @foo(ptr nocapture noundef %dummy) #0 {
9+
entry:
10+
%0 = load i32, ptr %dummy, align 4
11+
%cmp = icmp slt i32 %0, 750
12+
%inc = add nsw i32 %0, 1
13+
%storemerge = select i1 %cmp, i32 %inc, i32 1
14+
store i32 %storemerge, ptr %dummy, align 4
15+
ret i32 0
16+
}
17+
18+
attributes #0 = { "target-features"="-isel" }
19+
20+
...
21+
---
22+
name: foo
23+
alignment: 16
24+
tracksRegLiveness: true
25+
registers:
26+
- { id: 0, class: g8rc_and_g8rc_nox0 }
27+
- { id: 1, class: gprc_and_gprc_nor0 }
28+
- { id: 2, class: gprc_and_gprc_nor0 }
29+
- { id: 3, class: crrc }
30+
- { id: 4, class: gprc_and_gprc_nor0 }
31+
- { id: 5, class: gprc }
32+
- { id: 6, class: g8rc }
33+
liveins:
34+
- { reg: '$x3', virtual-reg: '%0' }
35+
frameInfo:
36+
maxAlignment: 1
37+
machineFunctionInfo: {}
38+
body: |
39+
; CHECK-LABEL: name: foo
40+
; CHECK: bb.0.entry:
41+
; CHECK-NEXT: liveins: $x3
42+
; CHECK-NEXT: {{ $}}
43+
; CHECK-NEXT: [[COPY:%[0-9]+]]:g8rc_and_g8rc_nox0 = COPY $x3
44+
; CHECK-NEXT: [[LWZ:%[0-9]+]]:gprc_and_gprc_nor0 = LWZ 0, [[COPY]] :: (load (s32) from %ir.dummy)
45+
; CHECK-NEXT: [[ADDI:%[0-9]+]]:gprc_and_gprc_nor0 = nsw ADDI [[LWZ]], 1
46+
; CHECK-NEXT: [[CMPWI:%[0-9]+]]:crrc = CMPWI [[LWZ]], 750
47+
; CHECK-NEXT: [[LI:%[0-9]+]]:gprc_and_gprc_nor0 = LI 1
48+
; CHECK-NEXT: [[ISEL:%[0-9]+]]:gprc = ISEL [[ADDI]], [[LI]], [[CMPWI]].sub_lt
49+
; CHECK-NEXT: STW killed [[ISEL]], 0, [[COPY]] :: (store (s32) into %ir.dummy)
50+
; CHECK-NEXT: [[LI8_:%[0-9]+]]:g8rc = LI8 0
51+
; CHECK-NEXT: $x3 = COPY [[LI8_]]
52+
; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm, implicit $x3
53+
bb.0.entry:
54+
successors: %bb.1, %bb.2
55+
liveins: $x3
56+
57+
%0:g8rc_and_g8rc_nox0 = COPY $x3
58+
%1:gprc_and_gprc_nor0 = LWZ 0, %0 :: (load (s32) from %ir.dummy)
59+
%2:gprc_and_gprc_nor0 = nsw ADDI %1, 1
60+
%3:crrc = CMPWI %1, 750
61+
%4:gprc_and_gprc_nor0 = LI 1
62+
BCC 12, %3, %bb.2
63+
64+
bb.1.entry:
65+
66+
bb.2.entry:
67+
%5:gprc = PHI %4, %bb.1, %2, %bb.0
68+
STW killed %5, 0, %0 :: (store (s32) into %ir.dummy)
69+
%6:g8rc = LI8 0
70+
$x3 = COPY %6
71+
BLR8 implicit $lr8, implicit $rm, implicit $x3
72+
73+
...

0 commit comments

Comments
 (0)