There are two different senses in which a block can be "address-taken". There can be a BlockAddress involved, which means we need to map the IR-level value to some specific block of machine code. Or there can be constructs inside a function which involve using the address of a basic block to implement certain kinds of control flow. Mixing these together causes a problem: if target-specific passes are marking random blocks "address-taken", if we have a BlockAddress, we can't actually tell which MachineBasicBlock corresponds to the BlockAddress. So split this into two separate bits: one for BlockAddress, and one for the machine-specific bits. Discovered while trying to sort out related stuff on D102817. Differential Revision: https://reviews.llvm.org/D124697
50 lines
933 B
YAML
50 lines
933 B
YAML
# RUN: llc -run-pass none -o - %s | FileCheck %s
|
|
# This test ensures that the MIR parser parses machine functions correctly.
|
|
|
|
--- |
|
|
|
|
define i32 @foo() {
|
|
entry:
|
|
ret i32 0
|
|
}
|
|
|
|
define i32 @bar() {
|
|
start:
|
|
ret i32 0
|
|
}
|
|
|
|
define i32 @test() {
|
|
start:
|
|
ret i32 0
|
|
}
|
|
|
|
...
|
|
---
|
|
# CHECK-LABEL: name: foo
|
|
# CHECK: body:
|
|
# CHECK-NEXT: bb.0.entry:
|
|
name: foo
|
|
body: |
|
|
bb.0.entry:
|
|
...
|
|
---
|
|
# CHECK-LABEL: name: bar
|
|
# CHECK: body:
|
|
# CHECK-NEXT: bb.0.start (align 4):
|
|
# CHECK: bb.1 (machine-block-address-taken):
|
|
name: bar
|
|
body: |
|
|
bb.0.start (align 4):
|
|
bb.1 (machine-block-address-taken):
|
|
...
|
|
---
|
|
# CHECK-LABEL: name: test
|
|
# CHECK: body:
|
|
# CHECK-NEXT: bb.0.start (machine-block-address-taken, align 4):
|
|
# CHECK: bb.1 (machine-block-address-taken, align 4):
|
|
name: test
|
|
body: |
|
|
bb.0.start (align 4, machine-block-address-taken):
|
|
bb.1 (machine-block-address-taken, align 4):
|
|
...
|