[qt/clang/llvm-project]: Summary of bulk changes made
KDE Git Services - Bulk Change <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git repository change summary for qt/clang/llvm-project
Pushed by mirror-service into branch 'upstream/users/momchil-velikov/gvn-simple-gvn-hoist-scalars'.
Changed from 9d7161d7eb6d82fa4564428d0a0bbccd356d2a2d to d84e725ad5993f14d72fea93653183479576f847
Acknowledgement was received that this change introduces only existing code that has been pushed to another public open source repository.
This change contains the following new commits:
Git commit d84e725ad5993f14d72fea93653183479576f847 by Momchil Velikov on 23/07/2026 at 11:05..
[GVN] Simple GVN-based hoisring of scalars
RFC/discussion: https://lists.llvm.org/pipermail/llvm-dev/2021-September/152665.html
This patch is a update of https://reviews.llvm.org/D110817
This patch implements simple hoisting of instructions from two
single-predecessor blocks to their common predecessor, as a subroutine
in the GVN pass.
The patch pairs two instructions (A and B) with the same value number,
moves A to the predecessor block, replaces all uses of B with A, and
deletes B.
Outline of the algorithm follows:
Scan the then-block to collect hoist candidates ("then-" and "else-"
prefixes are purely naming and have no connection to the condition in
the predecessor block)
Scan the else-block for hoist candidates, that match some already
selected instruction from the then-block.
During both scans, instructions which are not guaranteed to transfer
control to the following instruction act as "hoist barriers" - after we
encounter such an instruction, we select for potential hoisting/merge
only instructions, which are safe to execute speculatively. Also
instructions which read/write memory are not considered for hoisting,
subject for a follow-up patch. The hoist barriers can itself be hoisted,
opening opportunities for other instructions. For each hoist candidate
pair, the immediately preceding hoist barriers from then- and
else-blocks are recorded as prerequisites for hoisting the pair.
Next we try hoist to hoist each candidate pair. We begin by trying to
hoist dependencies of the then-instruction, which would be its
immediately preceding hoist barrier and its operands. Each of these
dependencies must already be in a dominating block or is itself paired
with an instruction from the else-block. If we cannot hoist an
dependency for whatever reason, the we stop trying to hoist the pair.
Now that all the operands of the then-instruction are in a dominating
block, we check the barriers/operands of the else-instruction. They all
must already be in a dominating block, either initially or as a result
of hoisting barriers/operands of the then-instruction. If any dependency
is still in the else-block, we stop trying to hoist the pair.
As a last step, we move the then-instruction to the predecessor block
and delete the else-instruction.
https://invent.kde.org/qt/clang/llvm-project/-/commit/d84e725ad5993f14d72fea93653183479576f847