[LLVMdev] Scheduled Instructions go missing

Aran Clauson aran at 100acres.us
Wed May 19 10:13:57 PDT 2010


All,
	I'm working on a new scheduler.  I have a basic block for 
which my scheduler generates bad code.  The C code looks 
like

int j, *p;
if ((j = *p++) != 0) {...}

My scheduler emits (x86, AT&T)
mov p, %rax
mov (%rax), %rax
mov %rax, j
addq $0x04, p
je  ...

Notice there is no test instruction.  The default list 
scheduler generates

mov p, %rax
mov (%rax), %rax
mov %rax, j
addq $0x04, p
test  %rax
je  ...

The sequence generated by both schedulers after scheduling 
and before emission and they are the same.  Specifically, 
the test instruction is present in both sequences at the 
same point.
	I'm thinking that there is something I set in the SUnits, 
but I don't know what that would be.  Any ideas?

Aran
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100519/641d8988/attachment.sig>


More information about the llvm-dev mailing list