[PATCH] D78299: [OpenMPOpt] deduplicateRuntimeCalls(): avoid traditional map lookup pitfall
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 16 10:02:25 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb1fbf438f647: [OpenMPOpt] deduplicateRuntimeCalls(): avoid traditional map lookup pitfall (authored by lebedev.ri).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78299/new/
https://reviews.llvm.org/D78299
Files:
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
Index: llvm/lib/Transforms/IPO/OpenMPOpt.cpp
===================================================================
--- llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -248,7 +248,11 @@
/// \p ReplVal if given.
bool deduplicateRuntimeCalls(Function &F, RuntimeFunctionInfo &RFI,
Value *ReplVal = nullptr) {
- auto &Uses = RFI.UsesMap[&F];
+ auto UsesIt = RFI.UsesMap.find(&F);
+ if (UsesIt == RFI.UsesMap.end())
+ return false;
+
+ auto &Uses = UsesIt->getSecond();
if (Uses.size() + (ReplVal != nullptr) < 2)
return false;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78299.258081.patch
Type: text/x-patch
Size: 625 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200416/1b2490fb/attachment.bin>
More information about the llvm-commits
mailing list