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

22865 Commits

Author SHA1 Message Date
Chris Lattner
42aa4f9620 isa+cast -> dyn_cast
llvm-svn: 50314
2008-04-27 00:16:18 +00:00
Chris Lattner
b83aaaa855 Move a bunch of inline asm code out of line.
llvm-svn: 50313
2008-04-27 00:09:47 +00:00
Chris Lattner
b5bd654163 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.

llvm-svn: 50312
2008-04-26 23:02:14 +00:00
Chris Lattner
1c98ff80c0 no need to implement this method and just have it call
the default impl.

llvm-svn: 50311
2008-04-26 22:59:59 +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
Dale Johannesen
cfba8d51b8 change comments per review
llvm-svn: 50300
2008-04-25 21:16:07 +00:00
Evan Cheng
318e7e042c Extract the lower 64-bit if a MMX value is passed in a XMM register.
llvm-svn: 50292
2008-04-25 20:13:28 +00:00
Evan Cheng
eaaec15b4f Fix illegal MMX_MOVDQ2Qrr pattern. vector_extract result must be a scalar value.
llvm-svn: 50291
2008-04-25 20:12:46 +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
Evan Cheng
0fe99f024d Fix MMX_MOVQ2DQrr pattern. It's illegal to do a bitconvert from a smaller type to a larger one.
llvm-svn: 50278
2008-04-25 18:19:54 +00:00
Nate Begeman
f4adf0f05f 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.

llvm-svn: 50273
2008-04-25 18:07:40 +00:00
Nate Begeman
928566cbfe Feedback from chris
llvm-svn: 50271
2008-04-25 17:45:52 +00:00
Chris Lattner
81742d7a8f add a note
llvm-svn: 50267
2008-04-25 17:25:00 +00:00
Evan Cheng
bbbe14502f 80 col violation.
llvm-svn: 50266
2008-04-25 17:21:40 +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
37ca5de3b7 Not checking for intrinsics which do not have a chain operand.
llvm-svn: 50260
2008-04-25 08:55:28 +00:00
Evan Cheng
e177dc6696 - Switch from std::set to SmallPtrSet.
- Add comments.

llvm-svn: 50259
2008-04-25 08:22:20 +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
Nate Begeman
26b6f640a1 Teach the PruningFunctionCloner how to look through loads with
ConstantExpression GEPs pointing into constant globals.

llvm-svn: 50256
2008-04-25 06:37:06 +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
Gordon Henriksen
c440737166 PR2202: LLVMCreateInterpreter creates a JIT
Applying fix by Frits van Bommel.

llvm-svn: 50249
2008-04-25 02:52:30 +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
c532dca878 Adjust inline cost computation to be less aggressive.
llvm-svn: 50222
2008-04-24 18:42:47 +00:00
Evan Cheng
1a97cb159e - Check if a register is livein before removing it. It may have already been removed.
- Do not iterate over SmallPtrSet, the order of iteration is not deterministic.

llvm-svn: 50209
2008-04-24 09:06:33 +00:00
Chris Lattner
a646a59205 code restructuring, not functionality change.
llvm-svn: 50203
2008-04-24 00:21:50 +00:00
Chris Lattner
10ffed0ed0 Don't replace multiple result of calls with undef,
sccp tracks getresult values, not call values in this
case.

llvm-svn: 50202
2008-04-24 00:19:54 +00:00
Chris Lattner
8c6e641cf4 code cleanup, no functionality change.
llvm-svn: 50201
2008-04-24 00:16:28 +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
Dan Gohman
6054efc488 Make these variables static.
llvm-svn: 50196
2008-04-23 23:15:23 +00:00
Anton Korobeynikov
ac6f6045bb Drop dead includes
llvm-svn: 50192
2008-04-23 22:44:03 +00:00
Anton Korobeynikov
361e5f9eee Adjust option names for C++ backend
llvm-svn: 50190
2008-04-23 22:37:03 +00:00
Anton Korobeynikov
193b7db7c7 First step of implementing PR1538: move llvm2cpp logic to new 'target'
llvm-svn: 50189
2008-04-23 22:29:24 +00:00
Dan Gohman
5df2f2c2e7 Initial CBE support for multiple return values.
llvm-svn: 50187
2008-04-23 21:49:29 +00:00
Chris Lattner
50069efc7a tighten up verifier checks which missed cases where
return instrs operands didn't match up with function results.

