[PATCH] D53744: [SimpleLoopUnswitch] Unswitch by experimental.guard intrinsics

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 25 22:22:38 PDT 2018


mkazantsev created this revision.
mkazantsev added reviewers: asbirlea, chandlerc, fedor.sergeev.

This patch adds support of `llvm.experimental.guard` intrinsics to non-trivial
simple loop unswitching. These intrinsics represent implicit control flow which
has pretty much the same semantics as usual conditional branches. The
algorithm of dealing with them is following:

- Consider guards as unswitching candidates;
- If a guard is considered the best candidate, turn it into a branch;
- Apply normal unswitching algorithm on this branch.

The patch has no compile time effect on code that does not contain any guards.


https://reviews.llvm.org/D53744

Files:
  lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
  test/Transforms/SimpleLoopUnswitch/guards.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53744.171249.patch
Type: text/x-patch
Size: 15087 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181026/65bb59bf/attachment.bin>


More information about the llvm-commits mailing list