[llvm-commits] [llvm] r163495 - /llvm/trunk/lib/CodeGen/StackColoring.cpp

Chandler Carruth chandlerc at google.com
Mon Sep 10 01:49:23 PDT 2012


On Mon, Sep 10, 2012 at 1:44 AM, Nadav Rotem <nrotem at apple.com> wrote:

> Author: nadav
> Date: Mon Sep 10 03:44:15 2012
> New Revision: 163495
>
> URL: http://llvm.org/viewvc/llvm-project?rev=163495&view=rev
> Log:
> Add an assertion that the frame index is indeed inside the declared
> lifetime region.
>
> Modified:
>     llvm/trunk/lib/CodeGen/StackColoring.cpp
>
> Modified: llvm/trunk/lib/CodeGen/StackColoring.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackColoring.cpp?rev=163495&r1=163494&r2=163495&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/StackColoring.cpp (original)
> +++ llvm/trunk/lib/CodeGen/StackColoring.cpp Mon Sep 10 03:44:15 2012
> @@ -454,6 +454,11 @@
>    for (BB = MF->begin(), BBE = MF->end(); BB != BBE; ++BB)
>      for (I = BB->begin(), IE = BB->end(); I != IE; ++I) {
>
> +      // Skip lifetime markers. We'll remove them soon.
> +      if (I->getOpcode() == TargetOpcode::LIFETIME_START ||
> +          I->getOpcode() == TargetOpcode::LIFETIME_END)
> +        continue;
> +
>        // Update the MachineMemOperand to use the new alloca.
>        for (MachineInstr::mmo_iterator MM = I->memoperands_begin(),
>             E = I->memoperands_end(); MM != E; ++MM) {
> @@ -491,6 +496,17 @@
>          if (!SlotRemap.count(FromSlot))
>            continue;
>
> +        // In a debug build, check that the instruction that we are check
> is
> +        // inside its expected live range.


This sentence doesn't parse for me... too many 'check's?


> If the instruction is not inside
> +        // the calculated range then it means that the alloca usage moved
> +        // outside of the lifetime markers.
> +#ifndef NDEBUG
> +        SlotIndex Index = Indexes->getInstructionIndex(I);
> +        LiveInterval* Interval = Intervals[FromSlot];
> +        assert(Interval->find(Index) != Interval->end() &&
> +               "Found instruction usage outside of live range.");
> +#endif
> +
>          // Fix the machine instructions.
>          int ToSlot = SlotRemap[FromSlot];
>          MO.setIndex(ToSlot);
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120910/6ad0ef8a/attachment.html>


More information about the llvm-commits mailing list