[PATCH] D98898: [SimplifyCFG] use profile metadata to refine merging branch conditions

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 23 04:55:45 PDT 2021


spatel added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:3009-3012
 bool llvm::FoldBranchToCommonDest(BranchInst *BI, DomTreeUpdater *DTU,
                                   MemorySSAUpdater *MSSAU,
                                   const TargetTransformInfo *TTI,
                                   unsigned BonusInstThreshold) {
----------------
lebedev.ri wrote:
> `FoldBranchToCommonDest()` might be called from outside of SimplifyCFG (it is called from loopsimplify), without passing-in TTI, i guess.
Yep, that was it. I was able to deduce a test for it without going through the stage2 failure.
I'll add a test for `-loop-simplify` and try again.

This does raise a question: is it intentional that a pass is ignoring the metadata? Does that mean we may lose the information despite making a change for SimplifyCFG?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98898



More information about the llvm-commits mailing list