Displaying 13 results from an estimated 13 matches for "reservedregs".
2012 Nov 15
1
[LLVMdev] problem trying to write an LLVM register-allocation pass
...problem should not be the erroneous over-writing of
a live preg.)
Also, I'm confused about the code that gets a preg for a given vreg.
Previously,you gave me code that takes into account the "allocation
order" and the "reserved regs", including the following:
BitVector reservedRegs = TRI->getReservedRegs(Fn);
ArrayRef<uint16_t> rawOrder = trc->getRawAllocationOrder(Fn);
ArrayRef<uint16_t>::iterator rItr = rawOrder.begin();
while (rItr != rawOrder.end()) {
while (rItr != rawOrder.end() && reservedRegs.test(*rIt...
2012 Feb 16
1
[LLVMdev] LLVM: MachineCopyPropagation.cpp
...e following code:
%a1<def> = COPY %a0<kill>
...
%a0h<def> = COPY %a1l
, as input to MachineCopyPropagation.
The second copy is illegally erased! This is wrong, because it is the low part of a1 that is copied to the high part of a0.
At a first glance, it seems that
if (!ReservedRegs.test(Def) &&
(!ReservedRegs.test(Src) || NoInterveningSideEffect(CopyMI, MI)) &&
(SrcSrc == Def || TRI->isSubRegister(SrcSrc, Def))) {
...
(erase COPY)
, should be extended to
...
(SrcSrc == Def || (TRI->isSubRegister(SrcSrc, Def) &&...
2012 Nov 15
0
[LLVMdev] problem trying to write an LLVM register-allocation pass
Hi Susan,
Jakob just pointed me to 'MachineOperand::substPhysReg(unsigned preg, const
TargetRegisterInfo& TRI)'. That substitutes the given physreg for a virtreg
operand, taking the subregister index into account. That is what my
examples have been doing manually. Using substPhysReg would allow you to
tidy the Gcra code up slightly.
- Lang.
On Thu, Nov 15, 2012 at 11:21 AM, Lang
2012 Nov 15
2
[LLVMdev] problem trying to write an LLVM register-allocation pass
Thanks Jakob. I should have mentioned that earlier. :)
When you see mismatched sizes on operands it's a fair bet that the subreg
rewriting has gone wrong. I should have pulled that entirely out of the
preg search loop in the previous example.
Fixed version attached.
- Lang.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2012 Nov 11
2
[LLVMdev] problem trying to write an LLVM register-allocation pass
...y. In short:
>
> int regClass = MRI->getRegClass(vreg)->getID();
> const TargetRegisterClass *trc = TRI->getRegClass(regClass);
> ArrayRef<uint16_t> rawOrder = trc->getRawAllocationOrder(Fn);
> ArrayRef<uint16_t>::iterator rItr = rawOrder.begin();
> while (reservedRegs.test(*rItr))
> ++rItr;
> preg = *rItr;
>
> Alternatively, you could use the AllocationOrder class
> (lib/CodeGen/AllocationOrder.h). This has the benefit of considering
> register hints for improved coalescing too. It does, however, require you
> to use VirtRegMap.
>
>...
2012 Nov 08
2
[LLVMdev] problem trying to write an LLVM register-allocation pass
...ere I do this somewhat manually. In short:
int regClass = MRI->getRegClass(vreg)->getID();
const TargetRegisterClass *trc = TRI->getRegClass(regClass);
ArrayRef<uint16_t> rawOrder = trc->getRawAllocationOrder(Fn);
ArrayRef<uint16_t>::iterator rItr = rawOrder.begin();
while (reservedRegs.test(*rItr))
++rItr;
preg = *rItr;
Alternatively, you could use the AllocationOrder class
(lib/CodeGen/AllocationOrder.h). This has the benefit of considering
register hints for improved coalescing too. It does, however, require you
to use VirtRegMap.
Hope this helps!
Cheers,
Lang.
On Wed,...
2012 Nov 11
0
[LLVMdev] problem trying to write an LLVM register-allocation pass
...lass = MRI->getRegClass(vreg)->getID();
>> const TargetRegisterClass *trc = TRI->getRegClass(regClass);
>> ArrayRef<uint16_t> rawOrder = trc->getRawAllocationOrder(Fn);
>> ArrayRef<uint16_t>::iterator rItr = rawOrder.begin();
>> while (reservedRegs.test(*rItr))
>> ++rItr;
>> preg = *rItr;
>>
>> Alternatively, you could use the AllocationOrder class
>> (lib/CodeGen/AllocationOrder.h). This has the benefit of
>> considering register hints for improved coalescing too. It does,
>>...
2012 Nov 13
5
[LLVMdev] problem trying to write an LLVM register-allocation pass
...t;> int regClass = MRI->getRegClass(vreg)->getID();
>> const TargetRegisterClass *trc = TRI->getRegClass(regClass);
>> ArrayRef<uint16_t> rawOrder = trc->getRawAllocationOrder(Fn);
>> ArrayRef<uint16_t>::iterator rItr = rawOrder.begin();
>> while (reservedRegs.test(*rItr))
>> ++rItr;
>> preg = *rItr;
>>
>> Alternatively, you could use the AllocationOrder class
>> (lib/CodeGen/AllocationOrder.h). This has the benefit of considering
>> register hints for improved coalescing too. It does, however, require you
>>...
2012 Nov 09
0
[LLVMdev] problem trying to write an LLVM register-allocation pass
...ly. In short:
>
> int regClass = MRI->getRegClass(vreg)->getID();
> const TargetRegisterClass *trc = TRI->getRegClass(regClass);
> ArrayRef<uint16_t> rawOrder = trc->getRawAllocationOrder(Fn);
> ArrayRef<uint16_t>::iterator rItr = rawOrder.begin();
> while (reservedRegs.test(*rItr))
> ++rItr;
> preg = *rItr;
>
> Alternatively, you could use the AllocationOrder class
> (lib/CodeGen/AllocationOrder.h). This has the benefit of considering
> register hints for improved coalescing too. It does, however, require
> you to use VirtRegMap.
>
&g...
2012 Nov 13
0
[LLVMdev] problem trying to write an LLVM register-allocation pass
...->getID();
>>> const TargetRegisterClass *trc = TRI->getRegClass(regClass);
>>> ArrayRef<uint16_t> rawOrder = trc->getRawAllocationOrder(Fn);
>>> ArrayRef<uint16_t>::iterator rItr = rawOrder.begin();
>>> while (reservedRegs.test(*rItr))
>>> ++rItr;
>>> preg = *rItr;
>>>
>>> Alternatively, you could use the AllocationOrder class
>>> (lib/CodeGen/AllocationOrder.h). This has the benefit of
>>> considering register hints for i...
2012 Nov 14
1
[LLVMdev] problem trying to write an LLVM register-allocation pass
...>>> const TargetRegisterClass *trc = TRI->getRegClass(regClass);
>>>> ArrayRef<uint16_t> rawOrder = trc->getRawAllocationOrder(Fn)**;
>>>> ArrayRef<uint16_t>::iterator rItr = rawOrder.begin();
>>>> while (reservedRegs.test(*rItr))
>>>> ++rItr;
>>>> preg = *rItr;
>>>>
>>>> Alternatively, you could use the AllocationOrder class
>>>> (lib/CodeGen/AllocationOrder.**h). This has the benefit of
>>>> consid...
2012 Nov 07
0
[LLVMdev] problem trying to write an LLVM register-allocation pass
Hi Susan,
Sorry for the delayed response. Thanks for the test cases - I'm looking in
to this now.
- Lang.
On Mon, Nov 5, 2012 at 2:58 PM, Susan Horwitz <horwitz at cs.wisc.edu> wrote:
> Hi Lang,
>
> I looked more into one of the problems I'm now having, and I've attached 3
> files:
>
> Gcra.cpp is like your version except that for two specific vregs it uses
2012 Nov 05
2
[LLVMdev] problem trying to write an LLVM register-allocation pass
Hi Lang,
I looked more into one of the problems I'm now having, and I've attached
3 files:
Gcra.cpp is like your version except that for two specific vregs it uses
hard-coded pregs instead of the first in the corresponding class.
bug1.c is an input that causes the failed assertion for me. If I use
the non-debug version of LLVM-3.1 I instead get assembler errors like this:
Error: