[PATCH] D28962: Add BFI in constanthoisting pass and do the hoisting selectively

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 29 21:32:04 PST 2017


davidxl added inline comments.


================
Comment at: lib/Transforms/Scalar/ConstantHoisting.cpp:230
+    if (Node == Entry) {
+      // If Node is not in BBs, we have done some hoisting.
+      if (InsertPtsFreq >= BFI.getBlockFreq(Node) && !NodeInBBs)
----------------
The exit handling code can probably be simplified a little:

if (Node == Entry) {
     BBs.clear();
     if (InsertPtsFreq >= BFI.getBlockFreq(Node)) {
          BBs.insert(Entry);
           MadeChange = true;
      } else if (MadeChange) {
          BBs.insert(InsertPts.begin(), InsertPts.end());
      }
     break;
  }
          


Repository:
  rL LLVM

https://reviews.llvm.org/D28962





More information about the llvm-commits mailing list