llvm-6502/include/llvm
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
..
ADT Provide LiveIntervalUnion::Query::checkLoopInterference. 2010-12-17 04:09:47 +00:00
Analysis Move Value::getUnderlyingObject to be a standalone 2010-12-15 20:02:24 +00:00
Assembly
Bitcode
CodeGen Provide LiveIntervalUnion::Query::checkLoopInterference. 2010-12-17 04:09:47 +00:00
CompilerDriver
Config Support/FileSystem: Fix MinGW build. It doesn't have _chsize_s. 2010-12-03 18:48:56 +00:00
ExecutionEngine
MC MC/Mach-O: On second thought, use a custom hook for enabling aggressive 2010-12-17 05:50:29 +00:00
Object Mach-O/ARM: Add relocation type enumeration. 2010-12-10 06:19:49 +00:00
Support improve switch formation to handle small range 2010-12-17 06:20:15 +00:00
Target MC/Target: Remove HasScatteredSymbols target hook variable, which has been 2010-12-17 02:06:08 +00:00
Transforms remove the dead (and terrible) llvm::RemoveSuccessor function. 2010-12-14 06:51:55 +00:00
AbstractTypeUser.h
Argument.h
Attributes.h
AutoUpgrade.h
BasicBlock.h
CallGraphSCCPass.h
CallingConv.h Adding target specific calling conventions to support the MBlaze GCC function 2010-12-15 20:14:09 +00:00
CMakeLists.txt
Constant.h
Constants.h clarify comment 2010-12-03 01:11:13 +00:00
DerivedTypes.h
Function.h
GlobalAlias.h
GlobalValue.h
GlobalVariable.h
GVMaterializer.h
InitializePasses.h Add MachineLoopRanges analysis. 2010-12-15 23:41:23 +00:00
InlineAsm.h
InstrTypes.h
Instruction.def
Instruction.h
Instructions.h Fix paste-o in ExtractValueInst::getIndexedType() comments. 2010-12-03 14:54:33 +00:00
IntrinsicInst.h remove the pointless check of MemoryUseIntrinsic from 2010-11-30 02:03:47 +00:00
Intrinsics.h
Intrinsics.td Make @llvm.invariant.start not be readonly, so that it has side-effects. This 2010-11-30 04:13:41 +00:00
IntrinsicsAlpha.td
IntrinsicsARM.td Add Neon VCVT instructions for f32 <-> f16 conversions. 2010-12-15 22:14:12 +00:00
IntrinsicsCellSPU.td
IntrinsicsPowerPC.td
IntrinsicsX86.td
IntrinsicsXCore.td
LinkAllPasses.h
LinkAllVMCore.h Missed a spot removing Alarm. 2010-12-07 18:50:33 +00:00
Linker.h
LLVMContext.h
Metadata.h
Module.h
OperandTraits.h
Operator.h
Pass.h
PassAnalysisSupport.h
PassManager.h
PassManagers.h
PassRegistry.h
PassSupport.h
SymbolTableListTraits.h
Type.h
TypeSymbolTable.h
Use.h
User.h
Value.h Move Value::getUnderlyingObject to be a standalone 2010-12-15 20:02:24 +00:00
ValueSymbolTable.h