[PATCH] D28583: CodeGen: Allow small copyable blocks to "break" the CFG.

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 30 19:23:25 PST 2017


davidxl added inline comments.


================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:156
+             "Percent as integer."),
+    cl::init(2),
+    cl::Hidden);
----------------
Is this default value too low? Increase it 5 or 10 perhaps?


================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:625
+  BlockFrequency Gain = A - B;
+  if (Gain.getFrequency() < (uint64_t) 1 << 32) {
+    if (EntryFreq < (uint64_t) 1 << 40) {
----------------
I suppose this logic here is for rounding errors or overflow? Can you explain why the simple scaling with branch prob (in BranchProbablity.cpp) does not work?  

return  Gain > EntryFreq*ThresholdProb; 




https://reviews.llvm.org/D28583





More information about the llvm-commits mailing list