[llvm] b1b9806 - [ImplicitNullChecks] NFC: Remove unused PointerReg arg in dep analysis

Anna Thomas via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 12:32:04 PDT 2020


Author: Anna Thomas
Date: 2020-09-10T15:31:57-04:00
New Revision: b1b9806370196234a62304d308a9f8873759ec28

URL: https://github.com/llvm/llvm-project/commit/b1b9806370196234a62304d308a9f8873759ec28
DIFF: https://github.com/llvm/llvm-project/commit/b1b9806370196234a62304d308a9f8873759ec28.diff

LOG: [ImplicitNullChecks] NFC: Remove unused PointerReg arg in dep analysis

The PointerReg arg was passed into the dependence function for an
assertion which no longer exists. So, this patch updates the dependence
functions to avoid the PointerReg in the signature.

Tests-Run: make check

Added: 
    

Modified: 
    llvm/lib/CodeGen/ImplicitNullChecks.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/ImplicitNullChecks.cpp b/llvm/lib/CodeGen/ImplicitNullChecks.cpp
index 8e1f9c36c7fe..9030f3226837 100644
--- a/llvm/lib/CodeGen/ImplicitNullChecks.cpp
+++ b/llvm/lib/CodeGen/ImplicitNullChecks.cpp
@@ -204,13 +204,12 @@ class ImplicitNullChecks : public MachineFunctionPass {
   /// if it was hoisted to the NullCheck block. This is used by caller
   /// canHoistInst to decide if DependenceMI can be hoisted safely.
   bool canDependenceHoistingClobberLiveIns(MachineInstr *DependenceMI,
-                                           MachineBasicBlock *NullSucc,
-                                           unsigned PointerReg);
+                                           MachineBasicBlock *NullSucc);
 
   /// Return true if \p FaultingMI can be hoisted from after the
   /// instructions in \p InstsSeenSoFar to before them.  Set \p Dependence to a
   /// non-null value if we also need to (and legally can) hoist a depedency.
-  bool canHoistInst(MachineInstr *FaultingMI, unsigned PointerReg,
+  bool canHoistInst(MachineInstr *FaultingMI,
                     ArrayRef<MachineInstr *> InstsSeenSoFar,
                     MachineBasicBlock *NullSucc, MachineInstr *&Dependence);
 
@@ -409,8 +408,7 @@ ImplicitNullChecks::isSuitableMemoryOp(const MachineInstr &MI,
 }
 
 bool ImplicitNullChecks::canDependenceHoistingClobberLiveIns(
-    MachineInstr *DependenceMI, MachineBasicBlock *NullSucc,
-    unsigned PointerReg) {
+    MachineInstr *DependenceMI, MachineBasicBlock *NullSucc) {
   for (auto &DependenceMO : DependenceMI->operands()) {
     if (!(DependenceMO.isReg() && DependenceMO.getReg()))
       continue;
@@ -442,7 +440,6 @@ bool ImplicitNullChecks::canDependenceHoistingClobberLiveIns(
 }
 
 bool ImplicitNullChecks::canHoistInst(MachineInstr *FaultingMI,
-                                      unsigned PointerReg,
                                       ArrayRef<MachineInstr *> InstsSeenSoFar,
                                       MachineBasicBlock *NullSucc,
                                       MachineInstr *&Dependence) {
@@ -467,7 +464,7 @@ bool ImplicitNullChecks::canHoistInst(MachineInstr *FaultingMI,
   if (DependenceMI->mayLoadOrStore())
     return false;
 
-  if (canDependenceHoistingClobberLiveIns(DependenceMI, NullSucc, PointerReg))
+  if (canDependenceHoistingClobberLiveIns(DependenceMI, NullSucc))
     return false;
 
   auto DepDepResult =
@@ -616,7 +613,7 @@ bool ImplicitNullChecks::analyzeBlockForNullChecks(
     if (SR == SR_Impossible)
       return false;
     if (SR == SR_Suitable &&
-        canHoistInst(&MI, PointerReg, InstsSeenSoFar, NullSucc, Dependence)) {
+        canHoistInst(&MI, InstsSeenSoFar, NullSucc, Dependence)) {
       NullCheckList.emplace_back(&MI, MBP.ConditionDef, &MBB, NotNullSucc,
                                  NullSucc, Dependence);
       return true;


        


More information about the llvm-commits mailing list