[PATCH] D82438: [SimplifyCFG] Cost required selects

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 30 07:00:57 PDT 2020


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1994
 /// \returns true if the conditional block is removed.
 bool SimplifyCFGOpt::SpeculativelyExecuteBB(BranchInst *BI, BasicBlock *ThenBB,
                                             const TargetTransformInfo &TTI) {
----------------
I do not understand what is going on in this function.
Why are we comparing each separate cost with threshold,
instead of accumulating the costs and comparing that?


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:2016
+  }
+  if (CostOfSelects > PHINodeFoldingThreshold)
+    return false;
----------------
if (CostOfSelects > PHINodeFoldingThreshold * TargetTransformInfo::TCC_Basic)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82438





More information about the llvm-commits mailing list