[all-commits] [llvm/llvm-project] 0b17c6: [LoopDeletion] Allows deletion of possibly infinit...
Atmn Patel via All-commits
all-commits at lists.llvm.org
Fri Nov 6 19:07:22 PST 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 0b17c6e4479d62bd4ff05c48d6cdf340b198832f
https://github.com/llvm/llvm-project/commit/0b17c6e4479d62bd4ff05c48d6cdf340b198832f
Author: Atmn Patel <a335pate at uwaterloo.ca>
Date: 2020-11-06 (Fri, 06 Nov 2020)
Changed paths:
M clang/test/Misc/loop-opt-setup.c
M llvm/include/llvm/Transforms/Utils/LoopUtils.h
M llvm/lib/Transforms/Scalar/LoopDeletion.cpp
M llvm/lib/Transforms/Utils/LoopUtils.cpp
M llvm/test/Other/loop-deletion-printer.ll
M llvm/test/Other/loop-pm-invalidation.ll
M llvm/test/Transforms/LICM/2003-02-27-PreheaderProblem.ll
M llvm/test/Transforms/LoopDeletion/2017-07-11-incremental-dt.ll
M llvm/test/Transforms/LoopDeletion/basic-remark.ll
M llvm/test/Transforms/LoopDeletion/diundef.ll
M llvm/test/Transforms/LoopDeletion/invalidation.ll
M llvm/test/Transforms/LoopDeletion/multiple-exit-conditions.ll
M llvm/test/Transforms/LoopDeletion/multiple-exits.ll
A llvm/test/Transforms/LoopDeletion/mustprogress.ll
M llvm/test/Transforms/LoopDeletion/no-exit-blocks.ll
M llvm/test/Transforms/LoopDeletion/unreachable-loops.ll
M llvm/test/Transforms/LoopDeletion/use-in-unreachable.ll
M llvm/test/Transforms/SCCP/calltest.ll
M llvm/test/Transforms/SimpleLoopUnswitch/pr37888.ll
Log Message:
-----------
[LoopDeletion] Allows deletion of possibly infinite side-effect free loops
>From C11 and C++11 onwards, a forward-progress requirement has been
introduced for both languages. In the case of C, loops with non-constant
conditionals that do not have any observable side-effects (as defined by
6.8.5p6) can be assumed by the implementation to terminate, and in the
case of C++, this assumption extends to all functions. The clang
frontend will emit the `mustprogress` function attribute for C++
functions (D86233, D85393, D86841) and emit the loop metadata
`llvm.loop.mustprogress` for every loop in C11 or later that has a
non-constant conditional.
This patch modifies LoopDeletion so that only loops with
the `llvm.loop.mustprogress` metadata or loops contained in functions
that are required to make progress (`mustprogress` or `willreturn`) are
checked for observable side-effects. If these loops do not have an
observable side-effect, then we delete them.
Loops without observable side-effects that do not satisfy the above
conditions will not be deleted.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D86844
More information about the All-commits
mailing list