@@ -332,15 +332,15 @@ void Partition::markTransferred(Element val,
332332 // Otherwise, we already have this value in the map. Try to insert it.
333333 auto iter1 = elementToRegionMap.find (val);
334334 assert (iter1 != elementToRegionMap.end ());
335- auto iter2 = regionToTransferredOpMap. try_emplace (iter1-> second ,
336- transferredOperandSet);
335+ auto iter2 =
336+ regionToTransferredOpMap. insert ({iter1-> second , transferredOperandSet} );
337337
338338 // If we did insert, just return. We were not tracking any state.
339339 if (iter2.second )
340340 return ;
341341
342342 // 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);
344344}
345345
346346bool Partition::undoTransfer (Element val) {
@@ -525,11 +525,11 @@ Partition Partition::join(const Partition &fst, Partition &mutableSnd) {
525525 // mergedRegion is transferred in result.
526526 auto sndIter = snd.regionToTransferredOpMap .find (sndRegionNumber);
527527 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 } );
530530 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 );
533533 }
534534 }
535535 continue ;
@@ -574,11 +574,10 @@ Partition Partition::join(const Partition &fst, Partition &mutableSnd) {
574574 result.pushNewElementRegion (sndEltNumber);
575575 auto sndIter = snd.regionToTransferredOpMap .find (sndRegionNumber);
576576 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 } );
579579 if (!fstIter.second )
580- fstIter.first ->getSecond () =
581- fstIter.first ->second ->merge (sndIter->second );
580+ fstIter.first ->second = fstIter.first ->second ->merge (sndIter->second );
582581 }
583582 if (result.fresh_label <= sndRegionNumber)
584583 result.fresh_label = Region (sndEltNumber + 1 );
@@ -629,7 +628,7 @@ void Partition::print(llvm::raw_ostream &os) const {
629628 bool isTransferred = iter != regionToTransferredOpMap.end ();
630629 bool isClosureCaptured = false ;
631630 if (isTransferred) {
632- isClosureCaptured = llvm::any_of (iter->getSecond () ->range (),
631+ isClosureCaptured = llvm::any_of (iter->second ->range (),
633632 [](const TransferringOperand *operand) {
634633 return operand->isClosureCaptured ();
635634 });
@@ -671,7 +670,7 @@ void Partition::printVerbose(llvm::raw_ostream &os) const {
671670 bool isTransferred = iter != regionToTransferredOpMap.end ();
672671 bool isClosureCaptured = false ;
673672 if (isTransferred) {
674- isClosureCaptured = llvm::any_of (iter->getSecond () ->range (),
673+ isClosureCaptured = llvm::any_of (iter->second ->range (),
675674 [](const TransferringOperand *operand) {
676675 return operand->isClosureCaptured ();
677676 });
@@ -700,7 +699,7 @@ void Partition::printVerbose(llvm::raw_ostream &os) const {
700699 os << " \n " ;
701700 os << " TransferInsts:\n " ;
702701 if (isTransferred) {
703- for (auto op : iter->getSecond () ->data ()) {
702+ for (auto op : iter->second ->data ()) {
704703 os << " " ;
705704 op->print (os);
706705 }
@@ -821,7 +820,7 @@ Region Partition::merge(Element fst, Element snd, bool updateHistory) {
821820 if (iter != regionToTransferredOpMap.end ()) {
822821 auto operand = iter->second ;
823822 regionToTransferredOpMap.erase (iter);
824- regionToTransferredOpMap.try_emplace ( fstRegion, operand);
823+ regionToTransferredOpMap.insert ({ fstRegion, operand} );
825824 }
826825
827826 assert (is_canonical_correct ());
0 commit comments