History log of /llvm-project/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp (Results 26 – 50 of 355)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 7850c94b 16-Jan-2024 David Green <david.green@arm.com>

[NFC] sentinal -> sentinel


# 300ac0aa 12-Dec-2023 Orlando Cazalet-Hyams <orlando.hyams@sony.com>

[RemoveDIs] Fix removeRedundantDdbgInstrs utils for dbg.declares (#74102)

The intrinsic variants of these functions don't do anything to
dbg.declares so the non-instruction variants should ignore t

[RemoveDIs] Fix removeRedundantDdbgInstrs utils for dbg.declares (#74102)

The intrinsic variants of these functions don't do anything to
dbg.declares so the non-instruction variants should ignore them too.

Tested in llvm/test/DebugInfo/duplicate_dbgvalue.ll, which has
`--try-experimental-debuginfo-iterators` added in #73504.

The tests will become "live" once #74090 lands (see for more info).

show more ...


# bd382032 02-Dec-2023 Joshua Cao <cao.joshua@yahoo.com>

[BBUtils][NFC] Delete SplitLandingPadPredecessors with DT (#73406)

Function is marked for deprecation. There is only one consumer which is
converted to use DomTreeUpdater.


# 284da049 30-Nov-2023 Mircea Trofin <mtrofin@google.com>

[coro][pgo] Don't promote pgo counters in the suspend basic block (#71263)

If a suspend happens in the resume part (this can happen in the case of chained coroutines), and that's part of a loop, the

[coro][pgo] Don't promote pgo counters in the suspend basic block (#71263)

If a suspend happens in the resume part (this can happen in the case of chained coroutines), and that's part of a loop, the pre-split CFG has the suspend block as an exit of that loop. PGO Counter Promotion will then try to commit the temporary counter to the global in that "exit" block (it also does that in the other loop exit BBs, which also includes
the "destroy" case). This interferes with symmetric transfer.

We don't need to commit the counter in the suspend case - it's not a loop exit from the perspective of the behavior of the program. The regular loop exit, together with the "destroy" case, completely cover any updates that may need to happen to the global counter.

show more ...


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, 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
# 6d23aaad 07-Jun-2023 Jeremy Morse <jeremy.morse@sony.com>

[DebugInfo][RemoveDIs] Implement redundant elimination for DPValues (#72284)

This pass steps through a block forwards and backwards, identifying those
variable assignment records that are redundant,

[DebugInfo][RemoveDIs] Implement redundant elimination for DPValues (#72284)

This pass steps through a block forwards and backwards, identifying those
variable assignment records that are redundant, and erases them, saving us
a decent wedge of compile-time. This patch re-implements it to use the
replacement for DbgValueInsts, DPValues, in an almost identical way.

Alas the test I've added the try-remove-dis flag to is the only one I've
been able to find that manually runs this pass.

show more ...


# ac242380 25-Oct-2023 Ruiling, Song <ruiling.song@amd.com>

[LowerSwitch] Don't let pass manager handle the dependency (#68662)

Some passes has limitation that only support simple terminators:
branch/unreachable/return. Right now, they ask the pass manager

[LowerSwitch] Don't let pass manager handle the dependency (#68662)

Some passes has limitation that only support simple terminators:
branch/unreachable/return. Right now, they ask the pass manager to add
LowerSwitch pass to eliminate `switch`. Let's manage such kind of pass
dependency by ourselves. Also add the assertion in the related passes.

show more ...


# 1d82c765 11-Sep-2023 Jeremy Morse <jeremy.morse@sony.com>

[NFC][RemoveDIs] Provide an iterator-taking split-block method

As per the stack of patches this is attached to, allow users of
BasicBlock::splitBasicBlock to provide an iterator for a position, inst

[NFC][RemoveDIs] Provide an iterator-taking split-block method

As per the stack of patches this is attached to, allow users of
BasicBlock::splitBasicBlock to provide an iterator for a position, instead
of just an instruction pointer. This is to fit with my proposal for how to
get rid of debug intrinsics [0]. There are other call-sites that would need
to change, but this is sufficient for a stage2clang self host and some
other C++ projects to build identical binaries, in the context of the whole
remove-DIs project.

[0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939

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

show more ...


# 6942c64e 11-Sep-2023 Jeremy Morse <jeremy.morse@sony.com>

[NFC][RemoveDIs] Prefer iterator-insertion over instructions

Continuing the patch series to get rid of debug intrinsics [0], instruction
insertion needs to be done with iterators rather than instruc

[NFC][RemoveDIs] Prefer iterator-insertion over instructions

Continuing the patch series to get rid of debug intrinsics [0], instruction
insertion needs to be done with iterators rather than instruction pointers,
so that we can communicate information in the iterator class. This patch
adds an iterator-taking insertBefore method and converts various call sites
to take iterators. These are all sites where such debug-info needs to be
preserved so that a stage2 clang can be built identically; it's likely that
many more will need to be changed in the future.

At this stage, this is just changing the spelling of a few operations,
which will eventually become signifiant once the debug-info bearing
iterator is used.

[0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939

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

show more ...


# 4427407a 07-Sep-2023 Jeremy Morse <jeremy.morse@sony.com>

[NFC][RemoveDIs] Create a new spelling of the moveBefore method

As outlined in my proposal of how to get rid of debug intrinsics, this
patch adds a moveBefore method that signals the caller /intends

[NFC][RemoveDIs] Create a new spelling of the moveBefore method

As outlined in my proposal of how to get rid of debug intrinsics, this
patch adds a moveBefore method that signals the caller /intends/ the order
of moved instructions is to stay the same. This semantic difference has an
effect on debug-info, as it signals whether debug-info needs to move with
instructions or not.

The patch just replaces a few calls to moveBefore with calls to
moveBeforePreserving -- and the latter just calls the former, so it's all
NFC right now. A future patch will add an implementation of
moveBeforePreserving that takes action to correctly preserve debug-info,
but that's tightly coupled with our non-instruction debug-info
representation that's still being reviewed.

[0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939

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

show more ...


# 4eafc9b6 23-Aug-2023 Nikita Popov <npopov@redhat.com>

[IR] Treat callbr as special terminator (PR64215)

isLegalToHoistInto() currently return true for callbr instructions.
That means that a callbr with one successor will be considered a
proper loop pre

[IR] Treat callbr as special terminator (PR64215)

isLegalToHoistInto() currently return true for callbr instructions.
That means that a callbr with one successor will be considered a
proper loop preheader, which may result in instructions that use
the callbr return value being hoisted past it.

Fix this by adding callbr to isExceptionTerminator (with a rename
to isSpecialTerminator), which also fixes similar assumptions in
other places.

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

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

show more ...


# 51dfe3cb 16-Aug-2023 Nikita Popov <npopov@redhat.com>

[IR] Add PHINode::removeIncomingValueIf() (NFC)

Add an API that allows removing multiple incoming phi values based
on a predicate callback, as suggested on D157621.

This makes sure that the removal

[IR] Add PHINode::removeIncomingValueIf() (NFC)

Add an API that allows removing multiple incoming phi values based
on a predicate callback, as suggested on D157621.

This makes sure that the removal is linear time rather than quadratic,
and avoids subtleties around iterator invalidation.

I have replaced some of the more straightforward users with the new
API, though there's a couple more places that should be able to use it.

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

show more ...


# 4c95f79c 19-Jul-2023 Momchil Velikov <momchil.velikov@arm.com>

[CodeGenPrepare] Refactor optimizeSelectInst (NFC)

Refactor to use BasicBlockUtils functions and make life easier for
a subsequent patch for updating the dominator tree.

Reviewed By: dmgreen

Diffe

[CodeGenPrepare] Refactor optimizeSelectInst (NFC)

Refactor to use BasicBlockUtils functions and make life easier for
a subsequent patch for updating the dominator tree.

Reviewed By: dmgreen

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

show more ...


# ab9f2beb 19-Jul-2023 Momchil Velikov <momchil.velikov@arm.com>

Refactor some BasicBlockUtils functions (NFC)

Add a more "flexible" `SplitBlockAndInsertIfThenElse` function
and re-implement some others on top of it.

Reviewed By: dmgreen

Differential Revision:

Refactor some BasicBlockUtils functions (NFC)

Add a more "flexible" `SplitBlockAndInsertIfThenElse` function
and re-implement some others on top of it.

Reviewed By: dmgreen

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

show more ...


# d46d9689 08-Jun-2023 Dmitry Makogon <d.makogon@g.nsu.ru>

[BBUtils] Don't add 'then' block to a loop if it's terminated with unreachable

SplitBlockAndInsertIfThen utility creates two new blocks,
they're called ThenBlock and Tail (true and false destination

[BBUtils] Don't add 'then' block to a loop if it's terminated with unreachable

SplitBlockAndInsertIfThen utility creates two new blocks,
they're called ThenBlock and Tail (true and false destinations of a conditional
branch correspondingly). The function has a bool parameter Unreachable,
and if it's set, then ThenBlock is terminated with an unreachable.
At the end of the function the new blocks are added to the loop of the split
block. However, in case ThenBlock is terminated with an unreachable,
it cannot belong to any loop.

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

show more ...


Revision tags: llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3
# 0c316f00 28-Apr-2023 Joshua Cao <cao.joshua@yahoo.com>

[BBUtils][NFC] Delete SplitBlockAndInsertIfThen with DT.

The method is marked for deprecation. Delete the method and move all of
its consumers to use the DomTreeUpdater version.

Reviewed By: foad

[BBUtils][NFC] Delete SplitBlockAndInsertIfThen with DT.

The method is marked for deprecation. Delete the method and move all of
its consumers to use the DomTreeUpdater version.

Reviewed By: foad

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

show more ...


# 42601e11 07-May-2023 Yeting Kuo <yeting.kuo@sifive.com>

[ASAN] Support memory checks on vp.load/store.

The patch adds new member MaybeEVL into InterestingMemoryOperand to represent
the effective vector length for vp intrinsics. It may be extended for som

[ASAN] Support memory checks on vp.load/store.

The patch adds new member MaybeEVL into InterestingMemoryOperand to represent
the effective vector length for vp intrinsics. It may be extended for some target intrinsics in the future.

Reviewed By: kito-cheng

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

show more ...


# 1ce2015f 28-Apr-2023 AdityaK <1894981+hiraditya@users.noreply.github.com>

[NFC] check for UnreachableInst first as it is cheaper compared to getTerminatingDeoptimizeCall

Reviewers: craig.topper, aeubanks, Peter
Differential Revision: https://reviews.llvm.org/D134490


# 9d7785b2 21-Apr-2023 Max Kazantsev <mkazantsev@azul.com>

[BasicBlockUtils][NFCI] Extract branch inverting to a separate method

The motivation is to make possible branch inverting code reuse.

Patch by Aleksandr Popov!

Differential Revision: https://revie

[BasicBlockUtils][NFCI] Extract branch inverting to a separate method

The motivation is to make possible branch inverting code reuse.

Patch by Aleksandr Popov!

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

show more ...


Revision tags: llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0
# c361741a 14-Mar-2023 Philip Reames <preames@rivosinc.com>

[BasicBlockUtils] Expose an internal utility in API [nfc]

Shrinking a patch about to be posted for review.


# 9227f286 14-Mar-2023 Philip Reames <preames@rivosinc.com>

Move utility for acting on each lane of ElementCount to common code [nfc]

This was first written for AddressSanitizer, but I'm about to reuse it for MemorySanitizer as well.


Revision tags: llvmorg-16.0.0-rc4
# 0bbe6040 25-Feb-2023 J. Ryan Stinnett <jryans@gmail.com>

[DebugInfo] Remove `dbg.addr` from Transforms

Part of `dbg.addr` removal
Discussed in https://discourse.llvm.org/t/what-is-the-status-of-dbg-addr/62898

Differential Revision: https://reviews.llvm.o

[DebugInfo] Remove `dbg.addr` from Transforms

Part of `dbg.addr` removal
Discussed in https://discourse.llvm.org/t/what-is-the-status-of-dbg-addr/62898

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

show more ...


Revision tags: llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init
# 12dd3a7b 20-Jan-2023 Florian Hahn <flo@fhahn.com>

Recommit "[LoopUnroll] Directly update DT instead of DTU."

This reverts commit c5ea42bcf48c8f3d3e35a6bff620b06d2a499108.

Recommit the patch with a fix for loops where the exiting terminator is
not

Recommit "[LoopUnroll] Directly update DT instead of DTU."

This reverts commit c5ea42bcf48c8f3d3e35a6bff620b06d2a499108.

Recommit the patch with a fix for loops where the exiting terminator is
not a branch instruction. In that case, ExitInfos may be empty. In
addition to checking if there's a single exiting block also check if
there's a single ExitInfo.

A test case has been added in f92b35392ed8e4631.

show more ...


# 4ece5073 20-Jan-2023 OCHyams <orlando.hyams@sony.com>

[Assignment Tracking][NFC] Replace LLVM command line option with a module flag

Remove LLVM flag -experimental-assignment-tracking. Assignment tracking is
still enabled from Clang with the command li

[Assignment Tracking][NFC] Replace LLVM command line option with a module flag

Remove LLVM flag -experimental-assignment-tracking. Assignment tracking is
still enabled from Clang with the command line -Xclang
-fexperimental-assignment-tracking which tells Clang to ask LLVM to run the
pass declare-to-assign. That pass converts conventional debug intrinsics to
assignment tracking metadata. With this patch it now also sets a module flag
debug-info-assignment-tracking with the value `i1 true` (using the flag conflict
rule `Max` since enabling assignment tracking on IR that contains only
conventional debug intrinsics should cause no issues).

Update the docs and tests too.

Reviewed By: CarlosAlbertoEnciso

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

show more ...


# c5ea42bc 20-Jan-2023 Arthur Eubanks <aeubanks@google.com>

Revert "[LoopUnroll] Directly update DT instead of DTU."

This reverts commit d0907ce7ed9f159562ca3f4cfd8d87e89e93febe.

Causes `opt -passes=loop-unroll-full` to crash on

```
define void @foo() {
bb

Revert "[LoopUnroll] Directly update DT instead of DTU."

This reverts commit d0907ce7ed9f159562ca3f4cfd8d87e89e93febe.

Causes `opt -passes=loop-unroll-full` to crash on

```
define void @foo() {
bb:
br label %bb1

bb1: ; preds = %bb1, %bb1, %bb
switch i1 true, label %bb1 [
i1 true, label %bb2
i1 false, label %bb1
]

bb2: ; preds = %bb1
ret void
}
```

show more ...


# d0907ce7 19-Jan-2023 Florian Hahn <flo@fhahn.com>

[LoopUnroll] Directly update DT instead of DTU.

The scope of DT updates are very limited when unrolling loops: the DT
should only need updating for
* new blocks added
* exiting blocks we simplified

[LoopUnroll] Directly update DT instead of DTU.

The scope of DT updates are very limited when unrolling loops: the DT
should only need updating for
* new blocks added
* exiting blocks we simplified branches

This can be done manually without too much extra work.
MergeBlockIntoPredecessor also needs to be updated to support direct
DT updates.

This fixes excessive time spent in DTU for same cases. In an internal
example, time spent in LoopUnroll with this patch goes from ~200s to 2s.

It also is slightly positive for CTMark:
* NewPM-O3: -0.13%
* NewPM-ReleaseThinLTO: -0.11%
* NewPM-ReleaseLTO-g: -0.13%

Notable improvements are mafft (~ -0.50%) and lencod (~ -0.30%), with no
workload regressed.

https://llvm-compile-time-tracker.com/compare.php?from=78a9ee7834331fb4360457cc565fa36f5452f7e0&to=687e08d011b0dc6d3edd223612761e44225c7537&stat=instructions:u

Reviewed By: kuhar

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

show more ...


12345678910>>...15