1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-01 08:23:21 +01:00
llvm-mirror/lib/Transforms/Scalar
Chris Lattner 4af67af013 Teach the table lookup optimization to generate range compares
when a consequtive sequence of elements all satisfies the 
predicate.  Like the double compare case, this generates better
code than the magic constant case and generalizes to more than
32/64 element array lookups.

Here are some examples where it triggers.  From 403.gcc, most
accesses to the rtx_class array are handled, e.g.:

@rtx_class = constant [153 x i8] c"xxxxxmmmmmmmmxxxxxxxxxxxxmxxxxxxiiixxxxxxxxxxxxxxxxxxxooxooooooxxoooooox3x2c21c2222ccc122222ccccaaaaaa<<<<<<<<<<<<<<<<<<111111111111bbooxxxxxxxxxxcc2211x", align 32 ; <[153 x i8]*> [#uses=547]
   %142 = icmp eq i8 %141, 105
@rtx_class = constant [153 x i8] c"xxxxxmmmmmmmmxxxxxxxxxxxxmxxxxxxiiixxxxxxxxxxxxxxxxxxxooxooooooxxoooooox3x2c21c2222ccc122222ccccaaaaaa<<<<<<<<<<<<<<<<<<111111111111bbooxxxxxxxxxxcc2211x", align 32 ; <[153 x i8]*> [#uses=543]
	   %165 = icmp eq i8 %164, 60      

Also, most of the 59-element arrays (mode_class/rid_to_yy, etc) 
optimized before are actually range compares.  This lets 32-bit
machines optimize them.

400.perlbmk has stuff like this:

400.perlbmk: PL_regkind, even for 32-bit:
@PL_regkind = constant [62 x i8] c"\00\00\02\02\02\06\06\06\06\09\09\0B\0B\0D\0E\0E\0E\11\12\12\14\14\16\16\18\18\1A\1A\1C\1C\1E\1F !!!$$&'((((,-.///88886789:;8$", align 32 ; <[62 x i8]*> [#uses=4]
	   %811 = icmp ne i8 %810, 33 

@PL_utf8skip = constant [256 x i8] c"\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\03\03\03\03\03\03\03\03\03\03\03\03\03\03\03\03\04\04\04\04\04\04\04\04\05\05\05\05\06\06\07\0D", align 32 ; <[256 x i8]*> [#uses=94]
	   %12 = icmp ult i8 %10, 2
           
etc.

llvm-svn: 92426
2010-01-02 21:50:18 +00:00
..
ABCD.cpp Fix DenseMap iterator constness. 2009-11-10 01:02:17 +00:00
ADCE.cpp
BasicBlockPlacement.cpp
CMakeLists.txt remove the now dead condprop pass, PR3906. 2009-11-11 05:56:35 +00:00
CodeGenPrepare.cpp Revert 91280-91283, 91286-91289, 91291, 91293, 91295-91296. It apparently introduced a non-deterministic behavior in the optimizer somewhere. 2009-12-17 09:39:49 +00:00
ConstantProp.cpp remove a bunch of extraneous LLVMContext arguments 2009-11-06 04:27:31 +00:00
DCE.cpp
DeadStoreElimination.cpp formatting cleanups. 2009-12-02 06:35:55 +00:00
GEPSplitter.cpp Check in the experimental GEP splitter pass. This pass splits complex 2009-10-26 19:12:14 +00:00
GVN.cpp split code that doesn't need to be templated out of IRBuilder into a new 2009-12-28 21:28:46 +00:00
IndVarSimplify.cpp Add Loop contains utility methods for testing whether a loop 2009-12-18 01:24:09 +00:00
InstructionCombining.cpp Teach the table lookup optimization to generate range compares 2010-01-02 21:50:18 +00:00
JumpThreading.cpp Metadata.h doesn't need to include ValueHandle.h anymore. 2009-12-28 08:20:46 +00:00
LICM.cpp Add Loop contains utility methods for testing whether a loop 2009-12-18 01:24:09 +00:00
LoopDeletion.cpp LoopDeletion depends on loops having dedicated exits. 2009-11-05 21:47:04 +00:00
LoopIndexSplit.cpp Add Loop contains utility methods for testing whether a loop 2009-12-18 01:24:09 +00:00
LoopRotation.cpp Update various Loop optimization passes to cope with the possibility that 2009-11-05 21:11:53 +00:00
LoopStrengthReduce.cpp Remove dump routine and the associated Debug.h from a header. Patch up 2009-12-23 22:58:38 +00:00
LoopUnrollPass.cpp Replace LoopUnrollPass.cpp's custom code-size estimation code using 2009-10-31 14:54:17 +00:00
LoopUnswitch.cpp Add Loop contains utility methods for testing whether a loop 2009-12-18 01:24:09 +00:00
Makefile
MemCpyOptimizer.cpp
Reassociate.cpp theoretically the negate we find could be in a different function, check 2010-01-02 21:46:33 +00:00
Reg2Mem.cpp
Scalar.cpp remove the now dead condprop pass, PR3906. 2009-11-11 05:56:35 +00:00
ScalarReplAggregates.cpp Fix the Convert to scalar to not insert dead loads in the store case. The 2009-12-22 19:33:28 +00:00
SCCP.cpp Fix a use of an invalidated iterator in the case where there are multiple 2009-11-23 16:13:39 +00:00
SCCVN.cpp Eliminte unnecessary uses of <cstdio>. 2009-12-18 03:25:51 +00:00
SimplifyCFGPass.cpp Implement PR5795 by merging duplicated return blocks. This could go further 2009-12-22 06:07:30 +00:00
SimplifyHalfPowrLibCalls.cpp improve portability to avoid conflicting with std::next in c++'0x. 2009-12-03 00:50:42 +00:00
SimplifyLibCalls.cpp move an optimization for memcmp out of simplifylibcalls and into 2009-12-24 00:37:38 +00:00
TailDuplication.cpp remove a bunch of extraneous LLVMContext arguments 2009-11-06 04:27:31 +00:00
TailRecursionElimination.cpp Improve tail call elimination to handle the switch statement. 2009-11-07 21:10:15 +00:00