2019-09-10 02:29:27 +08:00
|
|
|
# RUN: llc %s -o - -run-pass=if-converter -verify-machineinstrs | FileCheck %s
|
2019-09-06 04:02:38 +08:00
|
|
|
# Make sure we correctly if-convert blocks containing an INLINEASM_BR.
|
|
|
|
# CHECK: t2CMPri killed renamable $r2, 34
|
|
|
|
# CHECK-NEXT: $r0 = t2MOVi 2, 1, $cpsr, $noreg
|
|
|
|
# CHECK-NEXT: $r0 = t2MOVi 3, 0, killed $cpsr, $noreg, implicit killed $r0
|
|
|
|
# CHECK-NEXT: tBL 14, $noreg, @fn2
|
|
|
|
# CHECK-NEXT: INLINEASM_BR &"", 9, 13, 0, 13, blockaddress(@fn1, %ir-block.l_yes)
|
|
|
|
# CHECK-NEXT: t2B %bb.1, 14, $noreg
|
|
|
|
--- |
|
|
|
|
target triple = "thumbv7-unknown-linux-gnueabi"
|
|
|
|
|
|
|
|
define dso_local void @fn1() {
|
|
|
|
l_yes:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare dso_local i32 @fn2(...)
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: fn1
|
[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 19:16:48 +08:00
|
|
|
alignment: 2
|
2019-09-06 04:02:38 +08:00
|
|
|
tracksRegLiveness: true
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
successors: %bb.1(0x40000000), %bb.2(0x40000000)
|
|
|
|
liveins: $r0, $r1, $r2, $r4, $lr
|
|
|
|
|
|
|
|
$sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r4, killed $lr
|
|
|
|
t2CMPri killed renamable $r2, 34, 14, $noreg, implicit-def $cpsr
|
|
|
|
t2Bcc %bb.2, 1, killed $cpsr
|
|
|
|
|
|
|
|
bb.1:
|
|
|
|
successors: %bb.3(0x40000000), %bb.4(0x40000000)
|
|
|
|
liveins: $r1
|
|
|
|
|
|
|
|
$r0 = t2MOVi 3, 14, $noreg, $noreg
|
|
|
|
tBL 14, $noreg, @fn2, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit $r1, implicit-def $sp, implicit-def dead $r0
|
|
|
|
INLINEASM_BR &"", 9, 13, 0, 13, blockaddress(@fn1, %ir-block.l_yes)
|
|
|
|
t2B %bb.3, 14, $noreg
|
|
|
|
|
|
|
|
bb.2:
|
|
|
|
successors: %bb.3(0x40000000), %bb.4(0x40000000)
|
|
|
|
liveins: $r1
|
|
|
|
|
|
|
|
$r0 = t2MOVi 2, 14, $noreg, $noreg
|
|
|
|
tBL 14, $noreg, @fn2, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit $r1, implicit-def $sp, implicit-def dead $r0
|
|
|
|
INLINEASM_BR &"", 9, 13, 0, 13, blockaddress(@fn1, %ir-block.l_yes)
|
|
|
|
t2B %bb.3, 14, $noreg
|
|
|
|
|
|
|
|
bb.3:
|
|
|
|
INLINEASM &"", 1
|
2019-09-10 02:29:27 +08:00
|
|
|
$sp = t2LDMIA_RET $sp, 14, $noreg, def $r4, def $pc
|
2019-09-06 04:02:38 +08:00
|
|
|
|
|
|
|
bb.4.l_yes (address-taken):
|
|
|
|
$sp = t2LDMIA_RET $sp, 14, $noreg, def $r4, def $pc
|
|
|
|
|
|
|
|
...
|