Reid Spencer
dc130ca32f
Add Scott's note about GCC 4.1.2 on OpenSUSE.
...
llvm-svn: 35924
2007-04-11 21:28:31 +00:00
Reid Spencer
12ee385ec2
Add a test case for PR1318.
...
llvm-svn: 35923
2007-04-11 21:14:53 +00:00
Reid Spencer
2afe5c8354
Build Hello by default so it can be used in test cases.
...
llvm-svn: 35922
2007-04-11 21:03:37 +00:00
Reid Spencer
ba51ef894b
Use the new %link variable to make this test portable.
...
llvm-svn: 35921
2007-04-11 21:00:00 +00:00
Reid Spencer
6650bbc30b
Make new variables available: compile_c, compile_cxx, link to handle tests
...
that want to use LLVM's notion of compiling and linking programs. This
includes all the -I -L and optimization switches that LLVM would using to
compile or link any of this files.
llvm-svn: 35920
2007-04-11 20:57:39 +00:00
Reid Spencer
5059815af5
The "implementation" keyword is no more!
...
llvm-svn: 35919
2007-04-11 20:06:03 +00:00
Reid Spencer
56b310ae49
Make the llvm-runtest function much more amenable by eliminating all the
...
global variables that needed to be passed in. This makes it possible to
add new global variables with only a couple changes (Makefile and llvm-dg.exp)
instead of touching every single dg.exp file.
llvm-svn: 35918
2007-04-11 19:56:59 +00:00
Reid Spencer
13dc8cea51
Add a test case for testing basic IR features via llvm2cpp. This helps find
...
bit rot in llvm2cpp and also tests the LLVM C++ IR in ways that llvm-as
doesn't.
llvm-svn: 35917
2007-04-11 19:54:37 +00:00
Reid Spencer
c202a9ae85
Make sure upgrade doesn't fail on this.
...
llvm-svn: 35916
2007-04-11 19:36:27 +00:00
Reid Spencer
50f96f2a23
Update the way llvm2cpp tests are done:
...
1. Make sure bytecode/assembly inputs are always redirected stdin so that
the module name is <stdin>. This helps not get false negatives when the
diff is done.
2. Scan the test file to determine if llvm-upgrade needs to be run.
3. Avoid running testings that are XFAIL'd because they'll cause a failure
when run for llvm2cpp.
4. Get some better error message output.
llvm-svn: 35914
2007-04-11 17:56:23 +00:00
Reid Spencer
db91083d5a
Upgrade this file completely instead of downgrading it. Make sure that
...
false positives aren't made.
llvm-svn: 35913
2007-04-11 17:51:03 +00:00
Chris Lattner
f29ad16397
fix an infinite loop compiling ldecod, notice by JeffC.
...
llvm-svn: 35910
2007-04-11 16:51:53 +00:00
Chris Lattner
e9a9a3f172
Fix incorrect fall-throughs in addr mode code. This fixes CodeGen/ARM/arm-negative-stride.ll
...
llvm-svn: 35909
2007-04-11 16:17:12 +00:00
Chris Lattner
e557a69c34
this got better
...
llvm-svn: 35908
2007-04-11 16:12:27 +00:00
Chris Lattner
ec844dd102
adjust test
...
llvm-svn: 35907
2007-04-11 16:04:04 +00:00
Chris Lattner
f7451ea3c2
Fix Transforms/ScalarRepl/union-pointer.ll
...
llvm-svn: 35906
2007-04-11 15:45:25 +00:00
Chris Lattner
32f6730bb1
Fix PR1318 by reacting appropriately to a mutating option list.
...
llvm-svn: 35905
2007-04-11 15:35:18 +00:00
Chris Lattner
0bf024fb83
change test name.
...
llvm-svn: 35904
2007-04-11 15:24:04 +00:00
Reid Spencer
bd2afc8391
Fix a bug where ICmpInst objects instantiated directly with a name would
...
not retain that name. Not noticed because AsmParser always sets name after
construction. However, llvm2cpp noticed.
llvm-svn: 35903
2007-04-11 13:04:48 +00:00
Reid Spencer
a9cb0e6602
Make the generated code for ConstantInt nicer.
...
llvm-svn: 35902
2007-04-11 13:02:56 +00:00
Reid Spencer
9b497be3c4
Fix an approximate calculation in an assertion not to give false negatives.
...
llvm-svn: 35901
2007-04-11 13:00:04 +00:00
Reid Spencer
9569890d38
Make sure this test uses llvm-upgrade.
...
Don't allow false positives.
llvm-svn: 35900
2007-04-11 12:46:06 +00:00
Reid Spencer
02fa4016d8
Teach llvm2cpp about packed structure types.
...
llvm-svn: 35899
2007-04-11 12:41:49 +00:00
Reid Spencer
2d8e57357e
Fix several bugs relating to changes in the LLVM IR API or just outright
...
typos in the output. This is sufficient to get most of the llvm2cpp tests
working again.
llvm-svn: 35898
2007-04-11 12:28:56 +00:00
Reid Spencer
db5c4ad62d
Regenerate.
...
llvm-svn: 35897
2007-04-11 12:10:58 +00:00
Reid Spencer
06deba6151
Fix a crash-by-unknown-exception caused by attempting to use a null pointer
...
as the key for a map insertion.
llvm-svn: 35896
2007-04-11 12:10:08 +00:00
Reid Spencer
44bc3843a6
Fix to not give false positives.
...
llvm-svn: 35895
2007-04-11 12:04:33 +00:00
Reid Spencer
43a624d516
Fix some issues with param attrs.
...
llvm-svn: 35894
2007-04-11 10:01:32 +00:00
Reid Spencer
356c181e74
Add support for parameter attributes.
...
llvm-svn: 35893
2007-04-11 09:54:08 +00:00
Chris Lattner
0a1e870a6b
sext of compares.
...
llvm-svn: 35892
2007-04-11 06:57:54 +00:00
Chris Lattner
27a80589de
Turn stuff like:
...
icmp slt i32 %X, 0 ; <i1>:0 [#uses=1]
sext i1 %0 to i32 ; <i32>:1 [#uses=1]
into:
%X.lobit = ashr i32 %X, 31 ; <i32> [#uses=1]
This implements InstCombine/icmp.ll:test[34]
llvm-svn: 35891
2007-04-11 06:57:46 +00:00
Chris Lattner
b659c04f13
Simplify some comparisons to arithmetic, this implements:
...
Transforms/InstCombine/icmp.ll
llvm-svn: 35890
2007-04-11 06:53:04 +00:00
Chris Lattner
3ea6010b67
new testcase
...
llvm-svn: 35889
2007-04-11 06:52:24 +00:00
Chris Lattner
1d20292190
Fix this harder.
...
llvm-svn: 35888
2007-04-11 06:50:51 +00:00
Chris Lattner
01ebc25b36
don't create shifts by zero, fix some problems with my previous patch
...
llvm-svn: 35887
2007-04-11 06:43:25 +00:00
Chris Lattner
50a7c8f34e
canonicalize (x <u 2147483648) -> (x >s -1) and (x >u 2147483647) -> (x <s 0)
...
llvm-svn: 35886
2007-04-11 06:12:58 +00:00
Chris Lattner
cbd4a7e79c
fix a miscompilation of:
...
define i32 @test(i32 %X) {
entry:
%Y = and i32 %X, 4 ; <i32> [#uses=1]
icmp eq i32 %Y, 0 ; <i1>:0 [#uses=1]
sext i1 %0 to i32 ; <i32>:1 [#uses=1]
ret i32 %1
}
by moving code out of commonIntCastTransforms into visitZExt. Simplify the
APInt gymnastics in it etc.
llvm-svn: 35885
2007-04-11 05:45:39 +00:00
Chris Lattner
b7448f6187
done
...
llvm-svn: 35884
2007-04-11 05:34:00 +00:00
Chris Lattner
0289490285
Teach the codegen to turn [aez]ext (setcc) -> selectcc of 1/0, which often
...
allows other simplifications. For example, this compiles:
int isnegative(unsigned int X) {
return !(X < 2147483648U);
}
Into this code:
x86:
movl 4(%esp), %eax
shrl $31, %eax
ret
arm:
mov r0, r0, lsr #31
bx lr
thumb:
lsr r0, r0, #31
bx lr
instead of:
x86:
cmpl $0, 4(%esp)
sets %al
movzbl %al, %eax
ret
arm:
mov r3, #0
cmp r0, #0
movlt r3, #1
mov r0, r3
bx lr
thumb:
mov r2, #1
mov r1, #0
cmp r0, #0
blt LBB1_2 @entry
LBB1_1: @entry
cpy r2, r1
LBB1_2: @entry
cpy r0, r2
bx lr
Testcase here: test/CodeGen/Generic/ispositive.ll
llvm-svn: 35883
2007-04-11 05:32:27 +00:00
Chris Lattner
787c0a4e5b
new testcase
...
llvm-svn: 35882
2007-04-11 05:32:13 +00:00
Chris Lattner
3f0e49403c
Codegen integer abs more efficiently using the trick from the PPC CWG. This
...
improves codegen on many architectures. Tests committed as CodeGen/*/iabs.ll
X86 Old: X86 New:
_test: _test:
movl 4(%esp), %ecx movl 4(%esp), %eax
movl %ecx, %eax movl %eax, %ecx
negl %eax sarl $31, %ecx
testl %ecx, %ecx addl %ecx, %eax
cmovns %ecx, %eax xorl %ecx, %eax
ret ret
PPC Old: PPC New:
_test: _test:
cmpwi cr0, r3, -1 srawi r2, r3, 31
neg r2, r3 add r3, r3, r2
bgt cr0, LBB1_2 ; xor r3, r3, r2
LBB1_1: ; blr
mr r3, r2
LBB1_2: ;
blr
ARM Old: ARM New:
_test: _test:
rsb r3, r0, #0 add r3, r0, r0, asr #31
cmp r0, #0 eor r0, r3, r0, asr #31
movge r3, r0 bx lr
mov r0, r3
bx lr
Thumb Old: Thumb New:
_test: _test:
neg r2, r0 asr r2, r0, #31
cmp r0, #0 add r0, r0, r2
bge LBB1_2 eor r0, r2
LBB1_1: @ bx lr
cpy r0, r2
LBB1_2: @
bx lr
Sparc Old: Sparc New:
test: test:
save -96, %o6, %o6 save -96, %o6, %o6
sethi 0, %l0 sra %i0, 31, %l0
sub %l0, %i0, %l0 add %i0, %l0, %l1
subcc %i0, -1, %l1 xor %l1, %l0, %i0
bg .BB1_2 restore %g0, %g0, %g0
nop retl
.BB1_1: nop
or %g0, %l0, %i0
.BB1_2:
restore %g0, %g0, %g0
retl
nop
It also helps alpha/ia64 :)
llvm-svn: 35881
2007-04-11 05:11:38 +00:00
Chris Lattner
e827f7dfe6
new testcases for integer abs function
...
llvm-svn: 35880
2007-04-11 05:02:57 +00:00
Chris Lattner
c7c7a4712e
fix a regression introduced by my last patch.
...
llvm-svn: 35879
2007-04-11 03:27:24 +00:00
Chris Lattner
2e1f36a4dc
Hack to get sys::Path to recognize macho dylibs.
...
llvm-svn: 35878
2007-04-11 03:15:35 +00:00
Reid Spencer
2792e203c5
For PR1146:
...
Put the parameter attributes in their own ParamAttr name space. Adjust the
rest of llvm as a result.
llvm-svn: 35877
2007-04-11 02:44:20 +00:00
Reid Spencer
caf5a6cbd7
Teach sys::Path how to recognize different kinds of object files for ELF
...
and Mach-O systems. Additionally, correct the Mach-O logic code to look at
byte 12 not byte 15. Hopefully this fixes the llvm-ld warning on Darwin.
llvm-svn: 35876
2007-04-11 02:02:09 +00:00
Chris Lattner
4ea7a156ba
Simplify SROA conversion to integer in some ways, make it more general in others.
...
We now tolerate small amounts of undefined behavior, better emulating what
would happen if the transaction actually occurred in memory. This fixes
SingleSource/UnitTests/2007-04-10-BitfieldTest.c on PPC, at least until
Devang gets a chance to fix the CFE from doing undefined things with bitfields :)
llvm-svn: 35875
2007-04-11 00:57:54 +00:00
Reid Spencer
e580735108
Make isDynamicLibrary detect more than just an ELF file.
...
llvm-svn: 35874
2007-04-11 00:49:39 +00:00
Reid Spencer
a422b454ae
Hack the shared library extension for dylib. The existing code just looks
...
plain wrong since $module was never defined so we always get .so which is
broken on Darwin. Just force it to .dylib.
llvm-svn: 35873
2007-04-11 00:33:43 +00:00
Reid Spencer
903e69badf
Hopefully fix LTDL_SHLIB_EXT on Darwin
...
llvm-svn: 35872
2007-04-11 00:27:39 +00:00