diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-02 09:35:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-02 09:35:17 +0000 |
commit | bef37376be2880690445a41e5b2d73c084bd3957 (patch) | |
tree | ad480257fb3ff503895b68648430c16ed140fabb /lib/Transforms/Hello/Hello.cpp | |
parent | 33a1ec76c246e3aeed5e61d80399d23e5fd6d57a (diff) |
Generalize the previous xform to handle cases where exactly
two elements match or don't match with two comparisons. For
example, the testcase compiles into:
define i1 @test5(i32 %X) {
%1 = icmp eq i32 %X, 2 ; <i1> [#uses=1]
%2 = icmp eq i32 %X, 7 ; <i1> [#uses=1]
%R = or i1 %1, %2 ; <i1> [#uses=1]
ret i1 %R
}
This generalizes the previous xforms when the array is larger than
64 elements (and this case matches) and generates better code for
cases where it overlaps with the magic bitshift case.
This generalizes more cases than you might expect. For example,
400.perlbmk has:
@PL_utf8skip = constant [256 x i8] c"\01\01\01\...
%15 = icmp ult i8 %7, 7
403.gcc has:
@rid_to_yy = internal constant [114 x i16] [i16 259, i16 260, ...
%18 = icmp eq i16 %16, 295
and xalancbmk has a bunch of examples, such as
_ZN11xercesc_2_5L15gCombiningCharsE and _ZN11xercesc_2_5L10gBaseCharsE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92417 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Hello/Hello.cpp')
0 files changed, 0 insertions, 0 deletions