1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
Commit Graph

38606 Commits

Author SHA1 Message Date
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
Roman Levenstein
35f24acb46 Use std::set instead of std::priority_queue for the RegReductionPriorityQueue.
This removes the existing bottleneck related to the removal of elements from 
the middle of the queue.

Also fixes a subtle bug in ScheduleDAGRRList::CapturePred:
It was updating the state of the SUnit before removing it. As a result, the
comparison operators were working incorrectly and this SUnit could not be removed 
from the queue properly.

Reviewed by Evan and Dan. Approved by Dan.

llvm-svn: 50412
2008-04-29 09:07:59 +00:00
Chris Lattner
5e47b186a7 Implement more aggressive support for analyzing string length. This
generalizes the previous code to handle the case when the string is not
an immediate to the strlen call (for example, crazy stuff like 
strlen(c ? "foo" : "bart"+1) -> 3).  This implements 
gcc.c-torture/execute/builtins/strlen-2.c.  I will generalize other
cases in simplifylibcalls to use the same routine later.

llvm-svn: 50408
2008-04-29 06:56:02 +00:00
Owen Anderson
dc1c838b4d Clarify what we mean by a dead loop.
llvm-svn: 50406
2008-04-29 06:34:55 +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
Owen Anderson
45b160745b Add some more comments.
llvm-svn: 50384
2008-04-29 00:45:15 +00:00
Owen Anderson
e0f9e8446b Remove debugging code.
llvm-svn: 50383
2008-04-29 00:39:24 +00:00
Owen Anderson
4cc52fd657 Add dead loop elimination, which removes dead loops for which we can compute
the trip count.

llvm-svn: 50382
2008-04-29 00:38:34 +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
Evan Cheng
a2e4ffcd8a Fix a bug in RegsForValue::getCopyToRegs() that causes cyclical scheduling units. If it's creating multiple CopyToReg nodes that are "flagged" together, it should not create a TokenFactor for it's chain outputs:
c1, f1 = CopyToReg                                                                                                                                                                                             
c2, f2 = CopyToReg                                                                                                                                                                                             
c3     = TokenFactor c1, c2                                                                                                                                                                                    
 ...                                                                                                                                                                                                                      
       = user c3, ..., f2

Now that the two CopyToReg's and the user are "flagged" together. They effectively forms a single scheduling unit. The TokenFactor is now both an operand and a successor of the Flagged nodes.

llvm-svn: 50376
2008-04-28 22:07:13 +00:00
Anton Korobeynikov
a2edd9607f Correct parameter attributes encoding for C bindings.
Patch by Anders Johnsen!

llvm-svn: 50375
2008-04-28 21:48:04 +00:00
Anton Korobeynikov
ce2ed94866 Add possibility of using arbitrary to to execute stuff from bugpoint.
Patch by Pekka Jääskeläinen!

llvm-svn: 50373
2008-04-28 20:53:48 +00:00
Dan Gohman
e921f90c15 Fix a pointer-arithmetic bug that caused 64-bit host pointer values to
be truncated to 32 bits. This fixes the recent Benchmarks/McCat/09-vor
regression on x86-64, among other things.

llvm-svn: 50372
2008-04-28 20:25:15 +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
Dale Johannesen
08671c6cac Don't try to convert PPC long double.
llvm-svn: 50369
2008-04-28 19:46:58 +00:00
Dan Gohman
6df962bf9a Evan pointed out that folding sext to zext may not be correct
if the zext is not legal.

llvm-svn: 50368
2008-04-28 18:47:17 +00:00
Dan Gohman
d67d878df0 Delete an unused constructor.
llvm-svn: 50367
2008-04-28 18:28:49 +00:00
Dan Gohman
733bb3e992 Add a comment to CreateRegForValue that clarifies the handling of
aggregate types.

llvm-svn: 50366
2008-04-28 18:19:43 +00:00
Dan Gohman
2f0476499c Rewrite the comments for RegsForValue and its members, and
reorder some of the members for clarity.

