[PATCH] D41463: [CodeGen] Add a new pass for PostRA sink

Sebastian Pop via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 13 08:55:52 PDT 2018


sebpop added a subscriber: evandro.
sebpop added inline comments.


================
Comment at: lib/CodeGen/MachineSink.cpp:995
+      continue;
+    for (const auto LI : SI->liveins())
+      if (AliasedRegs.count(LI.PhysReg))
----------------
So at this point we are at a loop depth 4:

  for (BB : MF)
    for (MI: BB)
      for (SI : BB.successors)
        for (LI : SI->liveins)

I think you could do the last two loops above the loop (MI:BB) by asking first whether there is an opportunity to perform the sinking from BB into one of the BB.successors.  The liveins are stored as a bitmap, and you could efficiently compute the difference of liveins in the successors. The registers in the diff are candidates for sinking.

Also please post compile time numbers with this change.



https://reviews.llvm.org/D41463





More information about the llvm-commits mailing list