[PATCH] D118066: [SimplifyCFG] Don't speculatively execute preductably-taken block

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 24 12:43:40 PST 2022


lebedev.ri created this revision.
lebedev.ri added reviewers: spatel, Carrot, reames, nikic.
lebedev.ri added a project: LLVM.
Herald added subscribers: wenlei, hiraditya.
lebedev.ri requested review of this revision.

Back in D106650 <https://reviews.llvm.org/D106650> / D106717 <https://reviews.llvm.org/D106717> i've added these profile-guided bailouts,
but i've kept the speculation in the case where there is
a single block to speculate, and we predict it to be taken.

But now, i'm having second thoughts.
If we predict it to be taken, isn't flattening it, 
and incurring the cost of a `select`, a pessimization?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118066

Files:
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/test/Transforms/PGOProfile/chr.ll
  llvm/test/Transforms/SimplifyCFG/fold-two-entry-phi-node-with-one-block-profmd.ll
  llvm/test/Transforms/SimplifyCFG/speculatively-execute-block-profmd.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118066.402626.patch
Type: text/x-patch
Size: 10980 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220124/3956ad1d/attachment.bin>


More information about the llvm-commits mailing list