diff options
author | Nikita Popov <npopov@redhat.com> | 2025-06-20 09:16:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-20 09:16:39 +0200 |
commit | d196124dd22391f6c967ed569b34632840536c45 (patch) | |
tree | b8997e86d2d6d513d555a460b2c60ac70eed4a2c /llvm/lib/Transforms/Utils/PredicateInfo.cpp | |
parent | 090f409538d2b426f11ce5aa22af8c243099aecf (diff) | |
download | llvm-d196124dd22391f6c967ed569b34632840536c45.zip llvm-d196124dd22391f6c967ed569b34632840536c45.tar.gz llvm-d196124dd22391f6c967ed569b34632840536c45.tar.bz2 |
[PredicateInfo] Remove unnecessary EdgeUsesOnly set (NFC) (#144912)
As far as I can tell, this set is pointless: It just represents whether
the target block has multiple predecessors, and the way it is
constructed and queried, we're not even reducing the number of
getSinglePredecessor() calls or something like that.
Diffstat (limited to 'llvm/lib/Transforms/Utils/PredicateInfo.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/PredicateInfo.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Utils/PredicateInfo.cpp b/llvm/lib/Transforms/Utils/PredicateInfo.cpp index 4c87bab..4a0faab 100644 --- a/llvm/lib/Transforms/Utils/PredicateInfo.cpp +++ b/llvm/lib/Transforms/Utils/PredicateInfo.cpp @@ -253,10 +253,6 @@ class PredicateInfoBuilder { // whether it returned a valid result. DenseMap<Value *, unsigned int> ValueInfoNums; - // The set of edges along which we can only handle phi uses, due to critical - // edges. - DenseSet<std::pair<BasicBlock *, BasicBlock *>> EdgeUsesOnly; - ValueInfo &getOrCreateValueInfo(Value *); const ValueInfo &getValueInfo(Value *) const; @@ -459,8 +455,6 @@ void PredicateInfoBuilder::processBranch( PredicateBase *PB = new PredicateBranch(V, BranchBB, Succ, Cond, TakenEdge); addInfoFor(OpsToRename, V, PB); - if (!Succ->getSinglePredecessor()) - EdgeUsesOnly.insert({BranchBB, Succ}); } } } @@ -487,8 +481,6 @@ void PredicateInfoBuilder::processSwitch( PredicateSwitch *PS = new PredicateSwitch( Op, SI->getParent(), TargetBlock, C.getCaseValue(), SI); addInfoFor(OpsToRename, Op, PS); - if (!TargetBlock->getSinglePredecessor()) - EdgeUsesOnly.insert({BranchBB, TargetBlock}); } } } @@ -637,7 +629,7 @@ void PredicateInfoBuilder::renameUses(SmallVectorImpl<Value *> &OpsToRename) { // block, and handle it specially. We know that it goes last, and only // dominate phi uses. auto BlockEdge = getBlockEdge(PossibleCopy); - if (EdgeUsesOnly.count(BlockEdge)) { + if (!BlockEdge.second->getSinglePredecessor()) { VD.LocalNum = LN_Last; auto *DomNode = DT.getNode(BlockEdge.first); if (DomNode) { |