[llvm-commits] [llvm] r57765 - /llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
Chris Lattner
clattner at apple.com
Sat Oct 18 00:00:00 PDT 2008
On Oct 17, 2008, at 10:18 PM, Evan Cheng wrote:
> Author: evancheng
> Date: Sat Oct 18 00:18:55 2008
> New Revision: 57765
>
> URL: http://llvm.org/viewvc/llvm-project?rev=57765&view=rev
> Log:
> When creating intervals, leave min(1, numdefs) holes after each
> instruction.
Just as a sanity check: extra holes won't affect any of the spill
cost heuristics, right?
-Chris
>
>
> Modified:
> llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
>
> Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=57765&r1=57764&r2=57765&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
> +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Sat Oct 18
> 00:18:55 2008
> @@ -130,9 +130,13 @@
> MIIndex += InstrSlots::NUM;
> FunctionSize++;
>
> - // Insert an empty slot after every instruction.
> - MIIndex += InstrSlots::NUM;
> - i2miMap_.push_back(0);
> + // Insert min(1, numdefs) empty slots after every instruction.
> + unsigned Slots = I->getDesc().getNumDefs();
> + if (Slots == 0)
> + Slots = 1;
> + MIIndex += InstrSlots::NUM * Slots;
> + while (Slots--)
> + i2miMap_.push_back(0);
> }
>
> // Set the MBB2IdxMap entry for this MBB.
> @@ -732,8 +736,12 @@
> handleRegisterDef(MBB, MI, MIIndex, MO, i);
> }
> }
> -
> - MIIndex += InstrSlots::NUM;
> +
> + // Skip over the empty slots after each instruction.
> + unsigned Slots = MI->getDesc().getNumDefs();
> + if (Slots == 0)
> + Slots = 1;
> + MIIndex += InstrSlots::NUM * Slots;
>
> // Skip over empty indices.
> while (MIIndex / InstrSlots::NUM < i2miMap_.size() &&
>
>
> _______________________________________________
> 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