summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIRParser.cpp23
-rw-r--r--llvm/lib/CodeGen/MIRPrinter.cpp1
2 files changed, 13 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
index f61b3c9ad18..31bb1dccb88 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);
diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp
index 795f1caa0b7..1cd4eb9d0ea 100644
--- a/llvm/lib/CodeGen/MIRPrinter.cpp
+++ b/llvm/lib/CodeGen/MIRPrinter.cpp
@@ -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);
OpenPOWER on IntegriCloud