[llvm-branch-commits] [llvm] [GVN] More restructuring of `GVN.h` to reduce its size (NFC) (PR #211541)
Alexis Engelke via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Jul 23 08:52:19 PDT 2026
================
@@ -123,197 +123,25 @@ struct GVNOptions {
///
/// FIXME: We should have a good summary of the GVN algorithm implemented by
/// this particular pass here.
+class GVNPassImpl;
class GVNPass : public OptionalPassInfoMixin<GVNPass> {
-public:
- struct AvailableValue;
- struct AvailableValueInBlock;
- struct ReachingMemVal;
- struct DependencyBlockInfo;
-
- friend class GVNValueTable;
- friend class GVNLegacyPass;
-
-private:
- GVNOptions Options;
- MemoryDependenceResults *MD = nullptr;
- DominatorTree *DT = nullptr;
- const TargetLibraryInfo *TLI = nullptr;
- AssumptionCache *AC = nullptr;
- SetVector<BasicBlock *> DeadBlocks;
- OptimizationRemarkEmitter *ORE = nullptr;
- ImplicitControlFlowTracking *ICF = nullptr;
- LoopInfo *LI = nullptr;
- AAResults *AA = nullptr;
- MemorySSAUpdater *MSSAU = nullptr;
- GVNValueTable VN;
- GVNLeaderMap LeaderTable;
-
- // Map the block to reversed postorder traversal number. It is used to
- // find back edge easily.
- DenseMap<AssertingVH<BasicBlock>, uint32_t> BlockRPONumber;
-
- // This is set 'true' initially and also when new blocks have been added to
- // the function being analyzed. This boolean is used to control the updating
- // of BlockRPONumber prior to accessing the contents of BlockRPONumber.
- bool InvalidBlockRPONumbers = true;
-
- // List of critical edges to be split between iterations.
- SmallVector<std::pair<Instruction *, unsigned>, 4> ToSplit;
+ std::unique_ptr<GVNPassImpl> Impl;
----------------
aengelke wrote:
Other passes do this as well -- is there a significantly measurable performance benefit?
https://github.com/llvm/llvm-project/pull/211541
More information about the llvm-branch-commits
mailing list