[llvm-branch-commits] [clang] [llvm] [GVN] Simple GVN-based hoisting of scalars (PR #210337)
Momchil Velikov via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Sep 3 08:57:18 PDT 2026
================
@@ -322,6 +322,24 @@ class GVNPass : public OptionalPassInfoMixin<GVNPass> {
// List of critical edges to be split between iterations.
SmallVector<std::pair<Instruction *, unsigned>, 4> ToSplit;
+ // A pair of instructions with the same value number to be hoisted and merged,
+ // together with their respective hoist barriers. A pair of insructions can be
+ // hoisted iff both their barriers (if not null) are hoisted as well. The
+ // `WeakVH` is used to track when the barrier instruction itself is hoisted.
+ struct HoistPair {
+ Instruction *ThenI = nullptr;
+ Instruction *ThenB = nullptr;
+ Instruction *ElseI = nullptr;
+ WeakVH ElseB = nullptr;
----------------
momchil-velikov wrote:
Done
https://github.com/llvm/llvm-project/pull/210337
More information about the llvm-branch-commits
mailing list