@@ -332,15 +332,15 @@ void Partition::markTransferred(Element val,
332
332
// Otherwise, we already have this value in the map. Try to insert it.
333
333
auto iter1 = elementToRegionMap.find (val);
334
334
assert (iter1 != elementToRegionMap.end ());
335
- auto iter2 = regionToTransferredOpMap. try_emplace (iter1-> second ,
336
- transferredOperandSet);
335
+ auto iter2 =
336
+ regionToTransferredOpMap. insert ({iter1-> second , transferredOperandSet} );
337
337
338
338
// If we did insert, just return. We were not tracking any state.
339
339
if (iter2.second )
340
340
return ;
341
341
342
342
// Otherwise, we need to merge the sets.
343
- iter2.first ->getSecond () = iter2.first ->second ->merge (transferredOperandSet);
343
+ iter2.first ->second = iter2.first ->second ->merge (transferredOperandSet);
344
344
}
345
345
346
346
bool Partition::undoTransfer (Element val) {
@@ -525,11 +525,11 @@ Partition Partition::join(const Partition &fst, Partition &mutableSnd) {
525
525
// mergedRegion is transferred in result.
526
526
auto sndIter = snd.regionToTransferredOpMap .find (sndRegionNumber);
527
527
if (sndIter != snd.regionToTransferredOpMap .end ()) {
528
- auto resultIter = result.regionToTransferredOpMap .try_emplace (
529
- resultRegion, sndIter->second );
528
+ auto resultIter = result.regionToTransferredOpMap .insert (
529
+ { resultRegion, sndIter->second } );
530
530
if (!resultIter.second ) {
531
- resultIter.first ->getSecond () =
532
- resultIter.first ->getSecond () ->merge (sndIter->second );
531
+ resultIter.first ->second =
532
+ resultIter.first ->second ->merge (sndIter->second );
533
533
}
534
534
}
535
535
continue ;
@@ -574,11 +574,10 @@ Partition Partition::join(const Partition &fst, Partition &mutableSnd) {
574
574
result.pushNewElementRegion (sndEltNumber);
575
575
auto sndIter = snd.regionToTransferredOpMap .find (sndRegionNumber);
576
576
if (sndIter != snd.regionToTransferredOpMap .end ()) {
577
- auto fstIter = result.regionToTransferredOpMap .try_emplace (
578
- sndRegionNumber, sndIter->second );
577
+ auto fstIter = result.regionToTransferredOpMap .insert (
578
+ { sndRegionNumber, sndIter->second } );
579
579
if (!fstIter.second )
580
- fstIter.first ->getSecond () =
581
- fstIter.first ->second ->merge (sndIter->second );
580
+ fstIter.first ->second = fstIter.first ->second ->merge (sndIter->second );
582
581
}
583
582
if (result.fresh_label <= sndRegionNumber)
584
583
result.fresh_label = Region (sndEltNumber + 1 );
@@ -629,7 +628,7 @@ void Partition::print(llvm::raw_ostream &os) const {
629
628
bool isTransferred = iter != regionToTransferredOpMap.end ();
630
629
bool isClosureCaptured = false ;
631
630
if (isTransferred) {
632
- isClosureCaptured = llvm::any_of (iter->getSecond () ->range (),
631
+ isClosureCaptured = llvm::any_of (iter->second ->range (),
633
632
[](const TransferringOperand *operand) {
634
633
return operand->isClosureCaptured ();
635
634
});
@@ -671,7 +670,7 @@ void Partition::printVerbose(llvm::raw_ostream &os) const {
671
670
bool isTransferred = iter != regionToTransferredOpMap.end ();
672
671
bool isClosureCaptured = false ;
673
672
if (isTransferred) {
674
- isClosureCaptured = llvm::any_of (iter->getSecond () ->range (),
673
+ isClosureCaptured = llvm::any_of (iter->second ->range (),
675
674
[](const TransferringOperand *operand) {
676
675
return operand->isClosureCaptured ();
677
676
});
@@ -700,7 +699,7 @@ void Partition::printVerbose(llvm::raw_ostream &os) const {
700
699
os << " \n " ;
701
700
os << " TransferInsts:\n " ;
702
701
if (isTransferred) {
703
- for (auto op : iter->getSecond () ->data ()) {
702
+ for (auto op : iter->second ->data ()) {
704
703
os << " " ;
705
704
op->print (os);
706
705
}
@@ -821,7 +820,7 @@ Region Partition::merge(Element fst, Element snd, bool updateHistory) {
821
820
if (iter != regionToTransferredOpMap.end ()) {
822
821
auto operand = iter->second ;
823
822
regionToTransferredOpMap.erase (iter);
824
- regionToTransferredOpMap.try_emplace ( fstRegion, operand);
823
+ regionToTransferredOpMap.insert ({ fstRegion, operand} );
825
824
}
826
825
827
826
assert (is_canonical_correct ());
0 commit comments