[PATCH] D103382: [LoopDeletion] Consider infinite loops alive, unless mustprogress.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 30 08:52:13 PDT 2021


fhahn created this revision.
fhahn added reviewers: nikic, jdoerfert, reames, mkazantsev.
Herald added a subscriber: hiraditya.
fhahn requested review of this revision.
Herald added a project: LLVM.

The current loop or any of its sub-loops may be infinite. Unless the
function or the loops are marked as mustprogress, this in itself makes
the loop *not* dead.

This patch moves the logic to check whether the current loop is finite
or mustprogress to `isLoopDead` and also extends it to check the
sub-loops. This should fix PR50511.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103382

Files:
  llvm/lib/Transforms/Scalar/LoopDeletion.cpp
  llvm/test/Transforms/LoopDeletion/noop-loops-with-subloops.ll
  llvm/test/Transforms/LoopDeletion/unreachable-loops.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103382.348701.patch
Type: text/x-patch
Size: 5201 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210530/80284049/attachment.bin>


More information about the llvm-commits mailing list