Commit Graph

38435 Commits

Author SHA1 Message Date
Dan Gohman
8f0ad582e8 Teach DAGCombine to convert (sext x) to (zext x) when the
sign-bit of x is known to be zero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50357 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 16:58:24 +00:00
Mikhail Glushenkov
beb4d8293d Add support for response files to the CommandLine library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50355 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 16:44:25 +00:00
Anton Korobeynikov
2810d675f8 Fix FP return for Win64 ABI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50342 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 07:40:07 +00:00
Chris Lattner
6833b0601b Another collection of random cleanups. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50341 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 07:16:35 +00:00
Chris Lattner
b606dba13b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50340 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 06:44:42 +00:00
Chris Lattner
e49e52d856 restore the copy ctor in SmallVector. This fixes serious
errors I introduced in my last patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50338 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 06:32:08 +00:00
Chris Lattner
8eaff0449c switch RegsForValue::Regs to be a SmallVector to avoid
heap thrash on tiny (usually single-element) vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50335 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 06:02:19 +00:00
Chris Lattner
5da0b73aa1 generalize SmallVector copy ctor, there is no requirement for
the initialization vector to have the same fixed size, just the
same element type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50334 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 06:01:06 +00:00
Chris Lattner
ffba5821ee Fix PR2256, yet another miscompilation in simplifycfg of i
multiple return values.

Bill, please pull this into Tak.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50332 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 00:19:07 +00:00
Chris Lattner
e78109eb3a several multiple-retval fixes for bugpoint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50331 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 00:04:58 +00:00
Chris Lattner
f899fce0c0 move static function out of anon namespace, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50330 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-27 23:48:12 +00:00
Chris Lattner
acf8b01fd6 Another step to getting multiple result inline asm to work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50329 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-27 23:44:28 +00:00
Chris Lattner
96bb622646 Allow asms to return multiple results by value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50328 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-27 23:33:55 +00:00
Anton Korobeynikov
998a5bcc80 Properly lower vararg's FORMAL_ARGUMENTS node on win64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50325 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-27 23:15:03 +00:00
Anton Korobeynikov
7255193b4f Handle fp80 for win64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50324 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-27 22:54:09 +00:00
Bill Wendling
908865d90f 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!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50319 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-27 09:44:10 +00:00
Chris Lattner
24e1a9d311 typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50316 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-27 01:49:46 +00:00
Chris Lattner
5a09690446 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50315 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-27 00:37:18 +00:00
Chris Lattner
507ffd2423 isa+cast -> dyn_cast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50314 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-27 00:16:18 +00:00
Chris Lattner
4376fea663 Move a bunch of inline asm code out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50313 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-27 00:09:47 +00:00
Chris Lattner
5e764233f3 A few inline asm cleanups:
- Make targetlowering.h fit in 80 cols.
  - Make LowerAsmOperandForConstraint const.
  - Make lowerXConstraint -> LowerXConstraint
  - Make LowerXConstraint return a const char* instead of taking a string byref.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50312 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-26 23:02:14 +00:00
Chris Lattner
2ba1c06d48 no need to implement this method and just have it call
the default impl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50311 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-26 22:59:59 +00:00
Chris Lattner
998182b380 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50308 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-26 07:40:11 +00:00
Nate Begeman
aea6a6f717 Feedback from chris
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50305 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 21:47:35 +00:00
Nate Begeman
d35f8ef175 Add a testcase for the recent "handle variable vector insert elt in mem" patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50303 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 21:26:59 +00:00
Dale Johannesen
da30ccbe9a change comments per review
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50300 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 21:16:07 +00:00
Evan Cheng
b3f346fa36 Update tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50293 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 20:13:47 +00:00
Evan Cheng
44c0fd17e1 Extract the lower 64-bit if a MMX value is passed in a XMM register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50292 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 20:13:28 +00:00
Evan Cheng
082948df9b Fix illegal MMX_MOVDQ2Qrr pattern. vector_extract result must be a scalar value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50291 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 20:12:46 +00:00
Evan Cheng
10e864276b Special handling for MMX values being passed in either GPR64 or lower 64-bits of XMM registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50289 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 19:11:04 +00:00
Dan Gohman
23ce502cb7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50279 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 18:27:55 +00:00
Evan Cheng
80f5404e18 Fix MMX_MOVQ2DQrr pattern. It's illegal to do a bitconvert from a smaller type to a larger one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50278 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 18:19:54 +00:00
Chris Lattner
3f8a3e71c7 new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50274 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 18:11:06 +00:00
Nate Begeman
6867991d54 Pull the code to perform an INSERT_VECTOR_ELT in memory out into its own
function, and then use it to fix a bug in SplitVectorOp that expected inserts
to always have constant insertion indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50273 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 18:07:40 +00:00
Anton Korobeynikov
f380fbdd57 Update test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50272 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 17:54:21 +00:00
Nate Begeman
4182db4327 Feedback from chris
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50271 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 17:45:52 +00:00
Chris Lattner
7c400dcb03 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50267 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 17:25:00 +00:00
Evan Cheng
682f81032f 80 col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50266 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 17:21:40 +00:00
Nick Lewycky
280a6e607d Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989
r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50265 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 16:53:59 +00:00
Evan Cheng
419ace9bda Not checking for intrinsics which do not have a chain operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50260 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 08:55:28 +00:00
Evan Cheng
cdda25d22b - Switch from std::set to SmallPtrSet.
- Add comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50259 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 08:22:20 +00:00
Evan Cheng
ee472b1081 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50257 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 07:56:45 +00:00
Nate Begeman
4be30ac0e2 Teach the PruningFunctionCloner how to look through loads with
ConstantExpression GEPs pointing into constant globals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50256 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 06:37:06 +00:00
Chris Lattner
25453ea49e 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50252 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 05:13:01 +00:00
Chris Lattner
eede65ce6c 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50251 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 04:12:29 +00:00
Gordon Henriksen
877ee973e2 PR2245: Misleading parameter name in llvm-c/Core.h:LLVMConstArray
Applying fix by Frits van Bommel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50250 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 03:21:19 +00:00
Gordon Henriksen
2566388bc4 PR2202: LLVMCreateInterpreter creates a JIT
Applying fix by Frits van Bommel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50249 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 02:52:30 +00:00
Evan Cheng
2749c72f30 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50239 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 00:26:43 +00:00
Ted Kremenek
13f7a40508 Implement != for DenseSet iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50236 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24 23:49:45 +00:00
Ted Kremenek
ea33c8fed6 Added iterator support for DenseSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50235 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24 23:48:12 +00:00