[LLVMdev] Question about Pre-RA-schedule in LLVM3.3

Caldarale, Charles R Chuck.Caldarale at unisys.com
Sun Dec 15 06:43:34 PST 2013


> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of Haishan
> Subject: [LLVMdev] Question about Pre-RA-schedule in LLVM3.3

> My clang version is 3.3 and debug build.

> //test.c
> int a[6] = {1, 2, 3, 4, 5, 6}
> int main() {
>  a[0] = a[5];
>  a[1] = a[4];
>  a[2] = a[5];
> }
> //end test.c
> Then test.dump is generated by using the objdump tool.
> //test.dump
> ldr  r1, [r0, #20]
> str  r1, [r0]
> ldr  r1, [r0, #16]
> str  r1, [r0, #4]
> ldr  r1, [r0, #12]
> str  r1, [r0, #8]
> bx  lr
> //end test.dump

It appears you have a typo in the above, since the generated array reference offsets do not correspond to the code in test.c.  Presumably, the last array reference in test.c was really from a[3], not a[5].

> However, for 3th and 4th instructions, they should be allocated different 
> register from the second instruction.

Why?

 - Chuck





More information about the llvm-dev mailing list