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
6 source_filename = "<stdin>"
8 define signext i32 @foo(ptr nocapture noundef %dummy) #0 {
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
18 attributes #0 = { "target-features"="-isel" }
24 tracksRegLiveness: true
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 }
34 - { reg: '$x3', virtual-reg: '%0' }
37 machineFunctionInfo: {}
39 ; CHECK-LABEL: name: foo
41 ; CHECK-NEXT: successors: %bb.1, %bb.2
42 ; CHECK-NEXT: liveins: $x3
44 ; CHECK-NEXT: [[COPY:%[0-9]+]]:g8rc_and_g8rc_nox0 = COPY $x3
45 ; CHECK-NEXT: [[LWZ:%[0-9]+]]:gprc_and_gprc_nor0 = LWZ 0, [[COPY]] :: (load (s32) from %ir.dummy)
46 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gprc_and_gprc_nor0 = nsw ADDI [[LWZ]], 1
47 ; CHECK-NEXT: [[CMPWI:%[0-9]+]]:crrc = CMPWI [[LWZ]], 750
48 ; CHECK-NEXT: [[LI:%[0-9]+]]:gprc_and_gprc_nor0 = LI 1
49 ; CHECK-NEXT: BCC 12, [[CMPWI]], %bb.2
51 ; CHECK-NEXT: bb.1.entry:
53 ; CHECK-NEXT: bb.2.entry:
54 ; CHECK-NEXT: [[PHI:%[0-9]+]]:gprc = PHI [[LI]], %bb.1, [[ADDI]], %bb.0
55 ; CHECK-NEXT: STW killed [[PHI]], 0, [[COPY]] :: (store (s32) into %ir.dummy)
56 ; CHECK-NEXT: [[LI8_:%[0-9]+]]:g8rc = LI8 0
57 ; CHECK-NEXT: $x3 = COPY [[LI8_]]
58 ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm, implicit $x3
60 successors: %bb.1, %bb.2
63 %0:g8rc_and_g8rc_nox0 = COPY $x3
64 %1:gprc_and_gprc_nor0 = LWZ 0, %0 :: (load (s32) from %ir.dummy)
65 %2:gprc_and_gprc_nor0 = nsw ADDI %1, 1
66 %3:crrc = CMPWI %1, 750
67 %4:gprc_and_gprc_nor0 = LI 1
73 %5:gprc = PHI %4, %bb.1, %2, %bb.0
74 STW killed %5, 0, %0 :: (store (s32) into %ir.dummy)
77 BLR8 implicit $lr8, implicit $rm, implicit $x3