LLVM backend for 6502
Go to file
Chris Lattner e27db74a60 improve switch formation to handle small range
comparisons formed by comparisons.  For example,
this:

void foo(unsigned x) {
  if (x == 0 || x == 1 || x == 3 || x == 4 || x == 6) 
    bar();
}

compiles into:

_foo:                                   ## @foo
## BB#0:                                ## %entry
	cmpl	$6, %edi
	ja	LBB0_2
## BB#1:                                ## %entry
	movl	%edi, %eax
	movl	$91, %ecx
	btq	%rax, %rcx
	jb	LBB0_3

instead of:

_foo:                                   ## @foo
## BB#0:                                ## %entry
	cmpl	$2, %edi
	jb	LBB0_4
## BB#1:                                ## %switch.early.test
	cmpl	$6, %edi
	ja	LBB0_3
## BB#2:                                ## %switch.early.test
	movl	%edi, %eax
	movl	$88, %ecx
	btq	%rax, %rcx
	jb	LBB0_4

This catches a bunch of cases in GCC, which look like this:

 %804 = load i32* @which_alternative, align 4, !tbaa !0
 %805 = icmp ult i32 %804, 2
 %806 = icmp eq i32 %804, 3
 %or.cond121 = or i1 %805, %806
 %807 = icmp eq i32 %804, 4
 %or.cond124 = or i1 %or.cond121, %807
 br i1 %or.cond124, label %.thread, label %808

turning this into a range comparison.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122045 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 06:20:15 +00:00
autoconf Use GZIPBIN instead of GZIP. Apparently gzip uses GZIP as an environment 2010-12-10 01:31:51 +00:00
bindings Try to fix ocaml bindings. 2010-10-08 00:36:21 +00:00
cmake Reverting commit to LLVMLibDeps that was inadvertently done in 121649. 2010-12-12 22:28:51 +00:00
docs Fix a typo that Bill spotted. 2010-12-15 23:09:41 +00:00
examples Fix missing includes of "llvm/Analysis/Passes.h" in the tutorials. Thanks 2010-11-16 17:28:22 +00:00
include improve switch formation to handle small range 2010-12-17 06:20:15 +00:00
lib improve switch formation to handle small range 2010-12-17 06:20:15 +00:00
projects Regen configure 2010-12-12 21:42:01 +00:00
runtime
test improve switch formation to handle small range 2010-12-17 06:20:15 +00:00
tools llvm-dis: Fix memory leak. ParseBitcodeFile should be taking ownership of 2010-12-16 22:37:52 +00:00
unittests Complete tests for IntervalMapOverlaps. 2010-12-17 01:31:49 +00:00
utils Neon intrinsic tests need to be compiled for Cortex-A9 for f16 support. 2010-12-17 01:21:03 +00:00
website
.gitignore Oops, didn't mean to ignore .gitignore. 2010-12-16 17:51:14 +00:00
build-for-llvm-top.sh
CMakeLists.txt CMake: Add FileUpdate to the build. 2010-12-09 17:54:44 +00:00
configure Use GZIPBIN instead of GZIP. Apparently gzip uses GZIP as an environment 2010-12-10 01:31:51 +00:00
CREDITS.TXT Another git svn dcommit test. This time let's hope it doesn't kill my repo. 2010-12-10 14:45:10 +00:00
LICENSE.TXT
llvm.spec.in
Makefile Merge System into Support. 2010-11-29 18:16:10 +00:00
Makefile.common
Makefile.config.in Use GZIPBIN instead of GZIP. Apparently gzip uses GZIP as an environment 2010-12-10 01:31:51 +00:00
Makefile.rules build: Shared libraries shouldn't used RPATH on Darwin, only main executables 2010-12-08 02:29:26 +00:00
ModuleInfo.txt Remove trailing space. This is just an excuse to poke the 2010-10-05 20:32:15 +00:00
README.txt Undoing test commit blank space. 2010-09-29 17:39:29 +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.