llvm-svn: 50182
2008-04-23 20:33:41 +00:00
Dan Gohman
37f4dc9ab4 Use isa instead of dyn_cast.
llvm-svn: 50181
2008-04-23 20:25:16 +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
Devang Patel
88251a96f1 Check type instead of no. of operands.
llvm-svn: 50179
2008-04-23 20:18:29 +00:00
Dan Gohman
6de65a742d Allow llvm-as to parse a getresult with an undef operand.
llvm-svn: 50175
2008-04-23 20:11:27 +00:00
Dale Johannesen
d70ea13581 Rewrite previous patch to suit Chris's preference.
llvm-svn: 50174
2008-04-23 18:34:37 +00:00
Anton Korobeynikov
74178d02d1 Unbreak JIT
llvm-svn: 50173
2008-04-23 18:26:03 +00:00
Anton Korobeynikov
4b572e0f73 Fix typo
llvm-svn: 50169
2008-04-23 18:24:25 +00:00
Anton Korobeynikov
372e69e652 Only allow increase of max alignment value
llvm-svn: 50168
2008-04-23 18:23:50 +00:00
Anton Korobeynikov
47a8e6d7a9 Be over-conservative: scan for all used virtual registers and calculate maximal stack alignment in assumption, that there will be spill of vector register.
llvm-svn: 50167
2008-04-23 18:23:30 +00:00
Anton Korobeynikov
e7754f758b Add X86 Maximal Stack Alignment Calculator Pass before RA
llvm-svn: 50166
2008-04-23 18:23:05 +00:00
Anton Korobeynikov
b1ad6979dc Add facility for pre-RA passes
llvm-svn: 50165
2008-04-23 18:22:28 +00:00
Anton Korobeynikov
5e735f1fd2 Use precomputed value, if any
llvm-svn: 50164
2008-04-23 18:21:50 +00:00
Anton Korobeynikov
158f614c67 Do proper book-keeping of offsets and prologue/epilogue code for stack realignment
llvm-svn: 50163
2008-04-23 18:21:27 +00:00
Anton Korobeynikov
1f07315f47 If stack realignment is used - incoming args will use EBP as base register and locals - ESP
llvm-svn: 50162
2008-04-23 18:21:02 +00:00
Anton Korobeynikov
5079553b9d Eastimate required stack alignment early, so we can decide, whether we will need frame pointer or not
llvm-svn: 50161
2008-04-23 18:20:17 +00:00
Anton Korobeynikov
197eca0b2d Cleanup
llvm-svn: 50160
2008-04-23 18:19:47 +00:00
Anton Korobeynikov
492641d67f Cleanup
llvm-svn: 50159
2008-04-23 18:19:23 +00:00
Anton Korobeynikov
87325bfdf5 Simplify
llvm-svn: 50158
2008-04-23 18:18:36 +00:00
Anton Korobeynikov
73935826d4 Make stack alignment options global for all targets
llvm-svn: 50157
2008-04-23 18:18:10 +00:00
Anton Korobeynikov
6a59c959ca Provide option for enabling-disabling stack realignment
llvm-svn: 50156
2008-04-23 18:17:11 +00:00
Anton Korobeynikov
fc59ae78e0 Disable stack realignment for functions with dynamic-sized alloca's
llvm-svn: 50155
2008-04-23 18:16:43 +00:00
Anton Korobeynikov
11851230a9 Provide ABI-correct stack alignment
llvm-svn: 50154
2008-04-23 18:16:16 +00:00
Anton Korobeynikov
7e6850d1a1 Provide convenient helpers for some operations
llvm-svn: 50153
2008-04-23 18:15:48 +00:00
Anton Korobeynikov
71adb49389 Whitespace cleanup
llvm-svn: 50152
2008-04-23 18:15:11 +00:00
Chris Lattner
bc79442313 simplify code for propagation of constant arguments into
callees.

llvm-svn: 50142
2008-04-23 06:16:27 +00:00
Chris Lattner
408b51d214 Fix a number of bugs in ipconstantprop, simplify the code, fit in 80 cols,
fix read after free bug (PR2238).

llvm-svn: 50141
2008-04-23 05:59:23 +00:00
Chris Lattner
721ea7ca10 Rewrite multiple return value handling in SCCP. Before, the -sccp pass
would turn every getresult instruction into undef.  This helps with
rdar://5778210

