oota-llvm.git
16 years agosimplify code for propagation of constant arguments into
Chris Lattner [Wed, 23 Apr 2008 06:16:27 +0000 (06:16 +0000)]
simplify code for propagation of constant arguments into
callees.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50142 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a number of bugs in ipconstantprop, simplify the code, fit in 80 cols,
Chris Lattner [Wed, 23 Apr 2008 05:59:23 +0000 (05:59 +0000)]
Fix a number of bugs in ipconstantprop, simplify the code, fit in 80 cols,
fix read after free bug (PR2238).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50141 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRewrite multiple return value handling in SCCP. Before, the -sccp pass
Chris Lattner [Wed, 23 Apr 2008 05:38:20 +0000 (05:38 +0000)]
Rewrite multiple return value handling in SCCP.  Before, the -sccp pass
would turn every getresult instruction into undef.  This helps with
rdar://5778210

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50140 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoregenerate
Chris Lattner [Wed, 23 Apr 2008 05:37:08 +0000 (05:37 +0000)]
regenerate

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50139 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoValidate that the result of a function type is valid using shared
Chris Lattner [Wed, 23 Apr 2008 05:36:58 +0000 (05:36 +0000)]
Validate that the result of a function type is valid using shared
logic with vmcore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50138 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoEnforce that multiple return values have to have at least one result.
Chris Lattner [Wed, 23 Apr 2008 05:36:34 +0000 (05:36 +0000)]
Enforce that multiple return values have to have at least one result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50137 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove this testcase. It isn't testing loop rotate, it is testing all
Chris Lattner [Wed, 23 Apr 2008 05:36:04 +0000 (05:36 +0000)]
remove this testcase.  It isn't testing loop rotate, it is testing all
of -std-compile-opts and is now failing because other passes are generating
IR that looks different to input of loop rotate.  Devang, please
introduce a testcase that only runs loop rotate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50136 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoreturning an empty multiple return list is not valid.
Chris Lattner [Wed, 23 Apr 2008 05:29:14 +0000 (05:29 +0000)]
returning an empty multiple return list is not valid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50135 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofix description of 'ret' to be more correct with multiple return
Chris Lattner [Wed, 23 Apr 2008 04:59:35 +0000 (04:59 +0000)]
fix description of 'ret' to be more correct with multiple return
values.  Clarify that it is impossible to 'multiply return' a
struct with zero elements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50131 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAllow undef as an operand to getresult.
Chris Lattner [Wed, 23 Apr 2008 04:06:52 +0000 (04:06 +0000)]
Allow undef as an operand to getresult.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50130 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoVerify that the operand of a getresult instruction is a
Chris Lattner [Wed, 23 Apr 2008 04:06:15 +0000 (04:06 +0000)]
Verify that the operand of a getresult instruction is a
call/invoke or undef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50129 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agomake this test more interesting.
Chris Lattner [Wed, 23 Apr 2008 03:49:32 +0000 (03:49 +0000)]
make this test more interesting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50128 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agodistill down the essense of this test.
Chris Lattner [Wed, 23 Apr 2008 03:03:42 +0000 (03:03 +0000)]
distill down the essense of this test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50125 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agonew test
Dale Johannesen [Wed, 23 Apr 2008 01:22:22 +0000 (01:22 +0000)]
new test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50123 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDo not change the type of a ByVal argument to a
Dale Johannesen [Wed, 23 Apr 2008 01:03:05 +0000 (01:03 +0000)]
Do not change the type of a ByVal argument to a
type of a different size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50121 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't do: "(X & 4) >> 1 == 2 --> (X & 4) == 4" if there are more than one uses of...
Evan Cheng [Wed, 23 Apr 2008 00:38:06 +0000 (00:38 +0000)]
Don't do: "(X & 4) >> 1 == 2  --> (X & 4) == 4" if there are more than one uses of the shift result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50118 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoStart doing the significantly useful part of jump threading: handle cases
Chris Lattner [Tue, 22 Apr 2008 21:40:39 +0000 (21:40 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50110 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDig through multiple levels of AND to thread jumps if needed.
Chris Lattner [Tue, 22 Apr 2008 20:46:09 +0000 (20:46 +0000)]
Dig through multiple levels of AND to thread jumps if needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50106 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMove MemCpyOpt after GVN.
Owen Anderson [Tue, 22 Apr 2008 07:12:26 +0000 (07:12 +0000)]
Move MemCpyOpt after GVN.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50097 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTeach jump threading to thread through blocks like:
Chris Lattner [Tue, 22 Apr 2008 07:05:46 +0000 (07:05 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50096 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded command line option -no-lazy to disable JIT lazy compilation.
Evan Cheng [Tue, 22 Apr 2008 06:51:41 +0000 (06:51 +0000)]
Added command line option -no-lazy to disable JIT lazy compilation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50095 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agorefactor some code, no functionality change.
Chris Lattner [Tue, 22 Apr 2008 06:36:15 +0000 (06:36 +0000)]
refactor some code, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50094 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoadd a basic testcase.
Chris Lattner [Tue, 22 Apr 2008 06:35:14 +0000 (06:35 +0000)]
add a basic testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50093 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoWhoops! Undo r50087, unbreak the build.
Nick Lewycky [Tue, 22 Apr 2008 05:20:06 +0000 (05:20 +0000)]
Whoops! Undo r50087, unbreak the build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50088 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReverse r47989. Part of removing 'unwinds to' support.
Nick Lewycky [Tue, 22 Apr 2008 05:16:51 +0000 (05:16 +0000)]
Reverse r47989. Part of removing 'unwinds to' support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50087 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoStart removing 'unwinds to' support from mainline in preparation for 2.3.
Nick Lewycky [Tue, 22 Apr 2008 05:16:02 +0000 (05:16 +0000)]
Start removing 'unwinds to' support from mainline in preparation for 2.3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50086 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd MemCpyOpt to LTO.
Owen Anderson [Tue, 22 Apr 2008 03:57:36 +0000 (03:57 +0000)]
Add MemCpyOpt to LTO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50081 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove dead code.
Chris Lattner [Tue, 22 Apr 2008 03:21:48 +0000 (03:21 +0000)]
remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50080 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agooptimize "p != gep p, ..." better. This allows us to compile
Chris Lattner [Tue, 22 Apr 2008 02:53:33 +0000 (02:53 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50079 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agomore fallout from Nicholas' asmprinter patch.
Chris Lattner [Tue, 22 Apr 2008 02:45:44 +0000 (02:45 +0000)]
more fallout from Nicholas' asmprinter patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50078 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImplement an x86-64 ABI detail of passing structs by hidden first
Dan Gohman [Mon, 21 Apr 2008 23:59:07 +0000 (23:59 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50075 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofix some residual old API that fell thru the cracks of the conversion script, closes...
Gabor Greif [Mon, 21 Apr 2008 21:31:55 +0000 (21:31 +0000)]
fix some residual old API that fell thru the cracks of the conversion script, closes llvm.org/bugs/show_bug.cgi?id=2246

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50062 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix an out-of-bounds access in -view-sunit-dags in the case of an
Dan Gohman [Mon, 21 Apr 2008 20:07:30 +0000 (20:07 +0000)]
Fix an out-of-bounds access in -view-sunit-dags in the case of an
empty ScheduleDAG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50054 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix the encoding of the MMX movd that moves from MMX to 64-bit GPR.
Dan Gohman [Mon, 21 Apr 2008 19:52:29 +0000 (19:52 +0000)]
Fix the encoding of the MMX movd that moves from MMX to 64-bit GPR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50053 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix the way AliasSet::print prints "may alias".
Dan Gohman [Mon, 21 Apr 2008 19:48:48 +0000 (19:48 +0000)]
Fix the way AliasSet::print prints "may alias".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50051 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofix grammar-o, thanks to Duncan for noticing.
Chris Lattner [Mon, 21 Apr 2008 18:25:01 +0000 (18:25 +0000)]
fix grammar-o, thanks to Duncan for noticing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50047 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake these structs larger to ensure that they
Duncan Sands [Mon, 21 Apr 2008 08:17:05 +0000 (08:17 +0000)]
Make these structs larger to ensure that they
are returned by struct return.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50038 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake the struct bigger, to ensure it is returned
Duncan Sands [Mon, 21 Apr 2008 08:12:03 +0000 (08:12 +0000)]
Make the struct bigger, to ensure it is returned
by struct return.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50037 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse GVN in LTO instead of GCSE+LoadVN.
Owen Anderson [Mon, 21 Apr 2008 07:51:07 +0000 (07:51 +0000)]
Use GVN in LTO instead of GCSE+LoadVN.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50036 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove unneeded #include's.
Owen Anderson [Mon, 21 Apr 2008 07:47:38 +0000 (07:47 +0000)]
Remove unneeded #include's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50035 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRefactor memcpyopt based on Chris' suggestions. Consolidate several functions
Owen Anderson [Mon, 21 Apr 2008 07:45:10 +0000 (07:45 +0000)]
Refactor memcpyopt based on Chris' suggestions.  Consolidate several functions
and simplify code that was fallout from the separation of memcpyopt and gvn.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50034 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a "large integer implicitly truncated to unsigned type"
Duncan Sands [Mon, 21 Apr 2008 07:35:28 +0000 (07:35 +0000)]
Fix a "large integer implicitly truncated to unsigned type"
warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50033 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agodon't print dominators every time it is computed with -debug.
Chris Lattner [Mon, 21 Apr 2008 06:19:02 +0000 (06:19 +0000)]
don't print dominators every time it is computed with -debug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50032 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoanother bug introduced in r47802 by nicholas, for no apparent reason.
Chris Lattner [Mon, 21 Apr 2008 06:12:55 +0000 (06:12 +0000)]
another bug introduced in r47802 by nicholas, for no apparent reason.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50031 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd an ugly note.
Chris Lattner [Mon, 21 Apr 2008 04:46:30 +0000 (04:46 +0000)]
Add an ugly note.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50029 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd jump threading to liblto.
Chris Lattner [Mon, 21 Apr 2008 04:31:40 +0000 (04:31 +0000)]
Add jump threading to liblto.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50028 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agorun the jump threading pass in llvm-ld also
Chris Lattner [Mon, 21 Apr 2008 04:28:40 +0000 (04:28 +0000)]
run the jump threading pass in llvm-ld also

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50027 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoenable jump threading pass by default. This causes no miscompilations
Chris Lattner [Mon, 21 Apr 2008 04:22:09 +0000 (04:22 +0000)]
enable jump threading pass by default.  This causes no miscompilations
and can significantly shrinkify some code, particularly from C++ land.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50025 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofix a bug introduced by Nicholas' "unwinds to" stuff: we
Chris Lattner [Mon, 21 Apr 2008 04:20:33 +0000 (04:20 +0000)]
fix a bug introduced by Nicholas' "unwinds to" stuff: we
lost newlines between blocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50024 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agodon't assume that the argument passed to fprintf("%s" is a string. This
Chris Lattner [Mon, 21 Apr 2008 03:18:33 +0000 (03:18 +0000)]
don't assume that the argument passed to fprintf("%s"  is a string.  This
fixes a crash in opt on 433.milc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50023 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse the new SplitBlockPredecessors to implement a todo.
Chris Lattner [Mon, 21 Apr 2008 02:57:57 +0000 (02:57 +0000)]
Use the new SplitBlockPredecessors to implement a todo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50022 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMove SplitBlockPredecessors out of loopsimplify into BasicBlockUtils.h
Chris Lattner [Mon, 21 Apr 2008 01:28:02 +0000 (01:28 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50020 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMove domtree/frontier updating earlier, allowing us to use it to update phi
Chris Lattner [Mon, 21 Apr 2008 01:05:08 +0000 (01:05 +0000)]
Move domtree/frontier updating earlier, allowing us to use it to update phi
nodes, removing a hack.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50019 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFactor dominator tree and frontier updating into SplitBlockPredecessors
Chris Lattner [Mon, 21 Apr 2008 00:54:38 +0000 (00:54 +0000)]
Factor dominator tree and frontier updating into SplitBlockPredecessors
instead of doing it after every call.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50018 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofit some more code in 80 cols.
Chris Lattner [Mon, 21 Apr 2008 00:25:49 +0000 (00:25 +0000)]
fit some more code in 80 cols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50016 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agosimplify code, fit in 80 cols.
Chris Lattner [Mon, 21 Apr 2008 00:23:14 +0000 (00:23 +0000)]
simplify code, fit in 80 cols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50015 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofit in 80 cols
Chris Lattner [Mon, 21 Apr 2008 00:19:16 +0000 (00:19 +0000)]
fit in 80 cols

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50014 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoBe pessimistic in computing the buffer size when aligning.
Nicolas Geoffray [Sun, 20 Apr 2008 23:39:44 +0000 (23:39 +0000)]
Be pessimistic in computing the buffer size when aligning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50008 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't forget to update the current operand when getting the size of an instruction.
Nicolas Geoffray [Sun, 20 Apr 2008 23:36:47 +0000 (23:36 +0000)]
Don't forget to update the current operand when getting the size of an instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50007 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofinish the first cut of a jump threading pass implementation.
Chris Lattner [Sun, 20 Apr 2008 22:39:42 +0000 (22:39 +0000)]
finish the first cut of a jump threading pass implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50006 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoreplace a slow and verbose version of Instruction::isUsedOutsideOfBlock with
Chris Lattner [Sun, 20 Apr 2008 22:18:22 +0000 (22:18 +0000)]
replace a slow and verbose version of Instruction::isUsedOutsideOfBlock with
a call to Instruction::isUsedOutsideOfBlock.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50005 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoadd a handy helper method to instruction, useful for determining
Chris Lattner [Sun, 20 Apr 2008 22:11:30 +0000 (22:11 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50004 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agowe can only thread blocks when there is a pred we can determine the succ of.
Chris Lattner [Sun, 20 Apr 2008 21:18:09 +0000 (21:18 +0000)]
we can only thread blocks when there is a pred we can determine the succ of.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50003 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoimprove comments, infrastructure, and add some validity checks for threading.
Chris Lattner [Sun, 20 Apr 2008 21:13:06 +0000 (21:13 +0000)]
improve comments, infrastructure, and add some validity checks for threading.
Add a cost function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50002 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a new Jump Threading pass, which will handle cases
Chris Lattner [Sun, 20 Apr 2008 20:35:01 +0000 (20:35 +0000)]
Add a new Jump Threading pass, which will handle cases
such as those in PR2235.  Right now the pass is not very
effective. :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50000 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agohopefully resolve PR2240
Chris Lattner [Sun, 20 Apr 2008 19:59:12 +0000 (19:59 +0000)]
hopefully resolve PR2240

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49999 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agorearrange some code, simplify handling of shifts.
Chris Lattner [Sun, 20 Apr 2008 18:24:14 +0000 (18:24 +0000)]
rearrange some code, simplify handling of shifts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49995 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCheck we aren't trying to convert PPC long double.
Dale Johannesen [Sun, 20 Apr 2008 18:23:46 +0000 (18:23 +0000)]
Check we aren't trying to convert PPC long double.
This fixes the testsuite failure on ppcf128-4.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49994 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCosmetic changes, as suggested by Evan. No functionality changes.
Nicolas Geoffray [Sun, 20 Apr 2008 17:44:19 +0000 (17:44 +0000)]
Cosmetic changes, as suggested by Evan. No functionality changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49993 91177308-0d34-0410-b5e6-96231b3b80d8

16 years ago(re)fix handling of UGT. Pointed out by Nick Lewycky.
Dale Johannesen [Sun, 20 Apr 2008 16:58:57 +0000 (16:58 +0000)]
(re)fix handling of UGT.  Pointed out by Nick Lewycky.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49991 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agog++-4.3 build-fix: CHAR_BIT requires <climits>.
Torok Edwin [Sun, 20 Apr 2008 08:33:11 +0000 (08:33 +0000)]
g++-4.3 build-fix: CHAR_BIT requires <climits>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49989 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDo not hold the JIT lock when materializing a function and verify if the
Nicolas Geoffray [Sun, 20 Apr 2008 08:33:02 +0000 (08:33 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49988 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoA better fix for my previous patch, MOVZQI2PQIrr just requires SSE2.
Chris Lattner [Sun, 20 Apr 2008 05:52:46 +0000 (05:52 +0000)]
A better fix for my previous patch, MOVZQI2PQIrr just requires SSE2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49986 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoNot all x86-64 machines have sse3 apparently.
Chris Lattner [Sun, 20 Apr 2008 05:47:56 +0000 (05:47 +0000)]
Not all x86-64 machines have sse3 apparently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49985 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCheck that APFloat::convert is not trying to target
Dale Johannesen [Sun, 20 Apr 2008 01:34:03 +0000 (01:34 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49983 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoregenerate
Chris Lattner [Sun, 20 Apr 2008 00:41:19 +0000 (00:41 +0000)]
regenerate

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49978 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSwitch to using Simplified ConstantFP::get API.
Chris Lattner [Sun, 20 Apr 2008 00:41:09 +0000 (00:41 +0000)]
Switch to using Simplified ConstantFP::get API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49977 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse simplified ConstantFP::get method, fix a bug handling frem x, 0 with long doubles.
Chris Lattner [Sun, 20 Apr 2008 00:26:06 +0000 (00:26 +0000)]
Use simplified ConstantFP::get method, fix a bug handling frem x, 0 with long doubles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49976 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofree(null) -> noop
Chris Lattner [Sat, 19 Apr 2008 22:41:32 +0000 (22:41 +0000)]
free(null) -> noop

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49972 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agorename *.llx -> *.ll, last batch.
Chris Lattner [Sat, 19 Apr 2008 22:32:52 +0000 (22:32 +0000)]
rename *.llx -> *.ll, last batch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49971 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agorename *.llx -> *.ll
Chris Lattner [Sat, 19 Apr 2008 22:29:10 +0000 (22:29 +0000)]
rename *.llx -> *.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49970 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agorename *.llx -> *.ll
Chris Lattner [Sat, 19 Apr 2008 22:26:29 +0000 (22:26 +0000)]
rename *.llx -> *.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49969 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agomerge of 49966 from branches/ggreif/use-diet to trunk. these are already active API...
Gabor Greif [Sat, 19 Apr 2008 22:25:09 +0000 (22:25 +0000)]
Merge ... 49966 from branches/ggreif/use-diet to trunk. these are already active API changes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49968 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImplement PR2206.
Chris Lattner [Sat, 19 Apr 2008 22:17:26 +0000 (22:17 +0000)]
Implement PR2206.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49967 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agorefactor handling of symbolic constant folding, picking up
Chris Lattner [Sat, 19 Apr 2008 21:58:19 +0000 (21:58 +0000)]
refactor handling of symbolic constant folding, picking up
a few new cases( see Integer/a1.ll), but not anything that
would happen in practice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49965 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoindentation fix.
Chris Lattner [Sat, 19 Apr 2008 21:13:00 +0000 (21:13 +0000)]
indentation fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49964 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSome clarifications suggested by Jon Sargeant
Chris Lattner [Sat, 19 Apr 2008 21:01:16 +0000 (21:01 +0000)]
Some clarifications suggested by Jon Sargeant

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49963 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAllow argpromote to promote struct arguments with a specified number
Chris Lattner [Sat, 19 Apr 2008 19:50:01 +0000 (19:50 +0000)]
Allow argpromote to promote struct arguments with a specified number
of elements.  Patch by Matthijs Kooijman!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49962 91177308-0d34-0410-b5e6-96231b3b80d8

16 years ago64-bit atomic operations.
Evan Cheng [Sat, 19 Apr 2008 02:30:38 +0000 (02:30 +0000)]
64-bit atomic operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49949 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAlso LXCHG64 -> XCHG64rm.
Evan Cheng [Sat, 19 Apr 2008 02:05:42 +0000 (02:05 +0000)]
Also LXCHG64 -> XCHG64rm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49948 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPPC32 atomic operations.
Evan Cheng [Sat, 19 Apr 2008 01:30:48 +0000 (01:30 +0000)]
PPC32 atomic operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49947 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoxchg which references a memory operand does not need to lock prefix. Atomicity is...
Evan Cheng [Sat, 19 Apr 2008 01:20:30 +0000 (01:20 +0000)]
xchg which references a memory operand does not need to lock prefix. Atomicity is guaranteed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49946 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTeach llvm-as to accept function types with multiple return types.
Dan Gohman [Sat, 19 Apr 2008 00:24:39 +0000 (00:24 +0000)]
Teach llvm-as to accept function types with multiple return types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49945 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a scalar evolution bug. Reversing everything
Dale Johannesen [Fri, 18 Apr 2008 21:38:31 +0000 (21:38 +0000)]
Fix a scalar evolution bug.  Reversing everything
does not work because of 0; 2>0 but -2U is also >0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49928 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoEnable jitting with a known memory size.
Nicolas Geoffray [Fri, 18 Apr 2008 20:59:31 +0000 (20:59 +0000)]
Enable jitting with a known memory size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49924 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImplement a bit more softfloat support in
Duncan Sands [Fri, 18 Apr 2008 20:56:03 +0000 (20:56 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49923 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix the handling of va_copy on x86-64. As of llvm-gcc r49920
Dan Gohman [Fri, 18 Apr 2008 20:55:41 +0000 (20:55 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49922 91177308-0d34-0410-b5e6-96231b3b80d8

16 years ago- Fix atomic operation JIT encoding.
Evan Cheng [Fri, 18 Apr 2008 20:55:36 +0000 (20:55 +0000)]
- Fix atomic operation JIT encoding.
- Remove unused instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49921 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd some more FIXME's for indexed loads and stores.
Duncan Sands [Fri, 18 Apr 2008 20:27:12 +0000 (20:27 +0000)]
Add some more FIXME's for indexed loads and stores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49916 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoProvide an explicit list of operands to MakeLibcall,
Duncan Sands [Fri, 18 Apr 2008 20:25:14 +0000 (20:25 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49915 91177308-0d34-0410-b5e6-96231b3b80d8