[PATCH] D64394: [MachineCSE][MachinePRE] Do not hoist common computations into hot BBs

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 15 18:33:07 PDT 2019


lkail marked an inline comment as done.
lkail added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineCSE.cpp:875
+         "CandidateBB should dominate MBB1");
+  return MBFI->getBlockFreq(CandidateBB) <=
+         MBFI->getBlockFreq(MBB) + MBFI->getBlockFreq(MBB1);
----------------
dmgreen wrote:
> Should this also say something like "if OptForMinSize then return true"? Under the assumption that pre will reduce the codesize.
Hi @dmgreen , your concern makes sense, since CSE won't eliminate all common computations considering what `isProfitableToCSE` does. As a result, it might increase size after PRE. I think we can enhance it in following patches. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64394/new/

https://reviews.llvm.org/D64394





More information about the llvm-commits mailing list