| 1 |
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py |
| 2 |
# RUN: llc -mtriple=powerpc64le -simplify-mir -verify-machineinstrs \ |
| 3 |
# RUN: -run-pass=peephole-opt %s -o - | FileCheck %s |
| 4 |
# Test to show effect of `optimizeCompareInstr` when `equalityOnly` is true. |
| 5 |
--- |
| 6 |
name: h |
| 7 |
alignment: 16 |
| 8 |
tracksRegLiveness: true |
| 9 |
registers: |
| 10 |
- { id: 0, class: g8rc } |
| 11 |
- { id: 1, class: g8rc } |
| 12 |
- { id: 2, class: g8rc_and_g8rc_nox0 } |
| 13 |
- { id: 3, class: crrc } |
| 14 |
- { id: 4, class: g8rc_and_g8rc_nox0 } |
| 15 |
- { id: 5, class: g8rc } |
| 16 |
liveins: |
| 17 |
- { reg: '$x3', virtual-reg: '%0' } |
| 18 |
- { reg: '$x4', virtual-reg: '%1' } |
| 19 |
frameInfo: |
| 20 |
maxAlignment: 1 |
| 21 |
machineFunctionInfo: {} |
| 22 |
body: | |
| 23 |
bb.0: |
| 24 |
liveins: $x3, $x4 |
| 25 |
|
| 26 |
; CHECK-LABEL: name: h |
| 27 |
; CHECK: liveins: $x3, $x4 |
| 28 |
; CHECK: [[COPY:%[0-9]+]]:g8rc = COPY $x4 |
| 29 |
; CHECK: [[COPY1:%[0-9]+]]:g8rc = COPY $x3 |
| 30 |
; CHECK: [[SUBF8_rec:%[0-9]+]]:g8rc_and_g8rc_nox0 = SUBF8_rec [[COPY]], [[COPY1]], implicit-def $cr0 |
| 31 |
; CHECK: [[COPY2:%[0-9]+]]:crrc = COPY killed $cr0 |
| 32 |
; CHECK: [[ISEL8_:%[0-9]+]]:g8rc = ISEL8 $zero8, [[SUBF8_rec]], [[COPY2]].sub_eq |
| 33 |
; CHECK: $x3 = COPY [[ISEL8_]] |
| 34 |
; CHECK: BLR8 implicit $lr8, implicit $rm, implicit $x3 |
| 35 |
%1:g8rc = COPY $x4 |
| 36 |
%0:g8rc = COPY $x3 |
| 37 |
%2:g8rc_and_g8rc_nox0 = SUBF8 %1, %0 |
| 38 |
%3:crrc = CMPLD %0, %1 |
| 39 |
%4:g8rc_and_g8rc_nox0 = LI8 0 |
| 40 |
%5:g8rc = ISEL8 %4, %2, %3.sub_eq |
| 41 |
$x3 = COPY %5 |
| 42 |
BLR8 implicit $lr8, implicit $rm, implicit $x3 |
| 43 |
|
| 44 |
... |