[PATCH] D58393: [MBP] Factor out function hasViableTopFallthrough and enhancement

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 21 14:23:42 PST 2019


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


================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:2008
+        BlockChain *SuccChain = BlockToChain[Succ];
+        if ((!SuccChain || Succ == *SuccChain->begin()) && SuccProb > TopProb) {
+          TopOK = false;
----------------
davidxl wrote:
> What is the purpose of the check 'Succ == *SuccChain->begin() ?
!SuccChain means Succ has not been layout in any chain.
'Succ == *SuccChain->begin()' means even Succ has been layout in some chain, the whole chain can still be layout after Pred if it is beneficial.
So (!SuccChain || Succ == *SuccChain->begin()) means it is possible to put Succ after Pred.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D58393





More information about the llvm-commits mailing list