Displaying 6 results from an estimated 6 matches for "usedpregset".
2012 Nov 15
1
[LLVMdev] problem trying to write an LLVM register-allocation pass
Thanks Lang, I'll try substPhysReg.
I did try your latest code, and although it made the assembler errors go
away, now some of my tests produce bad output when executed. I need to
look into that some more... (I did change my "usedPregSet" to be ALL
pregs used in the whole function, not just those in the current
instruction, so the 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...
2012 Nov 14
1
[LLVMdev] problem trying to write an LLVM register-allocation pass
Hi Susan,
The problem now is the usedPregSet. Take the instruction:
%vreg13:sub_32bit<def> = ADD32rr %vreg13:sub_32bit, %EAX<kill>,
%EFLAGS<imp-def,dead>
%EAX will be added to usedPregSet when the instruction is encountered, but
%vreg13 is a different class (64bit registers), so none of its candidates
will conflict. In add...
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 13
0
[LLVMdev] problem trying to write an LLVM register-allocation pass
Lang -
Your fix does prevent the assembler errors, but it doesn't seem to
produce correct assembly.
I created a slightly modified version that, for each instruction that
includes a vreg, adds a check that the preg selected is not already in
that instruction. I've attached that version.
I think that this version of Gcra.cpp should produce correct assembler,
since it's allocating
2012 Nov 13
5
[LLVMdev] problem trying to write an LLVM register-allocation pass
Hi Susan,
The problem is that the allocator is re-using the 'preg', which is
calculated for an operand that may have a subreg index, for loads and
stores to a stack-slot. The stack slot always has the same width as vreg
(which is the right behavior), but for operands with subreg indexes,
'preg''s class will be different from 'vreg', in which case you get the
mismatched