Skip to content

Commit d196124

Browse files
authored
[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.
1 parent 090f409 commit d196124

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

llvm/lib/Transforms/Utils/PredicateInfo.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,6 @@ class PredicateInfoBuilder {
253253
// whether it returned a valid result.
254254
DenseMap<Value *, unsigned int> ValueInfoNums;
255255

256-
// The set of edges along which we can only handle phi uses, due to critical
257-
// edges.
258-
DenseSet<std::pair<BasicBlock *, BasicBlock *>> EdgeUsesOnly;
259-
260256
ValueInfo &getOrCreateValueInfo(Value *);
261257
const ValueInfo &getValueInfo(Value *) const;
262258

@@ -459,8 +455,6 @@ void PredicateInfoBuilder::processBranch(
459455
PredicateBase *PB =
460456
new PredicateBranch(V, BranchBB, Succ, Cond, TakenEdge);
461457
addInfoFor(OpsToRename, V, PB);
462-
if (!Succ->getSinglePredecessor())
463-
EdgeUsesOnly.insert({BranchBB, Succ});
464458
}
465459
}
466460
}
@@ -487,8 +481,6 @@ void PredicateInfoBuilder::processSwitch(
487481
PredicateSwitch *PS = new PredicateSwitch(
488482
Op, SI->getParent(), TargetBlock, C.getCaseValue(), SI);
489483
addInfoFor(OpsToRename, Op, PS);
490-
if (!TargetBlock->getSinglePredecessor())
491-
EdgeUsesOnly.insert({BranchBB, TargetBlock});
492484
}
493485
}
494486
}
@@ -637,7 +629,7 @@ void PredicateInfoBuilder::renameUses(SmallVectorImpl<Value *> &OpsToRename) {
637629
// block, and handle it specially. We know that it goes last, and only
638630
// dominate phi uses.
639631
auto BlockEdge = getBlockEdge(PossibleCopy);
640-
if (EdgeUsesOnly.count(BlockEdge)) {
632+
if (!BlockEdge.second->getSinglePredecessor()) {
641633
VD.LocalNum = LN_Last;
642634
auto *DomNode = DT.getNode(BlockEdge.first);
643635
if (DomNode) {

0 commit comments

Comments
 (0)