new UnreachableInst(Context, BB);
}
-static bool hasPHI(const MachineFunction &MF) {
- for (const MachineBasicBlock &MBB : MF)
- for (const MachineInstr &MI : MBB)
- if (MI.isPHI())
- return true;
- return false;
-}
-
static bool isSSA(const MachineFunction &MF) {
const MachineRegisterInfo &MRI = MF.getRegInfo();
for (unsigned I = 0, E = MRI.getNumVirtRegs(); I != E; ++I) {
void MIRParserImpl::computeFunctionProperties(MachineFunction &MF) {
MachineFunctionProperties &Properties = MF.getProperties();
- if (!hasPHI(MF))
+
+ bool HasPHI = false;
+ bool HasInlineAsm = false;
+ for (const MachineBasicBlock &MBB : MF) {
+ for (const MachineInstr &MI : MBB) {
+ if (MI.isPHI())
+ HasPHI = true;
+ if (MI.isInlineAsm())
+ HasInlineAsm = true;
+ }
+ }
+ if (!HasPHI)
Properties.set(MachineFunctionProperties::Property::NoPHIs);
+ MF.setHasInlineAsm(HasInlineAsm);
if (isSSA(MF))
Properties.set(MachineFunctionProperties::Property::IsSSA);
if (YamlMF.Alignment)
MF.setAlignment(YamlMF.Alignment);
MF.setExposesReturnsTwice(YamlMF.ExposesReturnsTwice);
- MF.setHasInlineAsm(YamlMF.HasInlineAsm);
if (YamlMF.AllVRegsAllocated)
MF.getProperties().set(MachineFunctionProperties::Property::AllVRegsAllocated);
YamlMF.Name = MF.getName();
YamlMF.Alignment = MF.getAlignment();
YamlMF.ExposesReturnsTwice = MF.exposesReturnsTwice();
- YamlMF.HasInlineAsm = MF.hasInlineAsm();
YamlMF.AllVRegsAllocated = MF.getProperties().hasProperty(
MachineFunctionProperties::Property::AllVRegsAllocated);
name: promote-load-from-store
alignment: 2
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: false
liveins:
name: store-pair
alignment: 2
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: false
liveins:
name: test_mov_0
alignment: 2
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: false
frameInfo:
name: f
alignment: 1
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: true
liveins:
name: test_tlsdesc_callseq_length
alignment: 2
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: false
liveins:
name: f
alignment: 1
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: true
liveins:
# CHECK: name: foo
# CHECK-NEXT: alignment:
# CHECK-NEXT: exposesReturnsTwice: false
-# CHECK-NEXT: hasInlineAsm: false
# CHECK: ...
name: foo
body: |
# CHECK: name: bar
# CHECK-NEXT: alignment:
# CHECK-NEXT: exposesReturnsTwice: false
-# CHECK-NEXT: hasInlineAsm: false
# CHECK: ...
name: bar
body: |
# CHECK: name: func
# CHECK-NEXT: alignment: 8
# CHECK-NEXT: exposesReturnsTwice: false
-# CHECK-NEXT: hasInlineAsm: false
# CHECK: ...
name: func
alignment: 8
# CHECK: name: func2
# CHECK-NEXT: alignment: 16
# CHECK-NEXT: exposesReturnsTwice: true
-# CHECK-NEXT: hasInlineAsm: true
# CHECK: ...
name: func2
alignment: 16
exposesReturnsTwice: true
-hasInlineAsm: true
body: |
bb.0:
...
name: test0a
alignment: 2
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
name: test0b
alignment: 2
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
name: test1a
alignment: 2
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
name: test1b
alignment: 2
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
name: test2a
alignment: 2
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
name: test2b
alignment: 2
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
name: test3
alignment: 2
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
name: test4
alignment: 2
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
name: testBB
alignment: 2
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
...
---
name: test
-hasInlineAsm: true
tracksRegLiveness: true
liveins:
- { reg: '%rdi' }
...
---
name: test
-hasInlineAsm: true
tracksRegLiveness: true
liveins:
- { reg: '%edi' }
...
---
name: test
-hasInlineAsm: true
tracksRegLiveness: true
liveins:
- { reg: '%rdi' }
...
---
name: test
-hasInlineAsm: true
tracksRegLiveness: true
liveins:
- { reg: '%rdi' }
...
---
name: test
-hasInlineAsm: true
tracksRegLiveness: true
liveins:
- { reg: '%rdi' }
...
---
name: test2
-hasInlineAsm: true
tracksRegLiveness: true
liveins:
- { reg: '%rdi' }
...
---
name: test
-hasInlineAsm: true
tracksRegLiveness: true
liveins:
- { reg: '%rdi' }
...
---
name: test
-hasInlineAsm: true
tracksRegLiveness: true
liveins:
- { reg: '%rdi' }
name: mm_update_next_owner
alignment: 4
exposesReturnsTwice: false
-hasInlineAsm: true
allVRegsAllocated: true
tracksRegLiveness: true
liveins:
name: test1
alignment: 4
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: true
frameInfo:
name: main
alignment: 2
exposesReturnsTwice: false
-hasInlineAsm: false
tracksRegLiveness: true
registers:
- { id: 0, class: g8rc_and_g8rc_nox0 }
name: fn1
alignment: 2
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
name: add
alignment: 4
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: true
liveins:
name: main
alignment: 4
exposesReturnsTwice: false
-hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: true
liveins: