History log of /llvm-project/llvm/lib/Analysis/LoopInfo.cpp (Results 1 – 25 of 328)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# 8e702735 24-Jan-2025 Jeremy Morse <jeremy.morse@sony.com>

[NFC][DebugInfo] Use iterator moveBefore at many call-sites (#123583)

As part of the "RemoveDIs" project, BasicBlock::iterator now carries a
debug-info bit that's needed when getFirstNonPHI and sim

[NFC][DebugInfo] Use iterator moveBefore at many call-sites (#123583)

As part of the "RemoveDIs" project, BasicBlock::iterator now carries a
debug-info bit that's needed when getFirstNonPHI and similar feed into
instruction insertion positions. Call-sites where that's necessary were
updated a year ago; but to ensure some type safety however, we'd like to
have all calls to moveBefore use iterators.

This patch adds a (guaranteed dereferenceable) iterator-taking
moveBefore, and changes a bunch of call-sites where it's obviously safe
to change to use it by just calling getIterator() on an instruction
pointer. A follow-up patch will contain less-obviously-safe changes.

We'll eventually deprecate and remove the instruction-pointer
insertBefore, but not before adding concise documentation of what
considerations are needed (very few).

show more ...


# 5b6a26cc 18-Jan-2025 Akshay Deodhar <adeodhar@nvidia.com>

Add option to print entire function instead of just the loops for loo… (#123229)

print-after-all is useful for diffing IR between two passes. When one of
the two is a function pass, and the other i

Add option to print entire function instead of just the loops for loo… (#123229)

print-after-all is useful for diffing IR between two passes. When one of
the two is a function pass, and the other is a loop pass, the diff
becomes useless. Add an option which prints the entire function for loop
passes.

show more ...


Revision tags: llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# 4169338e 28-Jun-2024 Nikita Popov <npopov@redhat.com>

[IR] Don't include Module.h in Analysis.h (NFC) (#97023)

Replace it with a forward declaration instead. Analysis.h is pulled in
by all passes, but not all passes need to access the module.


# 0f111ba7 25-Jun-2024 Ramkumar Ramachandra <ramkumar.ramachandra@codasip.com>

LoopInfo: introduce Loop::getLocStr; unify debug output (#93051)

Introduce a Loop::getLocStr stolen from LoopVectorize's static function
getDebugLocString in order to have uniform debug output head

LoopInfo: introduce Loop::getLocStr; unify debug output (#93051)

Introduce a Loop::getLocStr stolen from LoopVectorize's static function
getDebugLocString in order to have uniform debug output headers across
LoopVectorize, LoopAccessAnalysis, and LoopDistribute. The motivation
for this change is to have UpdateTestChecks recognize the headers and
automatically generate CHECK lines for debug output, with minimal
special-casing.

show more ...


Revision tags: llvmorg-18.1.8
# e0ac087f 06-Jun-2024 Sameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>

[LoopUnroll] Consider convergence control tokens when unrolling (#91715)

- There is no restriction on a loop with controlled convergent
operations when
the relevant tokens are defined and used w

[LoopUnroll] Consider convergence control tokens when unrolling (#91715)

- There is no restriction on a loop with controlled convergent
operations when
the relevant tokens are defined and used within the loop.

- When a token defined outside a loop is used inside (also called a loop
convergence heart), unrolling is allowed only in the absence of
remainder or
runtime checks.

- When a token defined inside a loop is used outside, such a loop is
said to be
"extended". This loop can only be unrolled by also duplicating the
extended part
lying outside the loop. Such unrolling is disabled for now.

- Clean up loop hearts: When unrolling a loop with a heart, duplicating
the
heart will introduce multiple static uses of a convergence control token
in a
cycle that does not contain its definition. This violates the static
rules for
tokens, and needs to be cleaned up into a single occurrence of the
intrinsic.

- Spell out the initializer for UnrollLoopOptions to improve
readability.


Original implementation [D85605] by Nicolai Haehnle
<nicolai.haehnle@amd.com>.

show more ...


Revision tags: llvmorg-18.1.7, llvmorg-18.1.6
# 026a29e8 07-May-2024 Kazu Hirata <kazu@google.com>

[Analysis, CodeGen, DebugInfo] Use StringRef::operator== instead of StringRef::equals (NFC) (#91304)

I'm planning to remove StringRef::equals in favor of
StringRef::operator==.

- StringRef::oper

[Analysis, CodeGen, DebugInfo] Use StringRef::operator== instead of StringRef::equals (NFC) (#91304)

I'm planning to remove StringRef::equals in favor of
StringRef::operator==.

- StringRef::operator==/!= outnumber StringRef::equals by a factor of
53 under llvm/ in terms of their usage.

- The elimination of StringRef::equals brings StringRef closer to
std::string_view, which has operator== but not equals.

- S == "foo" is more readable than S.equals("foo"), especially for
!Long.Expression.equals("str") vs Long.Expression != "str".

show more ...


Revision tags: llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2
# 06da452b 03-Feb-2024 Kazu Hirata <kazu@google.com>

[Analysis] Use range-based for loops (NFC)


Revision tags: llvmorg-18.1.0-rc1
# ac0b6016 27-Jan-2024 Kazu Hirata <kazu@google.com>

[Analysis] Use llvm::succ_empty and llvm::successors (NFC)


Revision tags: llvmorg-19-init
# 7dc0ba94 03-Jan-2024 Björn Pettersson <bjorn.a.pettersson@ericsson.com>

[LoopInfo][NewPM] Print function name in LoopPrinterPass (#76527)

The legacy pass manager printed the function name when printing
loop info (via -analyze option). Like this:

Printing analysis

[LoopInfo][NewPM] Print function name in LoopPrinterPass (#76527)

The legacy pass manager printed the function name when printing
loop info (via -analyze option). Like this:

Printing analysis 'Natural Loop Information' for function 'func':
Loop at depth 1 containing: ...
Loop at depth 2 containing: ...

Make sure we print such a first line including the function name
also when using the new pass manager version of LoopPrinterPass.

The format of the string is changed slightly, so now we say:

Loop info for function 'func':
Loop at depth 1 containing: ...
Loop at depth 2 containing: ...

This was originally requested in
https://discourse.llvm.org/t/need-usage-help-w-new-pass-manager-for-opt-analysis-natural-loop-information/75874/7
and also mentioned in
https://github.com/llvm/llvm-project/issues/76762

show more ...


# 586ecdf2 12-Dec-2023 Kazu Hirata <kazu@google.com>

[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)

This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::

[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)

This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,ends}_with in C++20.

I'm planning to deprecate and eventually remove
StringRef::{starts,ends}with.

show more ...


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2
# 0c77171d 27-Sep-2023 Nikita Popov <npopov@redhat.com>

[LoopIterator] Add const qualifier to LoopInfo (NFC)

Loop iteration utilities do not change LoopInfo.


Revision tags: llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3
# f5425c12 24-Apr-2023 Christian Ulmann <christian.ulmann@nextsilicon.com>

[LoopInfo] Move generic LoopInfo into own files

This commit splits the generic part of `LoopInfo` into separate files.
These new `GenericLoopInfo` files are located in `llvm/Support` to be inline
wi

[LoopInfo] Move generic LoopInfo into own files

This commit splits the generic part of `LoopInfo` into separate files.
These new `GenericLoopInfo` files are located in `llvm/Support` to be inline
with `GenericDomTree`.

Furthermore, this change ensures that MLIR's Bazel build does not have
to link against `LLVMAnalysis` just to use these template headers.

Depends on D148219

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D148235

show more ...


Revision tags: llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7
# d4b6fcb3 14-Dec-2022 Fangrui Song <i@maskray.me>

[Analysis] llvm::Optional => std::optional


# 19aff0f3 03-Dec-2022 Kazu Hirata <kazu@google.com>

[Analysis] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount o

[Analysis] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


Revision tags: llvmorg-15.0.6
# 5d1ae634 19-Nov-2022 Kazu Hirata <kazu@google.com>

[Analysis] Teach getOptionalIntLoopAttribute to return std::optional (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-o

[Analysis] Teach getOptionalIntLoopAttribute to return std::optional (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


Revision tags: llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3
# 16cf666b 14-Oct-2022 Florian Hahn <flo@fhahn.com>

[Loop] Move block and loop dispo invalidation to makeLoopInvariant.

makeLoopInvariant may recursively move its operands to make them
invariant, before moving the passed in instruction. Those recursi

[Loop] Move block and loop dispo invalidation to makeLoopInvariant.

makeLoopInvariant may recursively move its operands to make them
invariant, before moving the passed in instruction. Those recursively
moved instructions are currently missed when invalidating block and loop
dispositions.

To address this, move the invalidation code to Loop::makeLoopInvariant.

Fixes #58314.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D135909

show more ...


Revision tags: working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init
# 534b9246 15-Jul-2022 Nikita Popov <npopov@redhat.com>

[LoopInfo] Allow cloning of callbr

After D129288, callbr is safe to clone without special handling.
This permits optimizations like loop unroll and loop unswitch on
loops containing callbrs.

Fixes

[LoopInfo] Allow cloning of callbr

After D129288, callbr is safe to clone without special handling.
This permits optimizations like loop unroll and loop unswitch on
loops containing callbrs.

Fixes https://github.com/llvm/llvm-project/issues/41834.

Differential Revision: https://reviews.llvm.org/D129993

show more ...


# 51f837a6 19-Jul-2022 Max Kazantsev <mkazantsev@azul.com>

[NFC] Introduce API to detect tokens penetrating LCSSA form

Following discussion in PR56243, we need to somehow detect the situation
when token values penetrate LCSSA form for transforms that requir

[NFC] Introduce API to detect tokens penetrating LCSSA form

Following discussion in PR56243, we need to somehow detect the situation
when token values penetrate LCSSA form for transforms that require that
it is maintained by all values (for example, to sustain use-def dominance
invarians). This patch introduces a parameter to LCSSA checkers to control
their ignorance about tokens.

Differential Revision: https://reviews.llvm.org/D129983
Reviewed By: efriedma

show more ...


Revision tags: llvmorg-14.0.6
# 129b531c 19-Jun-2022 Kazu Hirata <kazu@google.com>

[llvm] Use value_or instead of getValueOr (NFC)


Revision tags: llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1
# 46776f75 05-Apr-2022 Martin Storsjö <martin@martin.st>

Fix warnings about variables that are set but only used in debug mode

Add void casts to mark the variables used, next to the places where
they are used in assert or `LLVM_DEBUG()` expressions.

Diff

Fix warnings about variables that are set but only used in debug mode

Add void casts to mark the variables used, next to the places where
they are used in assert or `LLVM_DEBUG()` expressions.

Differential Revision: https://reviews.llvm.org/D123117

show more ...


Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2
# 71c3a551 28-Feb-2022 serge-sans-paille <sguelton@redhat.com>

Cleanup includes: LLVMAnalysis

Number of lines output by preprocessor:
before: 1065940348
after: 1065307662

Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Diff

Cleanup includes: LLVMAnalysis

Number of lines output by preprocessor:
before: 1065940348
after: 1065307662

Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D120659

show more ...


Revision tags: llvmorg-14.0.0-rc1, llvmorg-15-init
# 0d04c778 28-Jan-2022 William S. Moses <gh@wsmoses.com>

[ScalarEvolution] Mark a loop as finite if in a willreturn function

A limited version of (https://reviews.llvm.org/D118090) that only marks a loop as finite if in a willreturn function.

Reviewed By

[ScalarEvolution] Mark a loop as finite if in a willreturn function

A limited version of (https://reviews.llvm.org/D118090) that only marks a loop as finite if in a willreturn function.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D118429

show more ...


# b752eb88 24-Jan-2022 Kazu Hirata <kazu@google.com>

[Analysis] Use default member initialization (NFC)

Identified with modernize-use-default-member-init.


Revision tags: llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1
# 53dc5258 11-Nov-2021 duanbo.db <duanbo.db@alibaba-inc.com>

[LoopInfo] Fix function getInductionVariable

The way function gets the induction variable is by judging whether
StepInst or IndVar in the phi statement is one of the operands of CMP.
But if the Latc

[LoopInfo] Fix function getInductionVariable

The way function gets the induction variable is by judging whether
StepInst or IndVar in the phi statement is one of the operands of CMP.
But if the LatchCmpOp0/LatchCmpOp1 is a constant, the subsequent
comparison may result in null == null, which is meaningless. This patch
fixes the typo.

Reviewed By: Whitney

Differential Revision: https://reviews.llvm.org/D112980

show more ...


Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3
# 650bbc56 04-Sep-2021 Michael Kruse <llvm-project@meinersbur.de>

[OpenMP][OpenMPIRBuilder] Implement loop unrolling.

Recommit of 707ce34b06190e275572c3c46843036db1bab6d1. Don't introduce a
dependency to the LLVMPasses component, instead register the required
pass

[OpenMP][OpenMPIRBuilder] Implement loop unrolling.

Recommit of 707ce34b06190e275572c3c46843036db1bab6d1. Don't introduce a
dependency to the LLVMPasses component, instead register the required
passes individually.

Add methods for loop unrolling to the OpenMPIRBuilder class and use them in Clang if `-fopenmp-enable-irbuilder` is enabled. The unrolling methods are:

* `unrollLoopFull`
* `unrollLoopPartial`
* `unrollLoopHeuristic`

`unrollLoopPartial` and `unrollLoopHeuristic` can use compiler heuristics to automatically determine the unroll factor. If possible, that is if no CanonicalLoopInfo is required to pass to another method, metadata for LLVM's LoopUnrollPass is added. Otherwise the unroll factor is determined using the same heurstics as user by LoopUnrollPass. Not requiring a CanonicalLoopInfo, especially with `unrollLoopHeuristic` allows greater flexibility.

With full unrolling and partial unrolling with known unroll factor, instead of duplicating instructions by the OpenMPIRBuilder, the full unroll is still delegated to the LoopUnrollPass. In case of partial unrolling the loop is first tiled using the existing `tileLoops` methods, then the inner loop fully unrolled using the same mechanism.

Reviewed By: jdoerfert, kiranchandramohan

Differential Revision: https://reviews.llvm.org/D107764

show more ...


12345678910>>...14