[LLVMdev] Problems with live-ins and live-outs

Sylvere Teissier st at invia.fr
Fri Sep 18 08:13:26 PDT 2009


Hi,
With the MSP430 target I have live-in/live-out problems pointed out by
Machine Instruction Verifier with the attached test-case compiled with:

clang-cc -triple=msp430-unknown-unknown test-live.c -S -o - -O1
-verify-machineinstrs -debug

For example: %R15W is killed in MBB#0:
CMP16rr %R14W<kill>, %R15W<kill>, %SRW<imp-def>

But %R15 as live-in in MMB#1:
if.else: 0xa244c20, LLVM BB @0xa1f0a08, ID#1:
Live Ins: %R15W %R15B
    Predecessors according to CFG: 0xa244bd4 (#0)
	CMP16ir -21, %R15W, %SRW<imp-def>

Does someone have any idea of what can be the root cause of these
errors? How can I debug this?

---------------------------Complete Output:----------------------
# Machine code for f():
Live Ins: R15W in VR#1025  R14W in VR#1026
Live Outs: R15W

entry: 0xa244bd4, LLVM BB @0xa1f0c10, ID#0:
Live Ins: %R15W %R14W
	CMP16rr %R14W<kill>, %R15W<kill>, %SRW<imp-def>
	JCC mbb<return,0xa244d04>, 5, %SRW<imp-use>
    Successors according to CFG: 0xa244d04 (#4) 0xa244c20 (#1)

if.else: 0xa244c20, LLVM BB @0xa1f0a08, ID#1:
Live Ins: %R15W %R15B
    Predecessors according to CFG: 0xa244bd4 (#0)
	CMP16ir -21, %R15W, %SRW<imp-def>
	JCC mbb<if.end7,0xa244cb8>, 5, %SRW<imp-use>
    Successors according to CFG: 0xa244c6c (#2) 0xa244cb8 (#3)

if.then5: 0xa244c6c, LLVM BB @0xa1e93c0, ID#2:
Live Ins: %R15W %R15B
    Predecessors according to CFG: 0xa244c20 (#1)
	%R12W<def> = MOV16ri 10
	%R12W<def> = SUB16rr %R12W, %R15W<kill>, %SRW<imp-def>
	%R15W<def> = MOV16rr %R12W<kill>
	RET %R15W<imp-use,kill>

if.end7: 0xa244cb8, LLVM BB @0xa1f09c0, ID#3:
Live Ins: %R15W %R15B
    Predecessors according to CFG: 0xa244c20 (#1)
	%R15W<def> = ADD16ri %R15W, 18, %SRW<imp-def>
	RET %R15W<imp-use,kill>

return: 0xa244d04, LLVM BB @0xa1efa18, ID#4:
Live Ins: %R15W %R15B
    Predecessors according to CFG: 0xa244bd4 (#0)
	RET %R15W<imp-use,kill>

# End machine code for f().

*** Bad machine code: Live-in physical register is not live-out from
predecessor ***
- function:    f
- basic block: if.else 0xa244c20 (#1)
Register R15W is not live-out from MBB #0.

*** Bad machine code: Live-in physical register is not live-out from
predecessor ***
- function:    f
- basic block: if.else 0xa244c20 (#1)
Register R15B is not live-out from MBB #0.

*** Bad machine code: Live-in physical register is not live-out from
predecessor ***
- function:    f
- basic block: return 0xa244d04 (#4)
Register R15W is not live-out from MBB #0.

*** Bad machine code: Live-in physical register is not live-out from
predecessor ***
- function:    f
- basic block: return 0xa244d04 (#4)
Register R15B is not live-out from MBB #0.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-live.c
Type: text/x-csrc
Size: 113 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090918/492aa38f/attachment.c>


More information about the llvm-dev mailing list