Displaying 14 results from an estimated 14 matches for "assignvirt2stackslot".
2006 Aug 21
0
[LLVMdev] Recalculating live intervals
...---------
void RegAllocChordal_Fer::spill(
unsigned v_reg,
KillingSites_Fer & ks,
const MachineBasicBlock & mbb
) {
// First, find a place to store this register. Of course, this will be
done
// by the implementation of vrm. We just have to ask it.
int slot = vrm->assignVirt2StackSlot(v_reg);
unsigned p_reg = this->reg_mapping->get_physical_location(v_reg);
// Now, it is necessary to break the live range of the spilled
register.
// This is done by creating new virtual registers, and substituting
the
// spilled register by the new registers.
MachineInst...
2014 Oct 14
2
[LLVMdev] Problem of stack slot coloring
...is in
lib/CodeGen/InlineSpiller.cpp:
>
> /// spillAll - Spill all registers remaining after rematerialization.
> void InlineSpiller::spillAll() {
> // Update LiveStacks now that we are committed to spilling.
> if (StackSlot == VirtRegMap::NO_STACK_SLOT) {
> StackSlot = VRM.assignVirt2StackSlot(Original);
> StackInt = &LSS.getOrCreateInterval(StackSlot,
MRI.getRegClass(Original));
> StackInt->getNextValue(SlotIndex(), LSS.getVNInfoAllocator());
> } else
> StackInt = &LSS.getInterval(StackSlot);
>
> if (Original != Edit->getReg())
> VR...
2006 Aug 21
2
[LLVMdev] Recalculating live intervals
So what addIntervalsToSpills returns are new intervals to allocate with
infinite weights, right?
And I need not to allocate the old interval. Should hasStackSlot return true
on its register then?
On 8/21/06, Fernando Magno Quintao Pereira <fernando at cs.ucla.edu> wrote:
>
>
> Well, someone correct me if am wrong, but, you still have to allocate
> physical registers to them,
2014 Oct 13
2
[LLVMdev] Problem of stack slot coloring
Hi,
Can anyone help me with the stack slot coloring optimization?
This corresponding file is /lib/codegen/stackslotcoloring.cpp.
It is said this optimization was for stack slot overlay for frame size
reduction, after register allocation phase.
And this transformation pass relies on the LiveStack analysis pass.
How, when checking the source code, it seems the LiveStack analysis has not
been
2007 Aug 06
5
[LLVMdev] Spillers
...tially bad.
For example, the prototype graph coloring allocator posted by Bill W. some
time ago has this code in it (the **** comments are my own):
/// SpillLiveInterval - Assign a live interval to a stack slot.
///
void RegAlloc::SpillLiveInterval(LiveInterval* LI) {
[...]
int Slot = VRM->assignVirt2StackSlot(LI->reg);
DEBUG(std::cerr << "Spilling " << *LI << " into slot " << Slot << "\n");
std::vector<LiveInterval*> Added =
LIs->addIntervalsForSpills(*LI, *VRM, Slot);
static unsigned J = 0;
for (unsigned I = 0; I <...
2009 Oct 29
1
[LLVMdev] request for help writing a register allocator
I'm having no luck getting my register allocator to work. I'm trying to
do it using the "indirect" approach; i.e., using a VirtRegMap, with calls
to assignVirt2Phys, assignVirt2StackSlot, etc. and a call to a "spiller"
at the end.
As a warm-up exercise (before implementing register allocation via graph
coloring) I'm trying to implement a very simple scheme in which NO
pseudo-registers are allocated to physical registers across instructions.
So for each virtual re...
2007 Aug 07
0
[LLVMdev] Spillers
...graph coloring allocator posted by Bill
> W. some
> time ago has this code in it (the **** comments are my own):
>
> /// SpillLiveInterval - Assign a live interval to a stack slot.
> ///
> void RegAlloc::SpillLiveInterval(LiveInterval* LI) {
> [...]
> int Slot = VRM->assignVirt2StackSlot(LI->reg);
> DEBUG(std::cerr << "Spilling " << *LI << " into slot " << Slot <<
> "\n");
> std::vector<LiveInterval*> Added =
> LIs->addIntervalsForSpills(*LI, *VRM, Slot);
>
> static unsigned J = 0;...
2006 Aug 21
3
[LLVMdev] Recalculating live intervals
...::spill(
> unsigned v_reg,
> KillingSites_Fer & ks,
> const MachineBasicBlock & mbb
> ) {
> // First, find a place to store this register. Of course, this will be
> done
> // by the implementation of vrm. We just have to ask it.
> int slot = vrm->assignVirt2StackSlot(v_reg);
> unsigned p_reg = this->reg_mapping->get_physical_location(v_reg);
>
> // Now, it is necessary to break the live range of the spilled
> register.
> // This is done by creating new virtual registers, and substituting
> the
> // spilled register by the...
2012 Apr 14
0
[LLVMdev] Spilling in Register allocator.
Hi,
I am currently working on a simple graph coloring based register allocator
on llvm.
So far my code builds the interference graph and assigns physical registers
using the VirtRegMap. However I am facing some trouble while spilling.
I used *assignVirt2StackSlot* method of VirtRegMap and got “UNREACHABLE
EXECUTED” error.
I would like to know if simply calling this method is enough to spill the
register or whether I need to explicitly assign memory location. Also I do
not understand how the spiller object is to be used.
Any help regarding this would be...
2006 Aug 23
1
[LLVMdev] Recalculating live intervals
Fernando Magno Quintao Pereira wrote:
>> I'm not sure about one thing: you assign stack slot to each new register you
>> replace the spilled one with. And then you need to allocate physical
>> registers to them. Is it possible to assign physical register to the virtual
>> one which has a stack slot already?
>>
>
> Yes. The stack slot is the place where the
2009 Oct 22
0
[LLVMdev] request for help writing a register allocator
Hi Susan,
> But this doesn't seem to be happening; the stores to memory are there but
> the loads are not.
>
> Any ideas what's going wrong?
Are you using VirtRegMap::addSpillPoint and VirtRegMap::addRestorePoint ? If
not you may need to add calls to them to let the rewriter know where to
insert the loads/stores.
> If not, any advice on how to generate the loads
2009 Oct 22
0
[LLVMdev] request for help writing a register allocator
...ach instruction, I iterate over the operands. For each operand that
is a virtual register "r", if "r" hasn't been given a physical register
and there is one available (in "r"'s class), then I allocate that physical
register to "r". If not, I call assignVirt2StackSlot(r) and
assignVirt2Phys(r, sp), where sp is s physical register in "r"'s class
that has been saved to be used as a spill register.
I don't do anything special for the case you mention, so that may be my
problem. I thought that what I am doing, plus calling the spiller at the...
2009 Oct 22
4
[LLVMdev] request for help writing a register allocator
I found the problem! My generated code is spilling correctly but is not
reloading at all. For example, if the original code has the equivalent of
this (where %1024 is a virtual reg):
%1024 = xxx
...
yyy = %1024
and I find no physical register for %1024, then I assign it to physical
register %edi and to a stackslot. That creates code like this:
%edi = xxx
store from %edi to the
2009 Oct 22
4
[LLVMdev] request for help writing a register allocator
Hi Susan,
> 1. I tried running the PBQP allocator (as a dynamic pass), but that didn't
> work....
Can you tell from this what I'm doing wrong?
>
The PBQP allocator is built into the LLVM CodeGen library, so the
"-regalloc=pbqp" option is already available in llc. If you've built a copy
of the PBQP allocator in a separate library it will try to re-register