@@ -366,7 +366,7 @@ class SSAUpdaterImpl {
366366 continue ;
367367
368368 // Look for an existing PHI.
369- FindExistingPHI (Info->BB , BlockList );
369+ FindExistingPHI (Info->BB );
370370 if (Info->AvailableVal )
371371 continue ;
372372
@@ -412,19 +412,19 @@ class SSAUpdaterImpl {
412412
413413 // / FindExistingPHI - Look through the PHI nodes in a block to see if any of
414414 // / them match what is needed.
415- void FindExistingPHI (BlkT *BB, BlockListTy *BlockList ) {
415+ void FindExistingPHI (BlkT *BB) {
416416 SmallVector<BBInfo *, 20 > TaggedBlocks;
417417 for (auto &SomePHI : BB->phis ()) {
418418 if (CheckIfPHIMatches (&SomePHI, TaggedBlocks)) {
419- RecordMatchingPHIs (BlockList );
419+ RecordMatchingPHIs (TaggedBlocks );
420420 break ;
421421 }
422422 }
423423 }
424424
425425 // / CheckIfPHIMatches - Check if a PHI node matches the placement and values
426426 // / in the BBMap.
427- bool CheckIfPHIMatches (PhiT *PHI, SmallVectorImpl<BBInfo *> &TaggedBlocks) {
427+ bool CheckIfPHIMatches (PhiT *PHI, BlockListTy &TaggedBlocks) {
428428 // Match failed: clear all the PHITag values. Only need to clear visited
429429 // blocks.
430430 auto Cleanup = make_scope_exit ([&]() {
@@ -484,15 +484,15 @@ class SSAUpdaterImpl {
484484
485485 // / RecordMatchingPHIs - For each PHI node that matches, record it in both
486486 // / the BBMap and the AvailableVals mapping.
487- void RecordMatchingPHIs (BlockListTy *BlockList ) {
488- for (typename BlockListTy::iterator I = BlockList-> begin (),
489- E = BlockList-> end (); I != E; ++I)
490- if (PhiT * PHI = (*I)-> PHITag ) {
491- BlkT *BB = PHI->getParent ();
492- ValT PHIVal = Traits::GetPHIValue (PHI);
493- (*AvailableVals)[BB] = PHIVal;
494- BBMap[BB]->AvailableVal = PHIVal;
495- }
487+ void RecordMatchingPHIs (BlockListTy &TaggedBlocks ) {
488+ for (BBInfo *Block : TaggedBlocks) {
489+ PhiT *PHI = Block-> PHITag ;
490+ assert ( PHI && " PHITag didn't set? " );
491+ BlkT *BB = PHI->getParent ();
492+ ValT PHIVal = Traits::GetPHIValue (PHI);
493+ (*AvailableVals)[BB] = PHIVal;
494+ BBMap[BB]->AvailableVal = PHIVal;
495+ }
496496 }
497497};
498498
0 commit comments