LLVM backend for 6502
Go to file
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
autoconf Add options to disable building of ARCMT, Rewriter and Static Analyzer 2012-12-13 16:07:19 +00:00
bindings [python] Add markup option to disassembler 2012-12-01 21:57:30 +00:00
cmake CMake: factor out a function that returns the expected directory for unit test 2012-12-19 12:30:33 +00:00
docs doc: add subsections. 2012-12-19 18:04:44 +00:00
examples Sort the #include lines of the examples/... tree. 2012-12-04 10:16:57 +00:00
include Remove edis remnant. 2012-12-19 20:11:17 +00:00
lib LLVM sdisel normalize bit extraction of the form: 2012-12-19 20:16:09 +00:00
projects Clean up the sample include orderings, not that it really matters... 2012-12-04 10:46:21 +00:00
runtime
test LLVM sdisel normalize bit extraction of the form: 2012-12-19 20:16:09 +00:00
tools Remove edis - the enhanced disassembler. Fixes PR14654. 2012-12-19 19:55:47 +00:00
unittests Add an assertion for a likely ilist::splice() contract violation. 2012-12-18 19:28:37 +00:00
utils Remove edis - the enhanced disassembler. Fixes PR14654. 2012-12-19 19:55:47 +00:00
.arcconfig Add .arcconfig to the repository. Useful if someone wants to use phabricator's command line tool. 2012-12-01 12:07:58 +00:00
.gitignore
CMakeLists.txt Fix spelling 2012-12-13 15:25:07 +00:00
CODE_OWNERS.TXT Taking ownership of indvars/lsr. 2012-12-05 23:32:44 +00:00
configure Add options to disable building of ARCMT, Rewriter and Static Analyzer 2012-12-13 16:07:19 +00:00
CREDITS.TXT Update my email address. 2012-11-29 21:17:26 +00:00
LICENSE.TXT Few more small CellSPU removals. 2012-11-14 22:13:56 +00:00
llvm.spec.in
LLVMBuild.txt
Makefile [c-index-test] When building with BUILD_CLANG_ONLY=YES, include c-index-test. 2012-11-06 19:54:46 +00:00
Makefile.common Makefile.common: Update a description, s/Source/SOURCES/ , according to MakefileGuide.html#control-variables . 2012-12-07 01:43:23 +00:00
Makefile.config.in Add options to disable building of ARCMT, Rewriter and Static Analyzer 2012-12-13 16:07:19 +00:00
Makefile.rules Remove edis - the enhanced disassembler. Fixes PR14654. 2012-12-19 19:55:47 +00:00
README.txt Test commit. 2012-11-29 16:19:11 +00:00

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.