]> granicus.if.org Git - llvm/commitdiff
GlobalISel: Make legalizer/regbankselect clear NoPHIs property
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 25 Feb 2019 20:00:25 +0000 (20:00 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 25 Feb 2019 20:00:25 +0000 (20:00 +0000)
If no phi existed in the original MIR and these introduced one, the
verifier would fail.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354813 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/GlobalISel/Legalizer.h
include/llvm/CodeGen/GlobalISel/RegBankSelect.h

index 01816509d4d65d3a9d02998e7fc4eddc375af2c0..13cf3f7e694d7f4b42bf4510f027b7119d6ba6bf 100644 (file)
@@ -54,6 +54,11 @@ public:
         MachineFunctionProperties::Property::Legalized);
   }
 
+  MachineFunctionProperties getClearedProperties() const override {
+    return MachineFunctionProperties()
+      .set(MachineFunctionProperties::Property::NoPHIs);
+  }
+
   bool combineExtracts(MachineInstr &MI, MachineRegisterInfo &MRI,
                        const TargetInstrInfo &TII);
 
index c31ca5c537e1c5e783d25a8c8a902accd02b6220..e704ce44779888e36743483d8cde4273d6813a75 100644 (file)
@@ -633,6 +633,11 @@ public:
         MachineFunctionProperties::Property::RegBankSelected);
   }
 
+  MachineFunctionProperties getClearedProperties() const override {
+    return MachineFunctionProperties()
+      .set(MachineFunctionProperties::Property::NoPHIs);
+  }
+
   /// Walk through \p MF and assign a register bank to every virtual register
   /// that are still mapped to nothing.
   /// The target needs to provide a RegisterBankInfo and in particular