llvm-mirror/lib
Jakob Stoklund Olesen 1507d20c57 Defer some shl transforms to DAGCombine.
The shl instruction is used to represent multiplication by a constant
power of two as well as bitwise left shifts. Some InstCombine
transformations would turn an shl instruction into a bit mask operation,
making it difficult for later analysis passes to recognize the
constsnt multiplication.

Disable those shl transformations, deferring them to DAGCombine time.
An 'shl X, C' instruction is now treated mostly the same was as 'mul X, C'.

These transformations are deferred:

  (X >>? C) << C   --> X & (-1 << C)  (When X >> C has multiple uses)
  (X >>? C1) << C2 --> X << (C2-C1) & (-1 << C2)   (When C2 > C1)
  (X >>? C1) << C2 --> X >>? (C1-C2) & (-1 << C2)  (When C1 > C2)

The corresponding exact transformations are preserved, just like
div-exact + mul:

  (X >>?,exact C) << C   --> X
  (X >>?,exact C1) << C2 --> X << (C2-C1)
  (X >>?,exact C1) << C2 --> X >>?,exact (C1-C2)

The disabled transformations could also prevent the instruction selector
from recognizing rotate patterns in hash functions and cryptographic
primitives. I have a test case for that, but it is too fragile.

llvm-svn: 155136
2012-04-19 16:46:26 +00:00
..
Analysis Revert "SCEV: When expanding a GEP the final addition to the base pointer has NUW but not NSW." 2012-04-17 06:33:57 +00:00
Archive
AsmParser
Bitcode
CodeGen Allow targets to select the default scheduler by name. 2012-04-19 01:34:10 +00:00
DebugInfo Fix a C++11 UDL conflict. 2012-04-04 20:33:56 +00:00
ExecutionEngine Fix incorrect call of resolveRelocation() for ARM ELF stub relocations. 2012-04-17 20:10:16 +00:00
Linker
MC MC assembly parser handling for trailing comma in macro instantiation. 2012-04-16 21:18:49 +00:00
Object Implement GDB integration for source level debugging of code JITed using 2012-04-16 22:12:58 +00:00
Support SourceMgr: Colorize diagnostics. 2012-04-18 19:04:15 +00:00
TableGen Fix copy/paste-o. 2012-04-18 18:09:53 +00:00
Target zap tabs 2012-04-19 15:16:31 +00:00
Transforms Defer some shl transforms to DAGCombine. 2012-04-19 16:46:26 +00:00
VMCore Remove AVX vpermil intrinsics. I removed their uses from clang headers and builtins a while back. 2012-04-18 05:24:00 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile