Chris Lattner [Sun, 8 May 2005 19:46:29 +0000 (19:46 +0000)]
Wrap long lines. Fix "warning: conflicting types for built-in function 'memset'"
warning from the CBE+GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21779
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 8 May 2005 18:59:37 +0000 (18:59 +0000)]
Improve reassociation handling of inverses, implementing inverses.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21778
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 8 May 2005 18:54:40 +0000 (18:54 +0000)]
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21777
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 8 May 2005 18:45:26 +0000 (18:45 +0000)]
clean up and modernize this pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21776
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 8 May 2005 17:34:56 +0000 (17:34 +0000)]
Strength reduce SAR into SHR if there is no way sign bits could be shifted
in. This tends to get cases like this:
X = cast ubyte to int
Y = shr int X, ...
Tested by: shift.ll:test24
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21775
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 8 May 2005 17:31:24 +0000 (17:31 +0000)]
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21774
91177308-0d34-0410-b5e6-
96231b3b80d8
Jeff Cohen [Sun, 8 May 2005 01:07:48 +0000 (01:07 +0000)]
Update my info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21773
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 8 May 2005 00:19:31 +0000 (00:19 +0000)]
Refactor some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21772
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 8 May 2005 00:08:33 +0000 (00:08 +0000)]
Handle some simple cases where we can see that values get annihilated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21771
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 7 May 2005 23:49:08 +0000 (23:49 +0000)]
Fix a miscompilation of crafty by clobbering the "A" variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21770
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 7 May 2005 22:45:35 +0000 (22:45 +0000)]
Move licm after reassociate, add some cond-propagate passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21769
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 7 May 2005 21:59:39 +0000 (21:59 +0000)]
Rewrite the guts of the reassociate pass to be more efficient and logical. Instead
of trying to do local reassociation tweaks at each level, only process an expression
tree once (at its root). This does not improve the reassociation pass in any real way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21768
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Sat, 7 May 2005 20:21:04 +0000 (20:21 +0000)]
* Break tests into individual cases so its easier to see what's going on.
* Add four new cases to handle the new optimizations for strlen, dealing
with:
strlen(x) != 0 -> *x != 0
strlen(x) == 0 -> *x == 0
for each of two cases: strlen(x) != 0 and strlen(x) == 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21767
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Sat, 7 May 2005 20:15:59 +0000 (20:15 +0000)]
* Add two strlen optimizations:
strlen(x) != 0 -> *x != 0
strlen(x) == 0 -> *x == 0
* Change nested statistics to use style of other LLVM statistics so that
only the name of the optimization (simplify-libcalls) is used as the
statistic name, and the description indicates which specific all is
optimized. Cuts down on some redundancy and saves a few bytes of space.
* Make note of stpcpy optimization that could be done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21766
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Sat, 7 May 2005 04:59:45 +0000 (04:59 +0000)]
Don't increment the counter unless the debug flag is set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21762
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 7 May 2005 04:24:13 +0000 (04:24 +0000)]
Convert shifts to muls to assist reassociation. This implements
Reassociate/shifttest.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21761
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 7 May 2005 04:23:29 +0000 (04:23 +0000)]
test that reassociate can handle shifts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21760
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 7 May 2005 04:08:02 +0000 (04:08 +0000)]
Simplify the code and rearrange it. No major functionality changes here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21759
91177308-0d34-0410-b5e6-
96231b3b80d8
Jeff Cohen [Sat, 7 May 2005 02:44:04 +0000 (02:44 +0000)]
Silence VC++ warnings about unsafe mixing of ints and bools with the | operator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21758
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 7 May 2005 02:21:21 +0000 (02:21 +0000)]
add note about bit builtins newly supported
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21757
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 7 May 2005 02:16:08 +0000 (02:16 +0000)]
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21756
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 7 May 2005 01:46:40 +0000 (01:46 +0000)]
fix bugs in my previous commit clarify the return type of the bit ops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21755
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 23:08:23 +0000 (23:08 +0000)]
add a couple of notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21754
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 22:57:40 +0000 (22:57 +0000)]
document calling convention extensions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21753
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 22:35:09 +0000 (22:35 +0000)]
remove some dead (always dynamically false) flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21752
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 22:34:01 +0000 (22:34 +0000)]
encode calling conventions for call/invoke instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21751
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 22:33:44 +0000 (22:33 +0000)]
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21750
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 20:42:57 +0000 (20:42 +0000)]
encode function calling convs in the bytecode file. invoke and call are
still to come.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21749
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 20:27:19 +0000 (20:27 +0000)]
parse new calling conv specifiers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21748
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 20:27:03 +0000 (20:27 +0000)]
wrap a longline
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21747
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 20:26:43 +0000 (20:26 +0000)]
add support for explicit calling conventions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21746
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 20:26:26 +0000 (20:26 +0000)]
Add support for explicit calling conventions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21745
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 19:59:08 +0000 (19:59 +0000)]
New file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21744
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 19:58:35 +0000 (19:58 +0000)]
use splice instead of remove/insert for a minor speedup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21743
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 19:49:51 +0000 (19:49 +0000)]
remove some ugly hacks that are no longer needed since andrew removed the
varargs munging code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21742
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 17:13:16 +0000 (17:13 +0000)]
BAD typeo which caused many testsuite failures last night. Note to self, do
not change code after testing it without retesting!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21741
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 06:58:42 +0000 (06:58 +0000)]
clean up the CBE output a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21740
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 06:53:07 +0000 (06:53 +0000)]
add tail marker as a comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21739
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 06:48:54 +0000 (06:48 +0000)]
Make the stub functions be tail calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21738
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 06:48:21 +0000 (06:48 +0000)]
Preserve tail marker
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21737
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 06:47:52 +0000 (06:47 +0000)]
Implement Transforms/Inline/inline-tail.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21736
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 06:47:37 +0000 (06:47 +0000)]
Make sure to not accidentally get a bogus tail marker
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21735
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 06:46:58 +0000 (06:46 +0000)]
preserve the tail marker
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21734
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 06:22:10 +0000 (06:22 +0000)]
add a default arg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21733
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 06:21:59 +0000 (06:21 +0000)]
Don't forget these are calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21730
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 06:20:33 +0000 (06:20 +0000)]
lex tail
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21729
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 06:18:33 +0000 (06:18 +0000)]
test that tail call survives bytecodification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21728
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 06:13:34 +0000 (06:13 +0000)]
add bytecode reader support for tail calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21727
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 06:07:34 +0000 (06:07 +0000)]
Hilight tail
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21726
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 05:59:50 +0000 (05:59 +0000)]
These are legal for tail calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21723
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 05:51:46 +0000 (05:51 +0000)]
Add a 'tail' marker for call instructions, patch contributed by
Alexander Friedman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21722
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 05:47:36 +0000 (05:47 +0000)]
Add info on new 'tail' marker
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21721
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 05:34:40 +0000 (05:34 +0000)]
Wrap long lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21720
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 05:27:34 +0000 (05:27 +0000)]
DCE intrinsic instructions without side effects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21719
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 05:21:04 +0000 (05:21 +0000)]
These intrinsics do not access memory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21718
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 04:53:20 +0000 (04:53 +0000)]
Teach instcombine propagate zeroness through shl instructions, implementing
and.ll:test31
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21717
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 04:52:46 +0000 (04:52 +0000)]
new testcases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21716
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 04:18:52 +0000 (04:18 +0000)]
Implement shift.ll:test23. If we are shifting right then immediately truncating
the result, turn signed shift rights into unsigned shift rights if possible.
This leads to later simplification and happens *often* in 176.gcc. For example,
this testcase:
struct xxx { unsigned int code : 8; };
enum codes { A, B, C, D, E, F };
int foo(struct xxx *P) {
if ((enum codes)P->code == A)
bar();
}
used to be compiled to:
int %foo(%struct.xxx* %P) {
%tmp.1 = getelementptr %struct.xxx* %P, int 0, uint 0 ; <uint*> [#uses=1]
%tmp.2 = load uint* %tmp.1 ; <uint> [#uses=1]
%tmp.3 = cast uint %tmp.2 to int ; <int> [#uses=1]
%tmp.4 = shl int %tmp.3, ubyte 24 ; <int> [#uses=1]
%tmp.5 = shr int %tmp.4, ubyte 24 ; <int> [#uses=1]
%tmp.6 = cast int %tmp.5 to sbyte ; <sbyte> [#uses=1]
%tmp.8 = seteq sbyte %tmp.6, 0 ; <bool> [#uses=1]
br bool %tmp.8, label %then, label %UnifiedReturnBlock
Now it is compiled to:
%tmp.1 = getelementptr %struct.xxx* %P, int 0, uint 0 ; <uint*> [#uses=1]
%tmp.2 = load uint* %tmp.1 ; <uint> [#uses=1]
%tmp.2 = cast uint %tmp.2 to sbyte ; <sbyte> [#uses=1]
%tmp.8 = seteq sbyte %tmp.2, 0 ; <bool> [#uses=1]
br bool %tmp.8, label %then, label %UnifiedReturnBlock
which is the difference between this:
foo:
subl $4, %esp
movl 8(%esp), %eax
movl (%eax), %eax
shll $24, %eax
sarl $24, %eax
testb %al, %al
jne .LBBfoo_2
and this:
foo:
subl $4, %esp
movl 8(%esp), %eax
movl (%eax), %eax
testb %al, %al
jne .LBBfoo_2
This occurs 3243 times total in the External tests, 215x in povray,
6x in each f2c'd program, 1451x in 176.gcc, 7x in crafty, 20x in perl,
25x in gap, 3x in m88ksim, 25x in ijpeg.
Maybe this will cause a little jump on gcc tommorow :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21715
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 04:11:32 +0000 (04:11 +0000)]
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21714
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 02:07:39 +0000 (02:07 +0000)]
Implement xor.ll:test22
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21713
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 01:53:19 +0000 (01:53 +0000)]
implement and.ll:test30 and set.ll:test21
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21712
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 01:52:52 +0000 (01:52 +0000)]
new testcase for unneeded and
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21711
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 01:51:05 +0000 (01:51 +0000)]
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21710
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 00:58:50 +0000 (00:58 +0000)]
implement or.ll:test20
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21709
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 6 May 2005 00:58:09 +0000 (00:58 +0000)]
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21708
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Thu, 5 May 2005 23:45:17 +0000 (23:45 +0000)]
* Order #includes alphabetically
* Remove commented-out debug printouts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21707
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Thu, 5 May 2005 23:43:47 +0000 (23:43 +0000)]
Remove extra blank line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21706
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Thu, 5 May 2005 22:38:21 +0000 (22:38 +0000)]
* Use consistent spacing for function arguments
* Output single-character strings as chars
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21705
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Thu, 5 May 2005 22:33:09 +0000 (22:33 +0000)]
Remove vim settings from source code; people should use llvm/utils/vim/vimrc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21704
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Thu, 5 May 2005 22:30:40 +0000 (22:30 +0000)]
Convert tabs to spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21703
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 5 May 2005 22:23:10 +0000 (22:23 +0000)]
new testcase for PR541
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21702
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 5 May 2005 22:21:19 +0000 (22:21 +0000)]
add support for undef values of opaque type, addressing PR541
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21701
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 5 May 2005 20:57:00 +0000 (20:57 +0000)]
Add some extra checks. Opaque types don't have a null marker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21700
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 5 May 2005 17:57:24 +0000 (17:57 +0000)]
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21699
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 5 May 2005 17:55:17 +0000 (17:55 +0000)]
When hitting an unsupported intrinsic, actually print it
Lower debug info to noops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21698
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Thu, 5 May 2005 15:55:21 +0000 (15:55 +0000)]
ctpop lowering in legalize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21697
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 5 May 2005 15:47:43 +0000 (15:47 +0000)]
Fix a bug compimling Ruby, fixing this testcase:
LowerSetJmp/2005-05-05-OldUses.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21696
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 5 May 2005 15:47:16 +0000 (15:47 +0000)]
new testcase for a bug Jim found
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21695
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Wed, 4 May 2005 19:25:37 +0000 (19:25 +0000)]
fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21693
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Wed, 4 May 2005 19:12:09 +0000 (19:12 +0000)]
Well, add support for ct* for 21264 only.
21164 is broken until expand works.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21692
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Wed, 4 May 2005 19:11:05 +0000 (19:11 +0000)]
Make promoteOp work for CT*
Proof?
ubyte %bar(ubyte %x) {
entry:
%tmp.1 = call ubyte %llvm.ctlz( ubyte %x )
ret ubyte %tmp.1
}
==>
zapnot $16,1,$0
CTLZ $0,$0
subq $0,56,$0
zapnot $0,1,$0
ret $31,($26),1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21691
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 4 May 2005 19:10:26 +0000 (19:10 +0000)]
Instcombine: cast (X != 0) to int, cast (X == 1) to int -> X iff X has only the low bit set.
This implements set.ll:test20.
This triggers 2x on povray, 9x on mesa, 11x on gcc, 2x on crafty, 1x on eon,
6x on perlbmk and 11x on m88ksim.
It allows us to compile these two functions into the same code:
struct s { unsigned int bit : 1; };
unsigned foo(struct s *p) {
if (p->bit)
return 1;
else
return 0;
}
unsigned bar(struct s *p) { return p->bit; }
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21690
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 4 May 2005 19:05:02 +0000 (19:05 +0000)]
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21689
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Wed, 4 May 2005 18:58:28 +0000 (18:58 +0000)]
Implement the IsDigitOptimization for simplifying calls to the isdigit
library function:
isdigit(chr) -> 0 or 1 if chr is constant
isdigit(chr) -> chr - '0' <= 9 otherwise
Although there are many calls to isdigit in llvm-test, most of them are
compiled away by macros leaving only this:
2 MultiSource/Applications/hexxagon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21688
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Wed, 4 May 2005 17:45:10 +0000 (17:45 +0000)]
Make sure both optimization cases get tested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21687
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Wed, 4 May 2005 17:34:55 +0000 (17:34 +0000)]
Add a test case for the IsDigitOptimization class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21686
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Wed, 4 May 2005 15:56:34 +0000 (15:56 +0000)]
comment fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21685
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Wed, 4 May 2005 15:51:07 +0000 (15:51 +0000)]
see if the legalize code propery compensates for the additional zeros introduced
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21684
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Wed, 4 May 2005 15:43:40 +0000 (15:43 +0000)]
Correct the descriptions of WHILE...END and RROT. Thanks to Lalo Martins
for pointing out these errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21683
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Wed, 4 May 2005 15:33:48 +0000 (15:33 +0000)]
WHILE does not "pop" a value, it "examines" to top of stack. Make this
clear in the applicable comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21682
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Wed, 4 May 2005 15:20:16 +0000 (15:20 +0000)]
added a use of ctpop to debug stuff with
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21681
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Wed, 4 May 2005 14:58:31 +0000 (14:58 +0000)]
fixup argument
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21680
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Wed, 4 May 2005 03:20:21 +0000 (03:20 +0000)]
* Correct the function prototypes for some of the functions to match the
actual spec (int -> uint)
* Add the ability to get/cache the strlen function prototype.
* Make sure generated values are appropriately named for debugging purposes
* Add the SPrintFOptimiation for 4 casts of sprintf optimization:
sprintf(str,cstr) -> llvm.memcpy(str,cstr) (if cstr has no %)
sprintf(str,"") -> store sbyte 0, str
sprintf(str,"%s",src) -> llvm.memcpy(str,src) (if src is constant)
sprintf(str,"%c",chr) -> store chr, str ; store sbyte 0, str+1
The sprintf optimization didn't fire as much as I had hoped:
2 MultiSource/Applications/SPASS
5 MultiSource/Benchmarks/McCat/18-imp
22 MultiSource/Benchmarks/Prolangs-C/TimberWolfMC
1 MultiSource/Benchmarks/Prolangs-C/assembler
6 MultiSource/Benchmarks/Prolangs-C/unix-smail
2 MultiSource/Benchmarks/mediabench/mpeg2/mpeg2dec
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21679
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Tue, 3 May 2005 20:30:34 +0000 (20:30 +0000)]
Minor clean-ups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21678
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Tue, 3 May 2005 18:01:48 +0000 (18:01 +0000)]
initial descriptions of count intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21677
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Tue, 3 May 2005 17:19:30 +0000 (17:19 +0000)]
Implement count leading zeros (ctlz), count trailing zeros (cttz), and count
population (ctpop). Generic lowering is implemented, however only promotion
is implemented for SelectionDAG at the moment.
More coming soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21676
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 3 May 2005 17:09:38 +0000 (17:09 +0000)]
Fix this test to succeed even if "strchr" is on a call instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21675
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 3 May 2005 17:08:45 +0000 (17:08 +0000)]
Add a test case for SPrintFOptimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21674
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Tue, 3 May 2005 17:00:48 +0000 (17:00 +0000)]
yea yea yea
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21673
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Tue, 3 May 2005 16:59:09 +0000 (16:59 +0000)]
note the vararg change, and other stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21672
91177308-0d34-0410-b5e6-
96231b3b80d8