1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/test/CodeGen/MIR/AArch64/print-parse-verify-failedISel-property.mir
Guillaume Chatelet d49cb60862 [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing
Summary:
This catches malformed mir files which specify alignment as log2 instead of pow2.
See https://reviews.llvm.org/D65945 for reference,

This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: MatzeB, qcolombet, dschuff, arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, s.egerton, pzheng, llvm-commits

Tags: #llvm

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

llvm-svn: 371608
2019-09-11 11:16:48 +00:00

71 lines
2.3 KiB
YAML

# RUN: llc -mtriple aarch64-- -run-pass instruction-select -simplify-mir \
# RUN: -verify-machineinstrs %s -o - | FileCheck %s
#
# RUN: llc -mtriple aarch64-- -global-isel=true -global-isel-abort=2 \
# RUN: -start-after=regbankselect -stop-before=finalize-isel \
# RUN: -simplify-mir -verify-machineinstrs %s -o - 2>&1 \
# RUN: | FileCheck %s --check-prefix=FALLBACK
# Test that:
# 1) MIRParser can deserialize FailedISel property.
# 2) Machine Verifier respects FailedISel and doesn't complain needlessly.
# 3) MIRPrinter is able to print FailedISel MIR after InstructionSelect pass.
# 4) MIRPrinter can serialize FailedISel property.
# 5) It's possible to start llc mid-GlobalISel pipeline from a MIR file with
# the FailedISel property set to true and watch it properly fallback to
# FastISel / SelectionDAG ISel.
# 6) Resetting a MachineFunction resets unique MachineBasicBlock IDs as well.
--- |
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64--"
define i32 @test(i32 %a, i32 %b) #0 {
entry:
%add = add i32 %b, %a
ret i32 %add
}
attributes #0 = { nounwind readnone ssp }
...
---
# CHECK-LABEL: name: test
# CHECK: failedISel: true
#
# FALLBACK: warning: Instruction selection used fallback path for test
# FALLBACK-LABEL: name: test
# FALLBACK-NOT: failedISel
name: test
alignment: 4
legalized: true
regBankSelected: true
failedISel: true
tracksRegLiveness: true
body: |
bb.0.entry:
liveins: $w0, $w1
; CHECK: liveins: $w0, $w1
;
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
; CHECK: [[ADD:%[0-9]+]]:gpr(s32) = G_ADD [[COPY1]], [[COPY]]
; CHECK: $w0 = COPY [[ADD]](s32)
; CHECK: RET_ReallyLR implicit $w0
;
; FALLBACK: body: |
; FALLBACK-NEXT: bb.0.entry:
; FALLBACK-NEXT: liveins: $w0, $w1
;
; FALLBACK: [[COPY:%[0-9]+]]:gpr32 = COPY $w1
; FALLBACK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w0
; FALLBACK: [[ADDWrr:%[0-9]+]]:gpr32 = ADDWrr [[COPY]], [[COPY1]]
; FALLBACK: $w0 = COPY [[ADDWrr]]
; FALLBACK: RET_ReallyLR implicit $w0
%0:_(s32) = COPY $w0
%1:_(s32) = COPY $w1
%2:gpr(s32) = G_ADD %1, %0
$w0 = COPY %2(s32)
RET_ReallyLR implicit $w0
...