Skip to content

Commit 9e9afc2

Browse files
fixup! use successor BBs in hash
1 parent c8eecb6 commit 9e9afc2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/Transforms/Utils/SimplifyCFG.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7449,7 +7449,10 @@ template <> struct DenseMapInfo<const SwitchInst::CaseHandle *> {
74497449
}
74507450
static unsigned getHashValue(const SwitchInst::CaseHandle *Case) {
74517451
BasicBlock *Succ = Case->getCaseSuccessor();
7452-
return hash_combine(Succ->size(), Succ->getTerminator()->getOpcode());
7452+
BranchInst *BI = cast<BranchInst>(Succ->getTerminator());
7453+
7454+
auto It = BI->successors();
7455+
return hash_combine(Succ->size(), hash_combine_range(It.begin(), It.end()));
74537456
}
74547457
static bool isEqual(const SwitchInst::CaseHandle *LHS,
74557458
const SwitchInst::CaseHandle *RHS) {

0 commit comments

Comments
 (0)