[PATCH] D78987: [BPI][NFC] Reuse post dominantor tree from analysis manager when available

Evgeniy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 03:11:07 PDT 2020


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


================
Comment at: llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp:1774
   BranchProbabilityInfo BPI;
-  BPI.calculate(F, LI);
+  BPI.calculate(F, LI, &TLI, nullptr);
   InductiveRangeCheckElimination IRCE(SE, &BPI, DT, LI);
----------------
skatkov wrote:
> ebrevnov wrote:
> > skatkov wrote:
> > > why nullptr instead of request Pass manager for analysis if it is created anyway?
> > Even though current implementation of BPI.calculate uses post dominator tree unconditionally we can potentially switch to conditional use. In particular in presence of profile information on branches we give it a priority and don't actually need post dominator tree to compute probabilities. Yes, currently there is one exception from this rule but this is discussable.
> I'm a bit confused.
> 
> In a previous comment you say that you do not introduce nullptr by default because it might give a chance for user to use less precise result.
> 
> Why we should not provide additional information here to get the more precise result?
There is a little difference between TLI and PDT arguments.  If TLI is not provided it won't be built and results can be less accurate. If PDT is not provided it will be created inside BPI any way. That might change in future though and we may decide to create PDT in some cases only. Thus creating it upfront may be overkill.

To summarize the caller has control over number of input data and desired accuracy of results. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78987





More information about the llvm-commits mailing list