[PATCH] D58515: GlobalISel: Make legalizer/regbankselect clear NoPHIs property

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 21 08:53:44 PST 2019


arsenm created this revision.
arsenm added reviewers: aemerson, aditya_nandakumar, paquette, volkan, rtereshin, qcolombet.
Herald added subscribers: Petar.Avramovic, kristof.beyls, rovka, wdng.

If no phi existed in the original MIR and these introduced one, the
verifier would fail.


https://reviews.llvm.org/D58515

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


Index: include/llvm/CodeGen/GlobalISel/RegBankSelect.h
===================================================================
--- include/llvm/CodeGen/GlobalISel/RegBankSelect.h
+++ include/llvm/CodeGen/GlobalISel/RegBankSelect.h
@@ -633,6 +633,11 @@
         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
Index: include/llvm/CodeGen/GlobalISel/Legalizer.h
===================================================================
--- include/llvm/CodeGen/GlobalISel/Legalizer.h
+++ include/llvm/CodeGen/GlobalISel/Legalizer.h
@@ -54,6 +54,11 @@
         MachineFunctionProperties::Property::Legalized);
   }
 
+  MachineFunctionProperties getClearedProperties() const override {
+    return MachineFunctionProperties()
+      .set(MachineFunctionProperties::Property::NoPHIs);
+  }
+
   bool combineExtracts(MachineInstr &MI, MachineRegisterInfo &MRI,
                        const TargetInstrInfo &TII);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58515.187807.patch
Type: text/x-patch
Size: 1281 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190221/e069d11b/attachment.bin>


More information about the llvm-commits mailing list