llvm-svn: 50365
2008-04-28 18:10:39 +00:00
Ted Kremenek
fd04109260 Add more alignment enums.
llvm-svn: 50363
2008-04-28 17:58:20 +00:00
Ted Kremenek
f1304a3762 Bug fix in BumpPtrAllocator: don't assume that all objects have the same alignment. "Bump" of the pointer for the next allocated object to be of the specified alignment.
llvm-svn: 50362
2008-04-28 17:58:07 +00:00
Dan Gohman
5d36cd74b0 Don't call size() on each iteration of the loop.
llvm-svn: 50361
2008-04-28 17:42:03 +00:00
Gordon Henriksen
0b2f0d3007 Expose parameter attributes via C bindings.
Patch by Anders Johnsen!

llvm-svn: 50360
2008-04-28 17:37:06 +00:00
Dan Gohman
0285c1e9bb Fix the SVOffset values for loads and stores produced by
memcpy/memset expansion. It was a bug for the SVOffset value
to be used in the actual address calculations.

llvm-svn: 50359
2008-04-28 17:15:20 +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
Dan Gohman
389a3ff9c7 Teach DAGCombine to convert (sext x) to (zext x) when the
sign-bit of x is known to be zero.

llvm-svn: 50357
2008-04-28 16:58:24 +00:00
Mikhail Glushenkov
4c358b3125 Add support for response files to the CommandLine library.
llvm-svn: 50355
2008-04-28 16:44:25 +00:00
Anton Korobeynikov
54791c2a43 Fix FP return for Win64 ABI
llvm-svn: 50342
2008-04-28 07:40:07 +00:00
Chris Lattner
c83326d89f Another collection of random cleanups. No functionality change.
llvm-svn: 50341
2008-04-28 07:16:35 +00:00
Chris Lattner
27fa922841 Remove the SmallVector ctor that converts from a SmallVectorImpl. This
conversion open the door for many nasty implicit conversion issues, and
can be easily solved by initializing with (V.begin(), V.end()) when 
needed.

This patch includes many small cleanups for sdisel also.

llvm-svn: 50340
2008-04-28 06:44:42 +00:00
Chris Lattner
89339f3a90 restore the copy ctor in SmallVector. This fixes serious
errors I introduced in my last patch.

llvm-svn: 50338
2008-04-28 06:32:08 +00:00
Chris Lattner
d6315b68f2 switch RegsForValue::Regs to be a SmallVector to avoid
heap thrash on tiny (usually single-element) vectors.

llvm-svn: 50335
2008-04-28 06:02:19 +00:00
Chris Lattner
a03159bc35 generalize SmallVector copy ctor, there is no requirement for
the initialization vector to have the same fixed size, just the
same element type.

llvm-svn: 50334
2008-04-28 06:01:06 +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
0378973e09 several multiple-retval fixes for bugpoint.
llvm-svn: 50331
2008-04-28 00:04:58 +00:00
Chris Lattner
459f6ed05c move static function out of anon namespace, no functionality change.
llvm-svn: 50330
2008-04-27 23:48:12 +00:00
Chris Lattner
113de6b3a8 Another step to getting multiple result inline asm to work.
llvm-svn: 50329
2008-04-27 23:44:28 +00:00
Chris Lattner
bef7aa1d4b Allow asms to return multiple results by value.
llvm-svn: 50328
2008-04-27 23:33:55 +00:00
Anton Korobeynikov
1c5d228377 Properly lower vararg's FORMAL_ARGUMENTS node on win64
llvm-svn: 50325
2008-04-27 23:15:03 +00:00
Anton Korobeynikov
0df1f3bc6c Handle fp80 for win64
llvm-svn: 50324
2008-04-27 22:54:09 +00:00
Bill Wendling
2e2dab8423 Added support for:
- defm and multiclass
- imbricatable multiline C style comment
- FIXME/TODO highlight in comment
- binary and hexadecimal number
- code using [{ }] is no highlighted as special (perhaps not the best
choice)
Patch by Cedric Venet!

llvm-svn: 50319
2008-04-27 09:44:10 +00:00
Chris Lattner
0cd8c478f7 typo
llvm-svn: 50316
2008-04-27 01:49:46 +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