[llvm-commits] [llvm] r76889 - in /llvm/trunk/lib/Target/ARM: ARMInstrThumb.td ARMInstrThumb2.td

Chris Lattner clattner at apple.com
Thu Jul 23 14:12:25 PDT 2009


On Jul 23, 2009, at 11:26 AM, Evan Cheng wrote:
> Author: evancheng
> Date: Thu Jul 23 13:26:03 2009
> New Revision: 76889
>
> URL: http://llvm.org/viewvc/llvm-project?rev=76889&view=rev
> Log:
> Since we have moved unified assembly, switch to ADR instruction  
> instead of a the difficult-to-read .set + add syntax to materialize  
> pc-relative address.
>
> Turns out this also fixed a poor code selection on Thumb1. I have no  
> idea why we were using a mov + add to do the same thing as ADR before.

Nice.

> -def tLEApcrel : T1Ix2<(outs tGPR:$dst), (ins i32imm:$label),
> -               !strconcat(!strconcat(".set ${:private}PCRELV$ 
> {:uid}, ($label-(",
> -                                     "${:private}PCRELL${:uid}+4)) 
> \n"),
> -                          !strconcat("\tmovs $dst, #$ 
> {:private}PCRELV${:uid}\n",
> -                             "${:private}PCRELL${:uid}:\n\tadd  
> $dst, pc")),
> -                    []>;

FWIW, tblgen now does "C style neighboring string merging", so the  
above could be written as:

    "foo"
    "bar"
    "baz"

without using !strconcat.  I don't know if there are other places that  
could benefit from this, but if so, it would be nice to clean up.

-Chris




More information about the llvm-commits mailing list