Skip to content

Commit 0bcc37c

Browse files
[SPIRV] Avoid repeated hash lookups (NFC) (#129358)
1 parent 00414c3 commit 0bcc37c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

llvm/lib/Target/SPIRV/SPIRVMergeRegionExitTargets.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,8 @@ class SPIRVMergeRegionExitTargets : public FunctionPass {
8787
BasicBlock *RHSTarget =
8888
BI->isConditional() ? BI->getSuccessor(1) : nullptr;
8989

90-
Value *LHS = TargetToValue.count(LHSTarget) != 0
91-
? TargetToValue.at(LHSTarget)
92-
: nullptr;
93-
Value *RHS = TargetToValue.count(RHSTarget) != 0
94-
? TargetToValue.at(RHSTarget)
95-
: nullptr;
90+
Value *LHS = TargetToValue.lookup(LHSTarget);
91+
Value *RHS = TargetToValue.lookup(RHSTarget);
9692

9793
if (LHS == nullptr || RHS == nullptr)
9894
return LHS == nullptr ? RHS : LHS;

0 commit comments

Comments
 (0)