We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dbb20fc commit 80a4718Copy full SHA for 80a4718
llvm/lib/Transforms/Scalar/GVNHoist.cpp
@@ -564,21 +564,20 @@ unsigned int GVNHoist::rank(const Value *V) const {
564
}
565
566
bool GVNHoist::hasEH(const BasicBlock *BB) {
567
- auto It = BBSideEffects.find(BB);
568
- if (It != BBSideEffects.end())
+ auto [It, Inserted] = BBSideEffects.try_emplace(BB);
+ if (!Inserted)
569
return It->second;
570
571
if (BB->isEHPad() || BB->hasAddressTaken()) {
572
- BBSideEffects[BB] = true;
+ It->second = true;
573
return true;
574
575
576
if (BB->getTerminator()->mayThrow()) {
577
578
579
580
581
- BBSideEffects[BB] = false;
582
return false;
583
584
0 commit comments