mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-09 05:31:37 +00:00
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:
parent
6928bc96df
commit
249a3152c0
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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:
|
||||
|
@ -15,7 +15,6 @@
|
||||
name: test_mov_0
|
||||
alignment: 2
|
||||
exposesReturnsTwice: false
|
||||
hasInlineAsm: false
|
||||
allVRegsAllocated: true
|
||||
tracksRegLiveness: false
|
||||
frameInfo:
|
||||
|
@ -79,7 +79,6 @@
|
||||
name: f
|
||||
alignment: 1
|
||||
exposesReturnsTwice: false
|
||||
hasInlineAsm: false
|
||||
allVRegsAllocated: true
|
||||
tracksRegLiveness: true
|
||||
liveins:
|
||||
|
@ -33,7 +33,6 @@
|
||||
name: test_tlsdesc_callseq_length
|
||||
alignment: 2
|
||||
exposesReturnsTwice: false
|
||||
hasInlineAsm: false
|
||||
allVRegsAllocated: true
|
||||
tracksRegLiveness: false
|
||||
liveins:
|
||||
|
@ -90,7 +90,6 @@
|
||||
name: f
|
||||
alignment: 1
|
||||
exposesReturnsTwice: false
|
||||
hasInlineAsm: false
|
||||
allVRegsAllocated: true
|
||||
tracksRegLiveness: true
|
||||
liveins:
|
||||
|
@ -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:
|
||||
...
|
||||
|
@ -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:
|
||||
|
@ -10,7 +10,6 @@
|
||||
...
|
||||
---
|
||||
name: test
|
||||
hasInlineAsm: true
|
||||
tracksRegLiveness: true
|
||||
liveins:
|
||||
- { reg: '%rdi' }
|
||||
|
@ -19,7 +19,6 @@
|
||||
...
|
||||
---
|
||||
name: test
|
||||
hasInlineAsm: true
|
||||
tracksRegLiveness: true
|
||||
liveins:
|
||||
- { reg: '%edi' }
|
||||
|
@ -10,7 +10,6 @@
|
||||
...
|
||||
---
|
||||
name: test
|
||||
hasInlineAsm: true
|
||||
tracksRegLiveness: true
|
||||
liveins:
|
||||
- { reg: '%rdi' }
|
||||
|
@ -10,7 +10,6 @@
|
||||
...
|
||||
---
|
||||
name: test
|
||||
hasInlineAsm: true
|
||||
tracksRegLiveness: true
|
||||
liveins:
|
||||
- { reg: '%rdi' }
|
||||
|
@ -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' }
|
||||
|
@ -10,7 +10,6 @@
|
||||
...
|
||||
---
|
||||
name: test
|
||||
hasInlineAsm: true
|
||||
tracksRegLiveness: true
|
||||
liveins:
|
||||
- { reg: '%rdi' }
|
||||
|
@ -10,7 +10,6 @@
|
||||
...
|
||||
---
|
||||
name: test
|
||||
hasInlineAsm: true
|
||||
tracksRegLiveness: true
|
||||
liveins:
|
||||
- { reg: '%rdi' }
|
||||
|
@ -44,7 +44,6 @@
|
||||
name: mm_update_next_owner
|
||||
alignment: 4
|
||||
exposesReturnsTwice: false
|
||||
hasInlineAsm: true
|
||||
allVRegsAllocated: true
|
||||
tracksRegLiveness: true
|
||||
liveins:
|
||||
|
@ -26,7 +26,6 @@
|
||||
name: test1
|
||||
alignment: 4
|
||||
exposesReturnsTwice: false
|
||||
hasInlineAsm: false
|
||||
allVRegsAllocated: true
|
||||
tracksRegLiveness: true
|
||||
frameInfo:
|
||||
|
@ -39,7 +39,6 @@
|
||||
name: main
|
||||
alignment: 2
|
||||
exposesReturnsTwice: false
|
||||
hasInlineAsm: false
|
||||
tracksRegLiveness: true
|
||||
registers:
|
||||
- { id: 0, class: g8rc_and_g8rc_nox0 }
|
||||
|
@ -32,7 +32,6 @@
|
||||
name: fn1
|
||||
alignment: 2
|
||||
exposesReturnsTwice: false
|
||||
hasInlineAsm: false
|
||||
allVRegsAllocated: false
|
||||
tracksRegLiveness: true
|
||||
registers:
|
||||
|
@ -157,7 +157,6 @@
|
||||
name: add
|
||||
alignment: 4
|
||||
exposesReturnsTwice: false
|
||||
hasInlineAsm: false
|
||||
allVRegsAllocated: true
|
||||
tracksRegLiveness: true
|
||||
liveins:
|
||||
|
@ -159,7 +159,6 @@
|
||||
name: main
|
||||
alignment: 4
|
||||
exposesReturnsTwice: false
|
||||
hasInlineAsm: false
|
||||
allVRegsAllocated: true
|
||||
tracksRegLiveness: true
|
||||
liveins:
|
||||
|
Loading…
Reference in New Issue
Block a user