llvm-6502/lib
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
..
Analysis Update a comment. 2010-12-16 02:55:10 +00:00
Archive MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm. 2010-12-16 03:29:14 +00:00
AsmParser MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm. 2010-12-16 03:29:14 +00:00
Bitcode
CodeGen Provide LiveIntervalUnion::Query::checkLoopInterference. 2010-12-17 04:09:47 +00:00
CompilerDriver
ExecutionEngine
Linker MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm. 2010-12-16 03:29:14 +00:00
MC MC/Expr: Implemnt more aggressive folding during symbol evaluation using 2010-12-17 05:50:33 +00:00
Object MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm. 2010-12-16 03:29:14 +00:00
Support Trailing whitespace and 80 column fixups. 2010-12-17 02:10:59 +00:00
Target MC/ARM: Use aggressive symbol folding (important for jump tables, for example). 2010-12-17 06:00:24 +00:00
Transforms improve switch formation to handle small range 2010-12-17 06:20:15 +00:00
VMCore MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm. 2010-12-16 03:29:14 +00:00
Makefile