[llvm] cb6e693 - NFC: [GVNHoist] Hoist loop invariant code and rename variables for readability

Aditya Kumar via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 09:43:44 PDT 2020


Author: Aditya Kumar
Date: 2020-08-17T09:43:34-07:00
New Revision: cb6e6936db35c751cb7c3d42b6bc0615ef2379b0

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

LOG: NFC: [GVNHoist] Hoist loop invariant code and rename variables for readability

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D86031

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/GVNHoist.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/GVNHoist.cpp b/llvm/lib/Transforms/Scalar/GVNHoist.cpp
index 74c4a480098a..b41268471df3 100644
--- a/llvm/lib/Transforms/Scalar/GVNHoist.cpp
+++ b/llvm/lib/Transforms/Scalar/GVNHoist.cpp
@@ -792,14 +792,14 @@ class GVNHoist {
       }
       // Insert empty CHI node for this VN. This is used to factor out
       // basic blocks where the ANTIC can potentially change.
-      for (auto IDFB : IDFBlocks) {
+      CHIArg EmptyChi = {VN, nullptr, nullptr};
+      for (auto *IDFBB : IDFBlocks) {
         for (unsigned i = 0; i < V.size(); ++i) {
-          CHIArg C = {VN, nullptr, nullptr};
-           // Ignore spurious PDFs.
-          if (DT->properlyDominates(IDFB, V[i]->getParent())) {
-            OutValue[IDFB].push_back(C);
-            LLVM_DEBUG(dbgs() << "\nInsertion a CHI for BB: " << IDFB->getName()
-                              << ", for Insn: " << *V[i]);
+          // Ignore spurious PDFs.
+          if (DT->properlyDominates(IDFBB, V[i]->getParent())) {
+            OutValue[IDFBB].push_back(EmptyChi);
+            LLVM_DEBUG(dbgs() << "\nInserting a CHI for BB: "
+                              << IDFBB->getName() << ", for Insn: " << *V[i]);
           }
         }
       }


        


More information about the llvm-commits mailing list