[llvm] [InstCombine] Abandon BranchProbabilityAnalysis cache result (PR #86470)

Haohai Wen via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 00:31:17 PDT 2024


HaohaiWen wrote:

> > > The change InstCombine does to the CFG is trivial -- can we update the analysis instead?
> > 
> > 
> > I'm afraid that's not easy... We many need to check & update cached BranchProbabilityAnalysis in all callsite of BranchInst.swapSuccessors() or similar operation on SwitchInst, JumpTable...
> 
> Can we use `swapSuccEdgesProbabilities` of BPI to update for inverted branches? There aren't many callsites for `swapSuccessors`

Yes we can, also swapValue for SelectInst. There're may be some places where setSuccessor was used and we may need to update them all....




https://github.com/llvm/llvm-project/pull/86470


More information about the llvm-commits mailing list