Dan Gohman
cd29e1fa60
When bit-twiddling CondCode values for integer comparisons produces
...
SETOEQ, is it does with (SETEQ & SETULE), map it to SETEQ.
llvm-svn: 51112
2008-05-14 18:17:09 +00:00
Tanya Lattner
ecd5a9390a
Check if llvm-gcc is available before running tests. Patch by Matthijs Kooijman!
...
llvm-svn: 51108
2008-05-14 16:32:44 +00:00
Duncan Sands
d1ee8534e8
Make this test pass on x86-32 linux.
...
llvm-svn: 51099
2008-05-14 09:46:01 +00:00
Dale Johannesen
676a1d026b
Fix for PR 2323, infinite loop in tail dup.
...
llvm-svn: 51063
2008-05-13 20:06:43 +00:00
Evan Cheng
9e15622879
Instead of a vector load, shuffle and then extract an element. Load the element from address with an offset.
...
pshufd $1, (%rdi), %xmm0
movd %xmm0, %eax
=>
movl 4(%rdi), %eax
llvm-svn: 51026
2008-05-13 08:35:03 +00:00
Owen Anderson
f67c06279b
Add a testcase for non-local CSE of read-only calls.
...
llvm-svn: 51025
2008-05-13 08:17:44 +00:00
Evan Cheng
e4ee4c2870
On x86, it's safe to treat i32 load anyext as a normal i32 load. Ditto for i8 anyext load to i16.
...
llvm-svn: 51019
2008-05-13 00:54:02 +00:00
Evan Cheng
fcbdc8bd6e
Xform bitconvert(build_pair(load a, load b)) to a single load if the load locations are at the right offset from each other.
...
llvm-svn: 51008
2008-05-12 23:04:07 +00:00
Dale Johannesen
b54491d31a
New test for tail merging
...
llvm-svn: 51007
2008-05-12 22:59:44 +00:00
Mikhail Glushenkov
18508c5df4
Filter option names to escape symbols not allowed as C++ identifiers.
...
Makes it possible to use options with names like "Wa,".
Also fixes the -Wall option handling as a side-effect.
llvm-svn: 50973
2008-05-12 16:33:06 +00:00
Duncan Sands
45b1810980
Testcase for PR2264.
...
llvm-svn: 50965
2008-05-12 13:01:19 +00:00
Duncan Sands
15622620d3
Testcase for PR2303.
...
llvm-svn: 50951
2008-05-10 16:43:10 +00:00
Evan Cheng
c19c639ad7
When transforming a vector_shuffle to a load, the base address must not be an undef.
...
llvm-svn: 50940
2008-05-10 06:46:49 +00:00
Evan Cheng
fc4b8e1d96
Add nounwind.
...
llvm-svn: 50931
2008-05-10 02:22:25 +00:00
Evan Cheng
cf4d5567d5
If all sources of a PHI node are defined by an implicit_def, just emit an implicit_def instead of a copy.
...
llvm-svn: 50927
2008-05-10 00:17:50 +00:00
Evan Cheng
2adea48f7e
Add a pattern to do move the low element of a v4f32 and zero extend the rest.
...
llvm-svn: 50922
2008-05-09 23:37:55 +00:00
Evan Cheng
3493e43afd
Handle a few more cases of folding load i64 into xmm and zero top bits.
...
Note, some of the code will be moved into target independent part of DAG combiner in a subsequent patch.
llvm-svn: 50918
2008-05-09 21:53:03 +00:00
Evan Cheng
a0688bf1cb
Simplify test.
...
llvm-svn: 50911
2008-05-09 19:56:32 +00:00
Chris Lattner
02ca137915
Implement PR2298. This transforms:
...
~x < ~y --> y < x
-x == -y --> x == y
llvm-svn: 50882
2008-05-09 05:19:28 +00:00
Evan Cheng
f824b47188
Use movq to move low half of XMM register and zero-extend the rest.
...
llvm-svn: 50874
2008-05-08 22:35:02 +00:00
Chris Lattner
4c1ef3628b
More than just loads can read from memory: readonly calls like strlen
...
also need to be checked for memory modifying instructions before we
can sink them. THis fixes the second half of PR2297.
llvm-svn: 50860
2008-05-08 17:37:37 +00:00
Chris Lattner
cba8b4c7e8
Make instcombine's DSE respect loads as well as stores. It is not safe to
...
delete the first store in:
store x -> p
load p
store y -> p
This is for PR2297.
llvm-svn: 50859
2008-05-08 17:20:30 +00:00
Chris Lattner
9bf499a8b9
new testcase.
...
llvm-svn: 50841
2008-05-08 04:55:51 +00:00
Evan Cheng
f97e716511
Handle vector move / load which zero the destination register top bits (i.e. movd, movq, movss (addr), movsd (addr)) with X86 specific dag combine.
...
llvm-svn: 50838
2008-05-08 00:57:18 +00:00
Evan Cheng
7ff000c175
Add nounwind.
...
llvm-svn: 50837
2008-05-07 22:59:08 +00:00
Evan Cheng
c86c035346
Yet another nasty spiller bug.
...
%ecx = op
store %cl<kill>, (addr)
(addr) = op %al
It's not safe to unfold the last operand and eliminate store even though %cl is marked kill. It's a sub-register use which means one of its super-register(s) may be used below.
llvm-svn: 50794
2008-05-07 00:49:28 +00:00
Dan Gohman
6ea87fa437
Fix a bug in the ComputeMaskedBits logic for multiply.
...
llvm-svn: 50793
2008-05-07 00:35:55 +00:00
Bill Wendling
3cb8ee3c80
Removing.
...
llvm-svn: 50786
2008-05-06 23:56:22 +00:00
Anton Korobeynikov
a9ff11ea5f
Use target triple in tests, not 'realign-stack=0' option. Per request.
...
llvm-svn: 50778
2008-05-06 23:09:29 +00:00
Owen Anderson
2dccdcf2f2
Testcase for r50770.
...
llvm-svn: 50771
2008-05-06 21:01:34 +00:00
Mikhail Glushenkov
5a403195b3
Move test files around a bit - fixes the reported number of test cases.
...
llvm-svn: 50761
2008-05-06 18:16:20 +00:00
Mikhail Glushenkov
3534026221
Use edge weights to choose the right linker based on input language names.
...
llvm-svn: 50759
2008-05-06 18:15:12 +00:00
Mikhail Glushenkov
78aa308f84
Add a --linker command-line option, make all tests pass.
...
llvm-svn: 50755
2008-05-06 18:13:00 +00:00
Mikhail Glushenkov
ffc7ee62c0
Add two (currently failing) tests.
...
llvm-svn: 50752
2008-05-06 18:11:21 +00:00
Mikhail Glushenkov
dc50e8c5fa
Take object file as input and handle files with the same name correctly.
...
llvm-svn: 50749
2008-05-06 18:10:20 +00:00
Mikhail Glushenkov
40b652c238
First small tests for llvmc2.
...
llvm-svn: 50734
2008-05-06 17:24:54 +00:00
Duncan Sands
c96ff82e3e
Testcase for PR2292.
...
llvm-svn: 50718
2008-05-06 14:56:40 +00:00
Evan Cheng
a84ed06284
Fix PR2287. Darwin passes mmx values in register in 64-mode, not Linux.
...
llvm-svn: 50716
2008-05-06 07:23:50 +00:00
Dan Gohman
faf9df7227
Correct the value of LowBits in srem and urem handling in
...
ComputeMaskedBits.
llvm-svn: 50692
2008-05-06 00:51:48 +00:00
Chris Lattner
50d16c2939
Fix a crash when threading a block that includes a MRV call result.
...
DemoteRegToStack doesn't work with MRVs yet, because it relies on the
ability to load/store things.
This fixes PR2285.
llvm-svn: 50667
2008-05-05 20:21:22 +00:00
Mon P Wang
84a269e023
Added addition atomic instrinsics and, or, xor, min, and max.
...
llvm-svn: 50663
2008-05-05 19:05:59 +00:00
Chris Lattner
ca94848f66
no need for eh info
...
llvm-svn: 50658
2008-05-05 18:24:33 +00:00
Dan Gohman
c860d9c77c
Add AsmPrinter support for emitting a directive to declare that
...
the code being generated does not require an executable stack.
Also, add target-specific code to make use of this on Linux
on x86.
llvm-svn: 50634
2008-05-05 00:28:39 +00:00
Owen Anderson
611b415d12
Fix PR1098 by correcting the postdominators analysis.
...
Patch by Florian Brandner.
llvm-svn: 50628
2008-05-04 21:07:35 +00:00
Evan Cheng
a7747df955
Select vector shift with non-immediate i32 shift amount operand by first moving the operand into the right register.
...
llvm-svn: 50619
2008-05-04 09:15:50 +00:00
Evan Cheng
c1c2adbfc6
Add separate intrinsics for MMX / SSE shifts with i32 integer operands. This allow us to simplify the horribly complicated matching code.
...
llvm-svn: 50601
2008-05-03 00:52:09 +00:00
Chris Lattner
5346b6b0a7
verify builtin optimization works like gcc.
...
llvm-svn: 50594
2008-05-02 22:07:34 +00:00
Dan Gohman
27156711ef
Fix a mistake in the computation of leading zeros for udiv.
...
llvm-svn: 50591
2008-05-02 21:30:02 +00:00
Chris Lattner
96467cc665
strength reduce exp2 into ldexp, rdar://5852514
...
llvm-svn: 50586
2008-05-02 18:43:35 +00:00
Chris Lattner
8cc3e89b87
specify an arch for non-x86 hosts.
...
llvm-svn: 50576
2008-05-02 15:11:58 +00:00
Dan Gohman
04e2b94842
Update old-style syntax in some "not grep" tests.
...
llvm-svn: 50560
2008-05-01 23:50:07 +00:00
Dale Johannesen
4ab8b00dfa
New test for bug fixed in 50545.
...
llvm-svn: 50548
2008-05-01 22:50:14 +00:00
Dan Gohman
793c9fed45
Fix an overaggressive SimplifyDemandedBits optimization on urem. This
...
fixes the 254.gap regression on x86 and the 403.gcc regression on x86-64.
llvm-svn: 50537
2008-05-01 19:13:24 +00:00
Bill Wendling
81b5245cec
Adding testcase.
...
llvm-svn: 50536
2008-05-01 18:41:09 +00:00
Chris Lattner
e9bbe8e6b6
don't randomly miscompile seto/setuo just because we are in
...
ffastmath mode. This fixes rdar://5902801, a miscompilation
of gcc.dg/builtins-8.c.
Bill, please pull this into Tak.
llvm-svn: 50523
2008-05-01 07:26:11 +00:00
Chris Lattner
9d73228708
fix typo
...
llvm-svn: 50519
2008-05-01 06:16:48 +00:00
Chris Lattner
9a678d6f55
instcombine does memset optzns.
...
llvm-svn: 50518
2008-05-01 06:16:38 +00:00
Chris Lattner
926efd9174
simplifylibcalls doesn't optimize llvm.memmove, instcombine does.
...
llvm-svn: 50517
2008-05-01 06:14:24 +00:00
Chris Lattner
d4bf588b85
move some tests from libcall optimizer suite.
...
llvm-svn: 50516
2008-05-01 06:13:48 +00:00
Arnold Schwaighofer
29a654857a
Really commit the test checking the argument lowering behaviour on x86-64 :).
...
llvm-svn: 50478
2008-04-30 09:19:47 +00:00
Arnold Schwaighofer
f58a35e2ec
Tail call optimization improvements:
...
Move platform independent code (lowering of possibly overwritten
arguments, check for tail call optimization eligibility) from
target X86ISelectionLowering.cpp to TargetLowering.h and
SelectionDAGISel.cpp.
Initial PowerPC tail call implementation:
Support ppc32 implemented and tested (passes my tests and
test-suite llvm-test).
Support ppc64 implemented and half tested (passes my tests).
On ppc tail call optimization is performed if
caller and callee are fastcc
call is a tail call (in tail call position, call followed by ret)
no variable argument lists or byval arguments
option -tailcallopt is enabled
Supported:
* non pic tail calls on linux/darwin
* module-local tail calls on linux(PIC/GOT)/darwin(PIC)
* inter-module tail calls on darwin(PIC)
If constraints are not met a normal call will be emitted.
A test checking the argument lowering behaviour on x86-64 was added.
llvm-svn: 50477
2008-04-30 09:16:33 +00:00
Owen Anderson
f8c80ca156
Move this test to LoopDeletion, where it now passes.
...
llvm-svn: 50474
2008-04-30 07:17:22 +00:00
Chris Lattner
15195e00ee
move lowering of llvm.memset -> store from simplify libcalls
...
to instcombine.
llvm-svn: 50472
2008-04-30 06:39:11 +00:00
Chris Lattner
ce01263bff
no reason for simplifylibcalls to simplify intrinsics, instcombine does
...
a fine job.
llvm-svn: 50470
2008-04-30 06:12:15 +00:00
Chris Lattner
a62a4d407a
remove redundant check.
...
llvm-svn: 50469
2008-04-30 06:06:37 +00:00
Owen Anderson
2caa79ae70
Fix a bug in memcpyopt where the memcpy-memcpy transform was never being applied because
...
we were checking for it in the wrong order. This caused a miscompilation because the
return slot optimization assumes that the call it is dealing with is NOT a memcpy.
llvm-svn: 50444
2008-04-29 21:26:06 +00:00
Chris Lattner
5bd55b0885
don't eliminate load from volatile value on paths where the load is dead.
...
This fixes the second half of PR2262
llvm-svn: 50430
2008-04-29 17:28:22 +00:00
Chris Lattner
4b5d48a3f0
make this test reduced and *valid*
...
llvm-svn: 50429
2008-04-29 17:25:32 +00:00
Chris Lattner
7099f3c400
fix a subtle volatile handling bug.
...
llvm-svn: 50428
2008-04-29 17:13:43 +00:00
Chris Lattner
b3972afe89
new testcase for PR2094. The inline asms should not pin allocas to the
...
stack anymore.
llvm-svn: 50397
2008-04-29 05:53:29 +00:00
Chris Lattner
51fe8415da
don't delete the last store to an alloca if the store is volatile.
...
llvm-svn: 50390
2008-04-29 04:58:38 +00:00
Chris Lattner
0f63b8fecc
make the vector conversion magic handle multiple results.
...
We now compile test2/test3 to:
_test2:
## InlineAsm Start
set %xmm0, %xmm1
## InlineAsm End
addps %xmm1, %xmm0
ret
_test3:
## InlineAsm Start
set %xmm0, %xmm1
## InlineAsm End
paddd %xmm1, %xmm0
ret
as expected.
llvm-svn: 50389
2008-04-29 04:48:56 +00:00
Chris Lattner
e75d09711d
add support for multiple return values in inline asm. This is a step
...
towards PR2094. It now compiles the attached .ll file to:
_sad16_sse2:
movslq %ecx, %rax
## InlineAsm Start
%ecx %rdx %rax %rax %r8d %rdx %rsi
## InlineAsm End
## InlineAsm Start
set %eax
## InlineAsm End
ret
which is pretty decent for a 3 output, 4 input asm.
llvm-svn: 50386
2008-04-29 04:29:54 +00:00
Evan Cheng
381b094a2b
Another extract_subreg coalescing bug.
...
e.g.
vr1024<2> extract_subreg vr1025, 2
If vr1024 do not have the same register class as vr1025, it's not safe to coalesce this away. For example, vr1024 might be a GPR32 while vr1025 might be a GPR64.
llvm-svn: 50385
2008-04-29 01:41:44 +00:00
Evan Cheng
8696eb18c1
Add -march=x86.
...
llvm-svn: 50380
2008-04-28 23:31:41 +00:00
Dan Gohman
fa033a0fbd
Update and_ops.ll according to the recent dagcombiner changes.
...
Add a new test, and_ops_more.ll, which is XFAIL'd, to
record the parts of and_ops.ll that were affected by this
change.
llvm-svn: 50379
2008-04-28 23:26:22 +00:00
Evan Cheng
3167c716f2
Test case.
...
llvm-svn: 50377
2008-04-28 22:14:34 +00:00
Dan Gohman
9e4db7f0bd
Fix DSE to not eliminate volatile loads with no uses.
...
llvm-svn: 50370
2008-04-28 19:51:27 +00:00
Dan Gohman
1b7238e6e4
Teach InstCombine's ComputeMaskedBits what SelectionDAG's
...
ComputeMaskedBits knows about cttz, ctlz, and ctpop. Teach
SelectionDAG's ComputeMaskedBits what InstCombine's knows
about SRem. And teach them both some things about high bits
in Mul, UDiv, URem, and Sub. This allows instcombine and
dagcombine to eliminate sign-extension operations in
several new cases.
llvm-svn: 50358
2008-04-28 17:02:21 +00:00
Chris Lattner
ede7e89144
Fix PR2256, yet another miscompilation in simplifycfg of i
...
multiple return values.
Bill, please pull this into Tak.
llvm-svn: 50332
2008-04-28 00:19:07 +00:00
Chris Lattner
39a4281deb
Implement a signficant optimization for inline asm:
...
When choosing between constraints with multiple options,
like "ir", test to see if we can use the 'i' constraint and
go with that if possible. This produces more optimal ASM in
all cases (sparing a register and an instruction to load it),
and fixes inline asm like this:
void test () {
asm volatile (" %c0 %1 " : : "imr" (42), "imr"(14));
}
Previously we would dump "42" into a memory location (which
is ok for the 'm' constraint) which would cause a problem
because the 'c' modifier is not valid on memory operands.
Isn't it great how inline asm turns 'missed optimization'
into 'compile failed'??
Incidentally, this was the todo in
PowerPC/2007-04-24-InlineAsm-I-Modifier.ll
Please do NOT pull this into Tak.
llvm-svn: 50315
2008-04-27 00:37:18 +00:00
Chris Lattner
2798e42a9f
When SRoA'ing a global variable, make sure the new globals get the
...
appropriate alignment. This fixes a miscompilation of 252.eon on
x86-64 (rdar://5891920).
Bill, please pull this into Tak.
llvm-svn: 50308
2008-04-26 07:40:11 +00:00
Nate Begeman
1723f6af2b
Feedback from chris
...
llvm-svn: 50305
2008-04-25 21:47:35 +00:00
Nate Begeman
acd7e1c464
Add a testcase for the recent "handle variable vector insert elt in mem" patch
...
llvm-svn: 50303
2008-04-25 21:26:59 +00:00
Evan Cheng
db1497fa77
Update tests.
...
llvm-svn: 50293
2008-04-25 20:13:47 +00:00
Evan Cheng
11f101a800
Special handling for MMX values being passed in either GPR64 or lower 64-bits of XMM registers.
...
llvm-svn: 50289
2008-04-25 19:11:04 +00:00
Dan Gohman
c4b6768db4
Remove the code from CodeGenPrepare that moved getresult instructions
...
to the block that defines their operands. This doesn't work in the
case that the operand is an invoke, because invoke is a terminator
and must be the last instruction in a block.
Replace it with support in SelectionDAGISel for copying struct values
into sequences of virtual registers.
llvm-svn: 50279
2008-04-25 18:27:55 +00:00
Chris Lattner
fb539f4468
new testcase
...
llvm-svn: 50274
2008-04-25 18:11:06 +00:00
Anton Korobeynikov
dad01d86e0
Update test
...
llvm-svn: 50272
2008-04-25 17:54:21 +00:00
Nick Lewycky
1f831c0f57
Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989
...
r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123.
llvm-svn: 50265
2008-04-25 16:53:59 +00:00
Evan Cheng
39ae78cadb
MMX argument passing fixes:
...
On Darwin / Linux x86-32, v8i8, v4i16, v2i32 values are passed in MM[0-2].
On Darwin / Linux x86-32, v1i64 values are passed in memory.
On Darwin x86-64, v8i8, v4i16, v2i32 values are passed in XMM[0-7].
On Darwin x86-64, v1i64 values are passed in 64-bit GPRs.
llvm-svn: 50257
2008-04-25 07:56:45 +00:00
Chris Lattner
8c9f6c929a
Loosen up an assertion to allow intrinsics. I really have no
...
idea what this code (findNonImmUse) does, so I'm only guessing
that this is the right thing. It would be really really nice
if this had comments and perhaps switched to SmallPtrSet
(hint hint) :)
This fixes rdar://5886601, a crash on gcc.target/i386/sse4_1-pblendw.c
llvm-svn: 50252
2008-04-25 05:13:01 +00:00
Chris Lattner
1a6268f776
Don't infininitely thread branches when a threaded edge
...
goes back to the block, e.g.:
Threading edge through bool from 'bb37.us.thread3829' to 'bb37.us' with cost: 1, across block:
bb37.us: ; preds = %bb37.us.thread3829, %bb37.us, %bb33
%D1361.1.us = phi i32 [ %tmp36, %bb33 ], [ %D1361.1.us, %bb37.us ], [ 0, %bb37.us.thread3829 ] ; <i32> [#uses=2]
%tmp39.us = icmp eq i32 %D1361.1.us, 0 ; <i1> [#uses=1]
br i1 %tmp39.us, label %bb37.us, label %bb42.us
llvm-svn: 50251
2008-04-25 04:12:29 +00:00
Evan Cheng
484060ba4a
Fix bug in x86 memcpy / memset lowering. If there are trailing bytes not handled by rep instructions, a new memcpy / memset is introduced for them. However, since source / destination addresses are already adjusted, their offsets should be zero.
...
llvm-svn: 50239
2008-04-25 00:26:43 +00:00
Evan Cheng
906911f9e5
New test.
...
llvm-svn: 50229
2008-04-24 20:01:58 +00:00
Devang Patel
fed5cd5fe7
Add EXTRA_OPTIONS on the llvmgxx command line.
...
llvm-svn: 50217
2008-04-24 17:59:03 +00:00
Devang Patel
7ff3d5b65b
Add EXTRA_OPTIONS on the llvmgcc command line.
...
llvm-svn: 50216
2008-04-24 17:54:25 +00:00
Chris Lattner
be35a0c224
Split some code out of the main SimplifyCFG loop into its own function.
...
Fix said code to handle merging return instructions together correctly
when handling multiple return values.
llvm-svn: 50199
2008-04-24 00:01:19 +00:00
Anton Korobeynikov
d6ec8965f7
Fix tests due to llvm2cpp move to llc target
...
llvm-svn: 50191
2008-04-23 22:41:53 +00:00
Dan Gohman
afa475f207
Add support to codegen for getresult instructions with undef operands.
...
llvm-svn: 50180
2008-04-23 20:21:29 +00:00