llvm-6502/lib
Evan Cheng 733c6b1db1 LLVM sdisel normalize bit extraction of the form:
((x & 0xff00) >> 8) << 2
to
 (x >> 6) & 0x3fc

This is general goodness since it folds a left shift into the mask. However,
the trailing zeros in the mask prevents the ARM backend from using the bit
extraction instructions. And worse since the mask materialization may require
an addition instruction. This comes up fairly frequently when the result of 
the bit twiddling is used as memory address. e.g.

 = ptr[(x & 0xFF0000) >> 16]

We want to generate:
  ubfx   r3, r1, #16, #8
  ldr.w  r3, [r0, r3, lsl #2]

vs.
  mov.w  r9, #1020
  and.w  r2, r9, r1, lsr #14
  ldr    r2, [r0, r2]

Add a late ARM specific isel optimization to
ARMDAGToDAGISel::PreprocessISelDAG(). It folds the left shift to the
'base + offset' address computation; change the mask to one which doesn't have
trailing zeros and enable the use of ubfx.

Note the optimization has to be done late since it's target specific and we
don't want to change the DAG normalization. It's also fairly restrictive
as shifter operands are not always free. It's only done for lsh 1 / 2. It's
known to be free on some cpus and they are most common for address
computation.

This is a slight win for blowfish, rijndael, etc.

rdar://12870177


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170581 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-19 20:16:09 +00:00
..
Analysis Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future. 2012-12-19 07:18:57 +00:00
Archive Sort includes for all of the .h files under the 'lib' tree. These were 2012-12-04 07:12:27 +00:00
AsmParser Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future. 2012-12-19 07:18:57 +00:00
Bitcode Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future. 2012-12-19 07:18:57 +00:00
CodeGen Change AsmOperandInfo::ConstraintVT to MVT, instead of EVT. 2012-12-19 15:19:11 +00:00
DebugInfo Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future. 2012-12-19 07:18:57 +00:00
ExecutionEngine Query section for whether it should be executable. 2012-12-17 17:59:35 +00:00
Linker Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
MC Remove edis - the enhanced disassembler. Fixes PR14654. 2012-12-19 19:55:47 +00:00
Object Revert 170545 while I debug the ppc failures. 2012-12-19 14:48:05 +00:00
Option Copy clang/Driver/<Option parsing stuff> to llvm. 2012-12-05 00:29:32 +00:00
Support Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future. 2012-12-19 07:18:57 +00:00
TableGen Sort includes for all of the .h files under the 'lib' tree. These were 2012-12-04 07:12:27 +00:00
Target LLVM sdisel normalize bit extraction of the form: 2012-12-19 20:16:09 +00:00
Transforms Transform (x&C)>V into (x&C)!=0 where possible 2012-12-19 19:47:13 +00:00
VMCore Change AsmOperandInfo::ConstraintVT to MVT, instead of EVT. 2012-12-19 15:19:11 +00:00
CMakeLists.txt Copy clang/Driver/<Option parsing stuff> to llvm. 2012-12-05 00:29:32 +00:00
LLVMBuild.txt Copy clang/Driver/<Option parsing stuff> to llvm. 2012-12-05 00:29:32 +00:00
Makefile Copy clang/Driver/<Option parsing stuff> to llvm. 2012-12-05 00:29:32 +00:00