[PATCH] D146792: [LoopPredication] Do not sink conditions to branches. PR61673

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 24 02:56:44 PDT 2023


mkazantsev created this revision.
mkazantsev added reviewers: reames, anna, nikic, fhahn, skatkov.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
mkazantsev requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch fixes the bug that happens when we sink a widenable condition from
outside the loop into the loop, and therefore creating more possible execution
paths than existed before.

This sinking is:

- sometimes illegal, as shown in https://github.com/llvm/llvm-project/issues/61673
- always useless, at least I could not find any reason to do it.

Maybe there was some intent here, but there is no test that would show why it is done
and I could not find such reason myself. So I'm just removing this code.


https://reviews.llvm.org/D146792

Files:
  llvm/lib/Transforms/Scalar/LoopPredication.cpp
  llvm/test/Transforms/LoopPredication/pr61673.ll
  llvm/test/Transforms/LoopPredication/predicate-exits.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146792.508015.patch
Type: text/x-patch
Size: 6276 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230324/f199475f/attachment.bin>


More information about the llvm-commits mailing list