llvm-svn: 50140
2008-04-23 05:38:20 +00:00
Chris Lattner
b11a2cca2d regenerate
llvm-svn: 50139
2008-04-23 05:37:08 +00:00
Chris Lattner
b343e5cf8b Validate that the result of a function type is valid using shared
logic with vmcore.

llvm-svn: 50138
2008-04-23 05:36:58 +00:00
Chris Lattner
39e4b2e5d2 Enforce that multiple return values have to have at least one result.
llvm-svn: 50137
2008-04-23 05:36:34 +00:00
Chris Lattner
bc7ea01b8a Verify that the operand of a getresult instruction is a
call/invoke or undef.

llvm-svn: 50129
2008-04-23 04:06:15 +00:00
Dale Johannesen
3007fc4e1b Do not change the type of a ByVal argument to a
type of a different size.

llvm-svn: 50121
2008-04-23 01:03:05 +00:00
Evan Cheng
680839e258 Don't do: "(X & 4) >> 1 == 2 --> (X & 4) == 4" if there are more than one uses of the shift result.
llvm-svn: 50118
2008-04-23 00:38:06 +00:00
Chris Lattner
e304ae5621 Start doing the significantly useful part of jump threading: handle cases
where a comparison has a phi input and that phi is a constant.  For example,
stuff like:

  Threading edge through bool from 'bb2149' to 'bb2231' with cost: 1, across block:
