Vladimir Prus
2004-Jul-06 09:43 UTC
[LLVMdev] Moving between registers of different classes
Suppose I need to align an address register to even boundary. Since address
register can't be AND-ed with anything, I move the value into general
purpose
register, to "and" and then move it into address register.
Unfortunately, the
register allocator crashes. Here's machine code:
%reg1030 = - %reg1027, 1
%reg1031 = move %reg1030
%reg1032 = + %reg1031, -2
%reg1033 = move %reg1032
%ar1 = load64 %gr1<def>, %reg1033
and here's assertion:
llc: LiveIntervals.cpp:507: void llvm::LiveIntervals::joinIntervals():
Assertion `rcA == rcB && "registers must be of the same
class"' failed.
(gdb) up 4
.....
(gdb) p *intA
$1 = (llvm::LiveInterval &) @0x8064698: {reg = 1030, weight = 0,
........
(gdb) p *intB
$2 = (llvm::LiveInterval &) @0x80646b8: {reg = 1031, weight = 0,
.......
Is there anything I can do to make it work? Actually, it seems like a bug in
register allocator. If it can't coalesce intervals because there are
different register classes, it should just leave the move alone, not crash.
- Volodya
Alkis Evlogimenos
2004-Jul-06 10:51 UTC
[LLVMdev] Moving between registers of different classes
On Tue, 2004-07-06 at 09:41, Vladimir Prus wrote:> Is there anything I can do to make it work? Actually, it seems like a bug in > register allocator. If it can't coalesce intervals because there are > different register classes, it should just leave the move alone, not crash.You are right, it shouldn't crash. The assert was added to check if the x86 instructor selector ever did a move between two different register classes and it was left there. Can you try the attached patch and let me know if it works? -- Alkis -------------- next part -------------- A non-text attachment was scrubbed... Name: li.diff Type: text/x-patch Size: 1610 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20040706/6ba0df39/attachment.bin>
Apparently Analagous Threads
- [LLVMdev] Removing dead code
- [LLVMdev] implicit CC register Defs cause "physreg was not killed in defining block!" assert
- [LLVMdev] implicit CC register Defs cause "physreg was not killed in defining block!" assert
- [LLVMdev] backend problem with LiveInterval::removeRange
- [LLVMdev] implicit CC register Defs cause "physreg was not killed in defining block!" assert