[llvm-commits] [llvm] r62834 - /llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp

Evan Cheng evan.cheng at apple.com
Thu Jan 22 21:51:20 PST 2009


On Jan 22, 2009, at 7:28 PM, Owen Anderson wrote:

>
> +        bool NonRestore = false;
> +        for (SmallPtrSet<MachineInstr*, 4>::iterator UI =
> +             VNUseCount[CurrVN].begin(), UE =  
> VNUseCount[CurrVN].end();
> +             UI != UI; ++UI) {

Does order of iteration matters here? Is this deterministic?

>
> +          int StoreFrameIndex;
> +          unsigned StoreVReg = TII->isStoreToStackSlot(*UI,  
> StoreFrameIndex);
> +          if (StoreVReg != (*LI)->reg || StoreFrameIndex !=  
> FrameIndex) {
> +            NonRestore = false;
> +            break;
> +          }
> +        }
> +
> +        if (NonRestore) continue;
> +
> +        for (SmallPtrSet<MachineInstr*, 4>::iterator UI =
> +             VNUseCount[CurrVN].begin(), UE =  
> VNUseCount[CurrVN].end();
> +             UI != UI; ++UI) {
> +          LIs->RemoveMachineInstrFromMaps(*UI);
> +          (*UI)->eraseFromParent();
> +        }
> +
> +        LIs->RemoveMachineInstrFromMaps(DefMI);
> +        (*LI)->removeValNo(CurrVN);
> +        DefMI->eraseFromParent();

This code can use a bit of refactoring as well. :-)

Thanks,

Evan
>
> +        NumDeadSpills++;
> +        changed = true;
> +      }
>     }
>   }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list