[llvm] 99a4100 - [riscv] Add early return to InsertVSETLI fixed point step [nfc]

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 13:08:18 PDT 2022


Author: Philip Reames
Date: 2022-05-06T13:08:11-07:00
New Revision: 99a41005fe780570b06e88facf464e1e3c0e5a6d

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

LOG: [riscv] Add early return to InsertVSETLI fixed point step [nfc]

If the income state hasn't changed, and the step function is fixed by assumption, then the output state can't have changed.

In the current algorithm, this is a very minor win and mostly allows adding tracing output without being horrible verbose.

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
index 3224a342949e..09dc2d7e16a4 100644
--- a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
+++ b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
@@ -1005,7 +1005,13 @@ void RISCVInsertVSETVLI::computeIncomingVLVTYPE(const MachineBasicBlock &MBB) {
   if (!InInfo.isValid())
     return;
 
+  // If no change, no need to rerun block
+  if (InInfo == BBInfo.Pred)
+    return;
+
   BBInfo.Pred = InInfo;
+  LLVM_DEBUG(dbgs() << "Entry state of " << printMBBReference(MBB)
+                    << " changed to " << BBInfo.Pred << "\n");
 
   VSETVLIInfo TmpStatus = BBInfo.Pred.merge(BBInfo.Change);
 


        


More information about the llvm-commits mailing list