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