http://llvm.org/bugs/show_bug.cgi?id=9370

           Summary: [arm] unnecessary MOVW not optimized
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: ARM
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


this:

  volatile store i32 -1, i32* inttoptr (i32 1342210076 to i32*), align 4, !tbaa
!0
  volatile store i32 -1, i32* inttoptr (i32 1342341148 to i32*), align 4, !tbaa
!0

is compiled and optimized to that:

    movw    r0, #32796
    mov.w    r1, #-1
    movt    r0, #20480
    str    r1, [r0]
    movw    r0, #32796    @ <= this MOVW is not needed, value is there already
    movt    r0, #20482
    str    r1, [r0]

the initial C code was:

    LPC_GPIO0->IC = ~0;
    LPC_GPIO2->IC = ~0;

It was compiled with -march=thumb -mcpu=cortex-m3 -O3

btw: Thanks for the great work, the ARM code looks quite good already!

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to