diff options
author | Matthias Braun <matze@braunis.de> | 2016-08-24 22:34:06 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2016-08-24 22:34:06 +0000 |
commit | a319e2cae0298cf710d65dc5c82cc1549b36658e (patch) | |
tree | c797ceef43a23547b8ac09e53f476abe79ee0264 /llvm/lib/CodeGen/MIRParser/MIRParser.cpp | |
parent | 5dce48e0a707dfc0afa775e817c8ec0165404d02 (diff) | |
download | llvm-a319e2cae0298cf710d65dc5c82cc1549b36658e.zip llvm-a319e2cae0298cf710d65dc5c82cc1549b36658e.tar.gz llvm-a319e2cae0298cf710d65dc5c82cc1549b36658e.tar.bz2 |
MIRParser/MIRPrinter: Compute HasInlineAsm instead of printing/parsing it
llvm-svn: 279680
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser/MIRParser.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIRParser.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp index f61b3c9..31bb1dc 100644 --- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp @@ -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); |