MIRParser/MIRPrinter: Compute HasInlineAsm instead of printing/parsing it

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279680 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matthias Braun 2016-08-24 22:34:06 +00:00
parent 6928bc96df
commit 249a3152c0
22 changed files with 13 additions and 45 deletions

View File

@ -281,14 +281,6 @@ void MIRParserImpl::createDummyFunction(StringRef Name, Module &M) {
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) {
@ -301,8 +293,20 @@ static bool isSSA(const MachineFunction &MF) {
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);
@ -320,7 +324,6 @@ bool MIRParserImpl::initializeMachineFunction(MachineFunction &MF) {
if (YamlMF.Alignment)
MF.setAlignment(YamlMF.Alignment);
MF.setExposesReturnsTwice(YamlMF.ExposesReturnsTwice);
MF.setHasInlineAsm(YamlMF.HasInlineAsm);
if (YamlMF.AllVRegsAllocated)
MF.getProperties().set(MachineFunctionProperties::Property::AllVRegsAllocated);

View File

@ -174,7 +174,6 @@ void MIRPrinter::print(const MachineFunction &MF) {
YamlMF.Name = MF.getName();
YamlMF.Alignment = MF.getAlignment();
YamlMF.ExposesReturnsTwice = MF.exposesReturnsTwice();
YamlMF.HasInlineAsm = MF.hasInlineAsm();
YamlMF.AllVRegsAllocated = MF.getProperties().hasProperty(
MachineFunctionProperties::Property::AllVRegsAllocated);

View File

@ -28,7 +28,6 @@
name: promote-load-from-store
alignment: 2
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: false
liveins:
@ -84,7 +83,6 @@ body: |
name: store-pair
alignment: 2
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: false
liveins:

View File

@ -15,7 +15,6 @@
name: test_mov_0
alignment: 2
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: false
frameInfo:

View File

@ -79,7 +79,6 @@
name: f
alignment: 1
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: true
liveins:

View File

@ -33,7 +33,6 @@
name: test_tlsdesc_callseq_length
alignment: 2
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: false
liveins:

View File

@ -90,7 +90,6 @@
name: f
alignment: 1
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: true
liveins:

View File

@ -24,7 +24,6 @@
# CHECK: name: foo
# CHECK-NEXT: alignment:
# CHECK-NEXT: exposesReturnsTwice: false
# CHECK-NEXT: hasInlineAsm: false
# CHECK: ...
name: foo
body: |
@ -34,7 +33,6 @@ body: |
# CHECK: name: bar
# CHECK-NEXT: alignment:
# CHECK-NEXT: exposesReturnsTwice: false
# CHECK-NEXT: hasInlineAsm: false
# CHECK: ...
name: bar
body: |
@ -44,7 +42,6 @@ body: |
# CHECK: name: func
# CHECK-NEXT: alignment: 8
# CHECK-NEXT: exposesReturnsTwice: false
# CHECK-NEXT: hasInlineAsm: false
# CHECK: ...
name: func
alignment: 8
@ -55,12 +52,10 @@ body: |
# 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:
...

View File

@ -175,7 +175,6 @@
name: test0a
alignment: 2
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
@ -221,7 +220,6 @@ body: |
name: test0b
alignment: 2
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
@ -265,7 +263,6 @@ body: |
name: test1a
alignment: 2
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
@ -313,7 +310,6 @@ body: |
name: test1b
alignment: 2
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
@ -361,7 +357,6 @@ body: |
name: test2a
alignment: 2
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
@ -409,7 +404,6 @@ body: |
name: test2b
alignment: 2
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
@ -457,7 +451,6 @@ body: |
name: test3
alignment: 2
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
@ -505,7 +498,6 @@ body: |
name: test4
alignment: 2
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:
@ -617,7 +609,6 @@ body: |
name: testBB
alignment: 2
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:

View File

@ -10,7 +10,6 @@
...
---
name: test
hasInlineAsm: true
tracksRegLiveness: true
liveins:
- { reg: '%rdi' }

View File

@ -19,7 +19,6 @@
...
---
name: test
hasInlineAsm: true
tracksRegLiveness: true
liveins:
- { reg: '%edi' }

View File

@ -10,7 +10,6 @@
...
---
name: test
hasInlineAsm: true
tracksRegLiveness: true
liveins:
- { reg: '%rdi' }

View File

@ -10,7 +10,6 @@
...
---
name: test
hasInlineAsm: true
tracksRegLiveness: true
liveins:
- { reg: '%rdi' }

View File

@ -19,7 +19,6 @@
...
---
name: test
hasInlineAsm: true
tracksRegLiveness: true
liveins:
- { reg: '%rdi' }
@ -36,7 +35,6 @@ body: |
...
---
name: test2
hasInlineAsm: true
tracksRegLiveness: true
liveins:
- { reg: '%rdi' }

View File

@ -10,7 +10,6 @@
...
---
name: test
hasInlineAsm: true
tracksRegLiveness: true
liveins:
- { reg: '%rdi' }

View File

@ -10,7 +10,6 @@
...
---
name: test
hasInlineAsm: true
tracksRegLiveness: true
liveins:
- { reg: '%rdi' }

View File

@ -44,7 +44,6 @@
name: mm_update_next_owner
alignment: 4
exposesReturnsTwice: false
hasInlineAsm: true
allVRegsAllocated: true
tracksRegLiveness: true
liveins:

View File

@ -26,7 +26,6 @@
name: test1
alignment: 4
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: true
frameInfo:

View File

@ -39,7 +39,6 @@
name: main
alignment: 2
exposesReturnsTwice: false
hasInlineAsm: false
tracksRegLiveness: true
registers:
- { id: 0, class: g8rc_and_g8rc_nox0 }

View File

@ -32,7 +32,6 @@
name: fn1
alignment: 2
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: false
tracksRegLiveness: true
registers:

View File

@ -157,7 +157,6 @@
name: add
alignment: 4
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: true
liveins:

View File

@ -159,7 +159,6 @@
name: main
alignment: 4
exposesReturnsTwice: false
hasInlineAsm: false
allVRegsAllocated: true
tracksRegLiveness: true
liveins: