[PATCH] D70502: Broaden the definition of a "widenable branch"

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 20 12:11:11 PST 2019


reames created this revision.
reames added reviewers: fedor.sergeev, skatkov, apilipenko, ebrevnov.
Herald added subscribers: bollu, hiraditya, mcrosier.
Herald added a project: LLVM.

As a reminder, a "widenable branch" is the pattern "br i1 (and i1 X, WC()), label %taken, label %untaken" where "WC" is the widenable condition intrinsics.  The semantics of such a branch (derived from the semantics of WC) is that a new condition can be added into the condition arbitrarily without violating legality.

Broaden the definition in two ways:

1. Allow swapped operands to the br (and X, WC()) form
2. Allow widenable branch w/trivial condition (i.e. true) which takes form of br i1 WC()

The former is just general robustness.  The later is specifically important as partial unswitching of a widenable range check produces exactly this form above the loop.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70502

Files:
  llvm/lib/Analysis/GuardUtils.cpp
  llvm/lib/Transforms/Scalar/GuardWidening.cpp
  llvm/lib/Transforms/Utils/GuardUtils.cpp
  llvm/test/Transforms/GuardWidening/basic_widenable_condition_guards.ll
  llvm/test/Transforms/LoopPredication/basic_widenable_branch_guards.ll
  llvm/test/Transforms/LoopPredication/predicate-exits.ll
  llvm/test/Transforms/SimplifyCFG/wc-widen-block.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70502.230308.patch
Type: text/x-patch
Size: 25612 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191120/77888d2e/attachment-0001.bin>


More information about the llvm-commits mailing list