LLVM backend for 6502
Go to file
Jakob Stoklund Olesen 0d5fcae6cd 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155136 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 16:46:26 +00:00
autoconf add configure flag --with-default-sysroot 2012-04-16 04:11:45 +00:00
bindings
cmake
docs [docs] Add back old index.html until I get llvm.org work done to support Sphinx docs. 2012-04-19 16:37:30 +00:00
examples
include Allow targets to select the default scheduler by name. 2012-04-19 01:34:10 +00:00
lib Defer some shl transforms to DAGCombine. 2012-04-19 16:46:26 +00:00
projects
runtime
test Defer some shl transforms to DAGCombine. 2012-04-19 16:46:26 +00:00
tools Move the JIT flags from llc to lli. These flags showed up as part of moving 2012-04-18 08:34:12 +00:00
unittests Goodbye, JSONParser... 2012-04-17 17:21:17 +00:00
utils llvm-lit: Inject the lit module path at the beginning of sys.path, just in case 2012-04-19 16:31:08 +00:00
.gitignore [docs] Stub out structure for Sphinx-based docs. 2012-04-19 16:31:19 +00:00
CMakeLists.txt Goodbye, JSONParser... 2012-04-17 17:21:17 +00:00
configure add configure flag --with-default-sysroot 2012-04-16 04:11:45 +00:00
CREDITS.TXT Update woefully stale credits entry. Everything listed there had been 2012-04-17 01:19:37 +00:00
LICENSE.TXT
llvm.spec.in
LLVMBuild.txt
Makefile
Makefile.common
Makefile.config.in
Makefile.rules Fix the build under Debian GNU/Hurd. 2012-04-11 15:35:36 +00:00
README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the HTML documentation provided in docs/index.html for further
assistance with LLVM.

If you're writing a package for LLVM, see docs/Packaging.html for our
suggestions.