Skip to content

Commit ad8d549

Browse files
[IPO] Avoid repeated hash lookups (NFC) (#132588)
1 parent fae3493 commit ad8d549

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Transforms/IPO/SampleProfile.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,8 @@ inline void SampleProfileInference<Function>::findUnlikelyJumps(
629629
const Instruction *TI = BB->getTerminator();
630630
// Check if a block ends with InvokeInst and mark non-taken branch unlikely.
631631
// In that case block Succ should be a landing pad
632-
if (Successors[BB].size() == 2 && Successors[BB].back() == Succ) {
632+
const auto &Succs = Successors[BB];
633+
if (Succs.size() == 2 && Succs.back() == Succ) {
633634
if (isa<InvokeInst>(TI)) {
634635
Jump.IsUnlikely = true;
635636
}

0 commit comments

Comments
 (0)