bb2237:		; preds = %bb2231, %bb2149
	%tmp2328.rle = phi i32 [ %tmp2232, %bb2231 ], [ %tmp2232439, %bb2149 ]		; <i32> [#uses=2]
	%done.0 = phi i32 [ %done.2, %bb2231 ], [ 0, %bb2149 ]		; <i32> [#uses=1]
	%tmp2239 = icmp eq i32 %done.0, 0		; <i1> [#uses=1]
	br i1 %tmp2239, label %bb2231, label %bb2327

or

bb38.i298:		; preds = %bb33.i295, %bb1693
	%tmp39.i296.rle = phi %struct.ibox* [ null, %bb1693 ], [ %tmp39.i296.rle1109, %bb33.i295 ]		; <%struct.ibox*> [#uses=2]
	%minspan.1.i291.reg2mem.1 = phi i32 [ 32000, %bb1693 ], [ %minspan.0.i288, %bb33.i295 ]		; <i32> [#uses=1]
	%tmp40.i297 = icmp eq %struct.ibox* %tmp39.i296.rle, null		; <i1> [#uses=1]
	br i1 %tmp40.i297, label %implfeeds.exit311, label %bb43.i301

This triggers thousands of times in spec.

llvm-svn: 50110
2008-04-22 21:40:39 +00:00
Chris Lattner
c59cf9c8da Dig through multiple levels of AND to thread jumps if needed.
llvm-svn: 50106
2008-04-22 20:46:09 +00:00
Chris Lattner
dcbc6443ae Teach jump threading to thread through blocks like:
br (and X, phi(Y, Z, false)), label L1, label L2

This triggers once on 252.eon and 6 times on 176.gcc.  Blocks 
in question often look like this:

bb262:		; preds = %bb261, %bb248
	%iftmp.251.0 = phi i1 [ true, %bb261 ], [ false, %bb248 ]		; <i1> [#uses=4]
	%tmp270 = icmp eq %struct.rtx_def* %tmp.0.i, null		; <i1> [#uses=1]
	%bothcond = or i1 %iftmp.251.0, %tmp270		; <i1> [#uses=1]
	br i1 %bothcond, label %bb288, label %bb273

In this case, it is clear that it doesn't matter if tmp.0.i is null when coming from bb261.  When coming from bb248, it is all that matters.


Another random example:

check_asm_operands.exit:		; preds = %check_asm_operands.exit.thr_comm, %bb30.i, %bb12.i, %bb6.i413
	%tmp.0.i420 = phi i1 [ true, %bb6.i413 ], [ true, %bb12.i ], [ true, %bb30.i ], [ false, %check_asm_operands.exit.thr_comm ; <i1> [#uses=1]
	call void @llvm.stackrestore( i8* %savedstack ) nounwind 
	%tmp4389 = icmp eq i32 %added_sets_1.0, 0		; <i1> [#uses=1]
	%tmp4394 = icmp eq i32 %added_sets_2.0, 0		; <i1> [#uses=1]
	%bothcond80 = and i1 %tmp4389, %tmp4394		; <i1> [#uses=1]
	%bothcond81 = and i1 %bothcond80, %tmp.0.i420		; <i1> [#uses=1]
	br i1 %bothcond81, label %bb4398, label %bb4397

Here is the case from 252.eon:

bb290.i.i:		; preds = %bb23.i57.i.i, %bb8.i39.i.i, %bb100.i.i, %bb100.i.i, %bb85.i.i110
	%myEOF.1.i.i = phi i1 [ true, %bb100.i.i ], [ true, %bb100.i.i ], [ true, %bb85.i.i110 ], [ true, %bb8.i39.i.i ], [ false, %bb23.i57.i.i ]		; <i1> [#uses=2]
	%i.4.i.i = phi i32 [ %i.1.i.i, %bb85.i.i110 ], [ %i.0.i.i, %bb100.i.i ], [ %i.0.i.i, %bb100.i.i ], [ %i.3.i.i, %bb8.i39.i.i ], [ %i.3.i.i, %bb23.i57.i.i ]		; <i32> [#uses=3]
	%tmp292.i.i = load i8* %tmp16.i.i100, align 1		; <i8> [#uses=1]
	%tmp293.not.i.i = icmp ne i8 %tmp292.i.i, 0		; <i1> [#uses=1]
	%bothcond.i.i = and i1 %tmp293.not.i.i, %myEOF.1.i.i		; <i1> [#uses=1]
	br i1 %bothcond.i.i, label %bb202.i.i, label %bb301.i.i
  Factoring out 3 common predecessors.

On the path from any blocks other than bb23.i57.i.i, the load and compare 
are dead.

llvm-svn: 50096
2008-04-22 07:05:46 +00:00
Chris Lattner
003d69adef refactor some code, no functionality change.
llvm-svn: 50094
2008-04-22 06:36:15 +00:00
Chris Lattner
8837037473 remove dead code.
llvm-svn: 50080
2008-04-22 03:21:48 +00:00
Chris Lattner
14be19cf1e optimize "p != gep p, ..." better. This allows us to compile
getelementptr-seteq.ll into:

define i1 @test(i64 %X, %S* %P) {
	%C = icmp eq i64 %X, -1		; <i1> [#uses=1]
	ret i1 %C
}

instead of:

define i1 @test(i64 %X, %S* %P) {
	%A.idx.mask = and i64 %X, 4611686018427387903		; <i64> [#uses=1]
	%C = icmp eq i64 %A.idx.mask, 4611686018427387903		; <i1> [#uses=1]
	ret i1 %C
}

And fixes the second half of PR2235.  This speeds up the insertion sort
case by 45%, from 1.12s to 0.77s.  In practice, this will significantly
speed up for loops structured like:

for (double *P = Base + N; P != Base; --P)
  ...

Which happens frequently for C++ iterators.

llvm-svn: 50079
2008-04-22 02:53:33 +00:00
Chris Lattner
188b560336 more fallout from Nicholas' asmprinter patch.
llvm-svn: 50078
2008-04-22 02:45:44 +00:00
Dan Gohman
93b5be1824 Implement an x86-64 ABI detail of passing structs by hidden first
argument. The x86-64 ABI requires the incoming value of %rdi to
be copied to %rax on exit from a function that is returning a
large C struct.

Also, add a README-X86-64 entry detailing the missed optimization
opportunity and proposing an alternative approach.

llvm-svn: 50075
2008-04-21 23:59:07 +00:00
Dan Gohman
b4db3f46ac Fix an out-of-bounds access in -view-sunit-dags in the case of an
empty ScheduleDAG.

llvm-svn: 50054
2008-04-21 20:07:30 +00:00
Dan Gohman
105b523786 Fix the encoding of the MMX movd that moves from MMX to 64-bit GPR.
llvm-svn: 50053
2008-04-21 19:52:29 +00:00
Dan Gohman
8f3ee5a54d Fix the way AliasSet::print prints "may alias".
llvm-svn: 50051
2008-04-21 19:48:48 +00:00
Chris Lattner
6e88cf849b fix grammar-o, thanks to Duncan for noticing.
llvm-svn: 50047
2008-04-21 18:25:01 +00:00
Owen Anderson
b171c54227 Remove unneeded #include's.
llvm-svn: 50035
2008-04-21 07:47:38 +00:00
Owen Anderson
bc6046416f Refactor memcpyopt based on Chris' suggestions. Consolidate several functions
and simplify code that was fallout from the separation of memcpyopt and gvn.

llvm-svn: 50034
2008-04-21 07:45:10 +00:00
Duncan Sands
79654e36ce Fix a "large integer implicitly truncated to unsigned type"
warning.

llvm-svn: 50033
2008-04-21 07:35:28 +00:00
Chris Lattner
7925af6adf don't print dominators every time it is computed with -debug.
llvm-svn: 50032
2008-04-21 06:19:02 +00:00
Chris Lattner
c077c2a4ea another bug introduced in r47802 by nicholas, for no apparent reason.
llvm-svn: 50031
2008-04-21 06:12:55 +00:00
Chris Lattner
3117d33f74 Add an ugly note.
llvm-svn: 50029
2008-04-21 04:46:30 +00:00
Chris Lattner
26468c09af fix a bug introduced by Nicholas' "unwinds to" stuff: we
lost newlines between blocks.

llvm-svn: 50024
2008-04-21 04:20:33 +00:00
Chris Lattner
ca82082080 don't assume that the argument passed to fprintf("%s" is a string. This
fixes a crash in opt on 433.milc.

llvm-svn: 50023
2008-04-21 03:18:33 +00:00
Chris Lattner
9a21fbcf81 Use the new SplitBlockPredecessors to implement a todo.
llvm-svn: 50022
2008-04-21 02:57:57 +00:00
Chris Lattner
57e11a167d Move SplitBlockPredecessors out of loopsimplify into BasicBlockUtils.h
as a global helper function.  At the same type, switch it from taking
a vector of predecessors to an arbitrary sequential input.  This allows
us to switch LoopSimplify to use a SmallVector for various temporary
vectors that it passed into SplitBlockPredecessors.

llvm-svn: 50020
2008-04-21 01:28:02 +00:00
Chris Lattner
ba4567c335 Move domtree/frontier updating earlier, allowing us to use it to update phi
nodes, removing a hack.

llvm-svn: 50019
2008-04-21 01:05:08 +00:00
Chris Lattner
53fa4554be Factor dominator tree and frontier updating into SplitBlockPredecessors
instead of doing it after every call.

llvm-svn: 50018
2008-04-21 00:54:38 +00:00
Chris Lattner
34894abd7f fit some more code in 80 cols.
llvm-svn: 50016
2008-04-21 00:25:49 +00:00
Chris Lattner
7da61d5766 simplify code, fit in 80 cols.
llvm-svn: 50015
2008-04-21 00:23:14 +00:00
Chris Lattner
45b3ace5a3 fit in 80 cols
llvm-svn: 50014
2008-04-21 00:19:16 +00:00
Nicolas Geoffray
aaa764cf3a Be pessimistic in computing the buffer size when aligning.
llvm-svn: 50008
2008-04-20 23:39:44 +00:00
Nicolas Geoffray
036fb2bebf Don't forget to update the current operand when getting the size of an instruction.
llvm-svn: 50007
2008-04-20 23:36:47 +00:00
Chris Lattner
56fbe56c25 finish the first cut of a jump threading pass implementation.
llvm-svn: 50006
2008-04-20 22:39:42 +00:00
Chris Lattner
4037996a0c replace a slow and verbose version of Instruction::isUsedOutsideOfBlock with
a call to Instruction::isUsedOutsideOfBlock.

llvm-svn: 50005
2008-04-20 22:18:22 +00:00
Chris Lattner
368e2b28bf add a handy helper method to instruction, useful for determining
whether it is used outside of some block.  This can be used to see
if there are any non-local references, for example.

llvm-svn: 50004
2008-04-20 22:11:30 +00:00
Chris Lattner
c714a8cee8 we can only thread blocks when there is a pred we can determine the succ of.
llvm-svn: 50003
2008-04-20 21:18:09 +00:00
Chris Lattner
4fcfb808fb improve comments, infrastructure, and add some validity checks for threading.
Add a cost function.

llvm-svn: 50002
2008-04-20 21:13:06 +00:00
Chris Lattner
c8c74f39db Add a new Jump Threading pass, which will handle cases
such as those in PR2235.  Right now the pass is not very
effective. :)

llvm-svn: 50000
2008-04-20 20:35:01 +00:00
Chris Lattner
75df16a5b0 hopefully resolve PR2240
llvm-svn: 49999
2008-04-20 19:59:12 +00:00
Chris Lattner
2bed045e5e rearrange some code, simplify handling of shifts.
llvm-svn: 49995
2008-04-20 18:24:14 +00:00
Dale Johannesen
15969b664d Check we aren't trying to convert PPC long double.
This fixes the testsuite failure on ppcf128-4.ll.

llvm-svn: 49994
2008-04-20 18:23:46 +00:00
Nicolas Geoffray
c80229e1c7 Cosmetic changes, as suggested by Evan. No functionality changes.
llvm-svn: 49993
2008-04-20 17:44:19 +00:00
Dale Johannesen
3453a89a31 (re)fix handling of UGT. Pointed out by Nick Lewycky.
llvm-svn: 49991
2008-04-20 16:58:57 +00:00
Torok Edwin
e038c595c1 g++-4.3 build-fix: CHAR_BIT requires <climits>.
llvm-svn: 49989
2008-04-20 08:33:11 +00:00
Nicolas Geoffray
5fdce98ebd Do not hold the JIT lock when materializing a function and verify if the
function has already been codegen'd. This is required by the Java class loading
mechanism which executes Java code when materializing a function.

llvm-svn: 49988
2008-04-20 08:33:02 +00:00
Chris Lattner
2c5b96fbee A better fix for my previous patch, MOVZQI2PQIrr just requires SSE2.
llvm-svn: 49986
2008-04-20 05:52:46 +00:00
Dale Johannesen
675fca3ee1 Check that APFloat::convert is not trying to target
ppc long double, which doesn't work.

This may break some stuff temporarily, but I want to
avoid the propagation of code that assumes this works.

llvm-svn: 49983
2008-04-20 01:34:03 +00:00
Chris Lattner
33e206ef89 regenerate
llvm-svn: 49978
2008-04-20 00:41:19 +00:00
Chris Lattner
f390d62b7f Switch to using Simplified ConstantFP::get API.
llvm-svn: 49977
2008-04-20 00:41:09 +00:00
Chris Lattner
0cda383725 Use simplified ConstantFP::get method, fix a bug handling frem x, 0 with long doubles.
llvm-svn: 49976
2008-04-20 00:26:06 +00:00
Chris Lattner
8cde1e71f0 Implement PR2206.
llvm-svn: 49967
2008-04-19 22:17:26 +00:00
Chris Lattner
1303e72c66 refactor handling of symbolic constant folding, picking up
a few new cases( see Integer/a1.ll), but not anything that
would happen in practice.

llvm-svn: 49965
2008-04-19 21:58:19 +00:00
Chris Lattner
57bd4076b5 indentation fix.
llvm-svn: 49964
2008-04-19 21:13:00 +00:00
Chris Lattner
d299f7b8cf Allow argpromote to promote struct arguments with a specified number
of elements.  Patch by Matthijs Kooijman!

llvm-svn: 49962
2008-04-19 19:50:01 +00:00
Evan Cheng
f583b3feb6 64-bit atomic operations.
llvm-svn: 49949
2008-04-19 02:30:38 +00:00
Evan Cheng
1c54ebbe2f Also LXCHG64 -> XCHG64rm.
llvm-svn: 49948
2008-04-19 02:05:42 +00:00
Evan Cheng
09e77f6b83 PPC32 atomic operations.
llvm-svn: 49947
2008-04-19 01:30:48 +00:00
Evan Cheng
b1d240f973 xchg which references a memory operand does not need to lock prefix. Atomicity is guaranteed.
llvm-svn: 49946
2008-04-19 01:20:30 +00:00
Dan Gohman
ac2fac937c Teach llvm-as to accept function types with multiple return types.
llvm-svn: 49945
2008-04-19 00:24:39 +00:00
Dale Johannesen
c1b7e0b477 Fix a scalar evolution bug. Reversing everything
does not work because of 0; 2>0 but -2U is also >0.

llvm-svn: 49928
2008-04-18 21:38:31 +00:00
Nicolas Geoffray
f005e6fa3b Enable jitting with a known memory size.
llvm-svn: 49924
2008-04-18 20:59:31 +00:00
Duncan Sands
26b54dda58 Implement a bit more softfloat support in
LegalizeTypes.  Correct the load logic so
that it actually works, and also teach it
to handle floating point extending loads.

llvm-svn: 49923
2008-04-18 20:56:03 +00:00
Dan Gohman
98ca33cb59 Fix the handling of va_copy on x86-64. As of llvm-gcc r49920
llvm-gcc is now lowering va_copy on x86-64, so this completes
the fix for PR2230.

llvm-svn: 49922
2008-04-18 20:55:41 +00:00
Evan Cheng
a626e13995 - Fix atomic operation JIT encoding.
- Remove unused instructions.

llvm-svn: 49921
2008-04-18 20:55:36 +00:00
Duncan Sands
c21336d6b8 Add some more FIXME's for indexed loads and stores.
llvm-svn: 49916
2008-04-18 20:27:12 +00:00
Duncan Sands
88d2a8459b Provide an explicit list of operands to MakeLibcall,
rather than having it suck them out of a node.  Add
a bunch of new libcalls, and remove dead softfloat
code (dead, because FloatToInt is used not Expand
in this case).  Note that indexed stores probably
aren't handled properly, likewise for loads.

llvm-svn: 49915
2008-04-18 20:25:14 +00:00
Evan Cheng
c215f9f091 Correct comment.
llvm-svn: 49913
2008-04-18 19:25:26 +00:00
Evan Cheng
b23895db40 Not safe to "kill" a register if its live range extends pass the end of block branch.
llvm-svn: 49911
2008-04-18 19:22:23 +00:00
Evan Cheng
2b03674feb Also support Intel asm syntax.
llvm-svn: 49878
2008-04-17 23:35:10 +00:00
Dan Gohman
cfdb39da9c Remove the implicit conversion from SDOperandPtr to SDOperand*; this
may fix a build error on Visual Studio.

llvm-svn: 49876
2008-04-17 23:02:12 +00:00
Evan Cheng
0b36ca5023 Fix assembly code for atomic operations.
llvm-svn: 49869
2008-04-17 21:26:35 +00:00
Evan Cheng
073659986f Be more careful with insert_subreg and extract_subreg where either source or destination operand has already been coalesced with another register that's defined by a insert_subreg or extract_subreg.
llvm-svn: 49843
2008-04-17 07:58:04 +00:00
Owen Anderson
cd1b9c4b43 Make GVN able to remove unnecessary calls to read-only functions again.
llvm-svn: 49842
2008-04-17 05:36:50 +00:00
Bill Wendling
98aab12b63 Use correct name for method in comment.
llvm-svn: 49841
2008-04-17 05:20:39 +00:00
Dan Gohman
c4bea57bb4 Correct the SrcValue information in the Expand code for va_copy.
llvm-svn: 49839
2008-04-17 02:09:26 +00:00
Scott Michel
31b3639a2d Remove unused variable
llvm-svn: 49838
2008-04-17 01:30:44 +00:00
Evan Cheng
7c2c3333ca Fix a sub-register indice propagation bug.
llvm-svn: 49832
2008-04-17 00:06:42 +00:00
Scott Michel
4b37c88f48 Workaround for PR2207, in which pred_iterator assert gets triggered due to a
wee problem in Xcode 2.[45]/gcc 4.0.1.

llvm-svn: 49831
2008-04-16 23:46:39 +00:00
Evan Cheng
e2e899b5c2 Don't forget about sub-register indices when rematting instructions.
llvm-svn: 49830
2008-04-16 23:44:44 +00:00
Dale Johannesen
d19ab27ee1 Unbreak build on x86-64.
llvm-svn: 49822
2008-04-16 22:24:33 +00:00
Nicolas Geoffray
1f3211af01 Correlate stubs with functions in JIT: when emitting a stub, the JIT tells the memory manager which function
the stub will resolve.

llvm-svn: 49814
2008-04-16 20:46:05 +00:00
Evan Cheng
44a0a0c8ee After reading memory that's already freed.
llvm-svn: 49810
2008-04-16 20:24:25 +00:00
Nicolas Geoffray
82baa2d2c6 Infrastructure for getting the machine code size of a function and an instruction. X86, PowerPC and ARM are implemented
llvm-svn: 49809
2008-04-16 20:10:13 +00:00
Evan Cheng
341bed7210 Initialize X863DNowLevel.
llvm-svn: 49808
2008-04-16 19:03:02 +00:00