Skip to content

Commit 5923864

Browse files
author
Kai Luo
committed
[PowerPC] Precommit test to show codegen while isel is unavailable. NFC.
1 parent d572c4c commit 5923864

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
2+
; RUN: llc -verify-machineinstrs -simplify-mir -mtriple=powerpc64-ibm-aix \
3+
; RUN: -mcpu=pwr7 -stop-after=finalize-isel %s -o - | FileCheck %s
4+
; RUN: llc -verify-machineinstrs -simplify-mir -mtriple=powerpc-ibm-aix \
5+
; RUN: -mcpu=pwr7 -stop-after=finalize-isel %s -o - | FileCheck --check-prefix=CHECK-32 %s
6+
7+
define signext i32 @foo(ptr nocapture noundef %dummy) #0 {
8+
; CHECK-LABEL: name: foo
9+
; CHECK: bb.0.entry:
10+
; CHECK-NEXT: liveins: $x3
11+
; CHECK-NEXT: {{ $}}
12+
; CHECK-NEXT: [[COPY:%[0-9]+]]:g8rc_and_g8rc_nox0 = COPY $x3
13+
; CHECK-NEXT: [[LWZ:%[0-9]+]]:gprc_and_gprc_nor0 = LWZ 0, [[COPY]] :: (load (s32) from %ir.dummy)
14+
; CHECK-NEXT: [[ADDI:%[0-9]+]]:gprc_and_gprc_nor0 = nsw ADDI [[LWZ]], 1
15+
; CHECK-NEXT: [[CMPWI:%[0-9]+]]:crrc = CMPWI [[LWZ]], 750
16+
; CHECK-NEXT: [[LI:%[0-9]+]]:gprc_and_gprc_nor0 = LI 1
17+
; CHECK-NEXT: [[ISEL:%[0-9]+]]:gprc = ISEL [[ADDI]], [[LI]], [[CMPWI]].sub_lt
18+
; CHECK-NEXT: STW killed [[ISEL]], 0, [[COPY]] :: (store (s32) into %ir.dummy)
19+
; CHECK-NEXT: [[LI8_:%[0-9]+]]:g8rc = LI8 0
20+
; CHECK-NEXT: $x3 = COPY [[LI8_]]
21+
; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm, implicit $x3
22+
;
23+
; CHECK-32-LABEL: name: foo
24+
; CHECK-32: bb.0.entry:
25+
; CHECK-32-NEXT: liveins: $r3
26+
; CHECK-32-NEXT: {{ $}}
27+
; CHECK-32-NEXT: [[COPY:%[0-9]+]]:gprc_and_gprc_nor0 = COPY $r3
28+
; CHECK-32-NEXT: [[LWZ:%[0-9]+]]:gprc_and_gprc_nor0 = LWZ 0, [[COPY]] :: (load (s32) from %ir.dummy)
29+
; CHECK-32-NEXT: [[ADDI:%[0-9]+]]:gprc_and_gprc_nor0 = nsw ADDI [[LWZ]], 1
30+
; CHECK-32-NEXT: [[CMPWI:%[0-9]+]]:crrc = CMPWI [[LWZ]], 750
31+
; CHECK-32-NEXT: [[LI:%[0-9]+]]:gprc_and_gprc_nor0 = LI 1
32+
; CHECK-32-NEXT: [[ISEL:%[0-9]+]]:gprc = ISEL [[ADDI]], [[LI]], [[CMPWI]].sub_lt
33+
; CHECK-32-NEXT: STW killed [[ISEL]], 0, [[COPY]] :: (store (s32) into %ir.dummy)
34+
; CHECK-32-NEXT: [[LI1:%[0-9]+]]:gprc = LI 0
35+
; CHECK-32-NEXT: $r3 = COPY [[LI1]]
36+
; CHECK-32-NEXT: BLR implicit $lr, implicit $rm, implicit $r3
37+
entry:
38+
%0 = load i32, ptr %dummy, align 4
39+
%cmp = icmp slt i32 %0, 750
40+
%inc = add nsw i32 %0, 1
41+
%storemerge = select i1 %cmp, i32 %inc, i32 1
42+
store i32 %storemerge, ptr %dummy, align 4
43+
ret i32 0
44+
}
45+
46+
attributes #0 = { "target-features"="-isel" }

0 commit comments

Comments
 (0)