Skip to content

Commit 1fd014c

Browse files
[SPIRV] Avoid repeated hash lookups (NFC) (llvm#129421)
1 parent 4eef3de commit 1fd014c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

llvm/lib/Target/SPIRV/SPIRVStructurizer.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -543,12 +543,8 @@ class SPIRVStructurizer : public FunctionPass {
543543
BasicBlock *RHSTarget =
544544
BI->isConditional() ? BI->getSuccessor(1) : nullptr;
545545

546-
Value *LHS = TargetToValue.count(LHSTarget) != 0
547-
? TargetToValue.at(LHSTarget)
548-
: nullptr;
549-
Value *RHS = TargetToValue.count(RHSTarget) != 0
550-
? TargetToValue.at(RHSTarget)
551-
: nullptr;
546+
Value *LHS = TargetToValue.lookup(LHSTarget);
547+
Value *RHS = TargetToValue.lookup(RHSTarget);
552548

553549
if (LHS == nullptr || RHS == nullptr)
554550
return LHS == nullptr ? RHS : LHS;

0 commit comments

Comments
 (0)