1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/CodeGen/AArch64/GlobalISel/localizer-in-O0-pipeline.mir
Francis Visoiu Mistrih 30264d4391 [CodeGen] Unify MBB reference format in both MIR and debug output
As part of the unification of the debug format and the MIR format, print
MBB references as '%bb.5'.

The MIR printer prints the IR name of a MBB only for block definitions.

* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)->getNumber\(\)/" << printMBBReference(*\1)/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)\.getNumber\(\)/" << printMBBReference(\1)/g'
* find . \( -name "*.txt" -o -name "*.s" -o -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#([0-9]+)/%bb.\1/g'
* grep -nr 'BB#' and fix

Differential Revision: https://reviews.llvm.org/D40422

llvm-svn: 319665
2017-12-04 17:18:51 +00:00

100 lines
3.2 KiB
YAML

# RUN: llc -O0 -mtriple aarch64-apple-ios %s -global-isel -start-after regbankselect \
# RUN: -stop-before instruction-select -o - | FileCheck --check-prefix=CHECK --check-prefix=OPTNONE %s
# RUN: llc -mtriple aarch64-apple-ios %s -global-isel -start-after regbankselect \
# RUN: -stop-before instruction-select -o - | FileCheck --check-prefix=CHECK --check-prefix=OPT %s
#
# Check that we are only running the localizer at O0 and that it runs
# between the regbankselect pass and the instruction-select.
# Moreover, check that it does what we expect.
--- |
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-apple-ios"
define float @foo(float %arg, i1 %cond) {
br i1 %cond, label %true, label %false
true: ; preds = %0
br label %end
false: ; preds = %0
br label %end
end: ; preds = %false, %true
%val = phi float [ 1.000000e+00, %true ], [ 2.000000e+00, %false ]
%res = fadd float %arg, %val
ret float %res
}
...
---
# CHECK-LABEL: name: foo
name: foo
alignment: 2
legalized: true
regBankSelected: true
tracksRegLiveness: true
registers:
# CHECK: registers:
# CHECK-NEXT: - { id: 0, class: fpr, preferred-register: '' }
# CHECK-NEXT: - { id: 1, class: gpr, preferred-register: '' }
# CHECK-NEXT: - { id: 2, class: fpr, preferred-register: '' }
# CHECK-NEXT: - { id: 3, class: fpr, preferred-register: '' }
# CHECK-NEXT: - { id: 4, class: fpr, preferred-register: '' }
# CHECK-NEXT: - { id: 5, class: fpr, preferred-register: '' }
# CHECK-NEXT: - { id: 6, class: gpr, preferred-register: '' }
# The localizer will create two new values to materialize the constants.
# OPTNONE-NEXT: - { id: 7, class: fpr, preferred-register: '' }
# OPTNONE-NEXT: - { id: 8, class: fpr, preferred-register: '' }
- { id: 0, class: fpr }
- { id: 1, class: gpr }
- { id: 2, class: fpr }
- { id: 3, class: fpr }
- { id: 4, class: fpr }
- { id: 5, class: fpr }
- { id: 6, class: gpr }
# First block remains untouched
# CHECK: body
# CHECK: %4:fpr(s32) = G_FCONSTANT float 1.000000e+00
# CHECK: %5:fpr(s32) = G_FCONSTANT float 2.000000e+00
# Second block will get the constant 1.0 when the localizer is enabled.
# CHECK: bb.1.{{[a-zA-Z0-9]+}}:
# OPT-NOT: G_FCONSTANT
# OPTNONE: [[FONE:%[0-9]+]]:fpr(s32) = G_FCONSTANT float 1.000000e+00
# CHECK: G_BR %bb.3
# Thrid block will get the constant 2.0 when the localizer is enabled.
# CHECK: bb.2.{{[a-zA-Z0-9]+}}:
# OPT-NOT: G_FCONSTANT
# OPTNONE: [[FTWO:%[0-9]+]]:fpr(s32) = G_FCONSTANT float 2.000000e+00
# CHECK: bb.3.end
# OPTNONE: %2:fpr(s32) = PHI [[FONE]](s32), %bb.1, [[FTWO]](s32), %bb.2
# OPT: %2:fpr(s32) = PHI %4(s32), %bb.1, %5(s32), %bb.2
# CHECK-NEXT: G_FADD %0, %2
body: |
bb.0 (%ir-block.0):
liveins: %s0, %w0
%0(s32) = COPY %s0
%6(s32) = COPY %w0
%1(s1) = G_TRUNC %6
%4(s32) = G_FCONSTANT float 1.000000e+00
%5(s32) = G_FCONSTANT float 2.000000e+00
G_BRCOND %1(s1), %bb.1
G_BR %bb.2
bb.1.true:
G_BR %bb.3
bb.2.false:
bb.3.end:
%2(s32) = PHI %4(s32), %bb.1, %5(s32), %bb.2
%3(s32) = G_FADD %0, %2
%s0 = COPY %3(s32)
RET_ReallyLR implicit %s0
...