[llvm-commits] [llvm] r133503 - in /llvm/trunk: lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/Target/ARM/ARMInstrInfo.td lib/Target/ARM/ARMInstrThumb.td lib/Target/ARM/ARMInstrThumb2.td test/CodeGen/ARM/rev.ll test/CodeGen/X86/bswap.ll

Chris Lattner clattner at apple.com
Mon Jun 20 23:56:25 PDT 2011


On Jun 20, 2011, at 11:01 PM, Evan Cheng wrote:

> Author: evancheng
> Date: Tue Jun 21 01:01:08 2011
> New Revision: 133503
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=133503&view=rev
> Log:
> Teach dag combine to match halfword byteswap patterns.
> 1. (((x) & 0xFF00) >> 8) | (((x) & 0x00FF) << 8)
>   => (bswap x) >> 16
> 2. ((x&0xff)<<8)|((x&0xff00)>>8)|((x&0xff000000)>>8)|((x&0x00ff0000)<<8))
>   => (rotl (bswap x) 16)
> 
> This allows us to eliminate most of the def : Pat patterns for ARM rev16
> revsh instructions. It catches many more cases for ARM and x86.

Nice!

-Chris



More information about the llvm-commits mailing list