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

19901 Commits

Author SHA1 Message Date
Chris Lattner
f369fd383d floor/ceil don't read/write memory. This allows gcse to eliminate 6 calls
in mesa.

llvm-svn: 23015
2005-08-24 16:58:56 +00:00
Chris Lattner
17d04b309c Make sure this doesn't break when we're improving the isels
llvm-svn: 23014
2005-08-24 16:48:49 +00:00
Chris Lattner
6d4cd33447 teach selection dag mask tracking about the fact that select_cc operates like
select.  Also teach it that the bit count instructions can only set the low bits
of the result, depending on the size of the input.

This allows us to compile this:

int %eq0(int %a) {
        %tmp.1 = seteq int %a, 0                ; <bool> [#uses=1]
        %tmp.2 = cast bool %tmp.1 to int                ; <int> [#uses=1]
        ret int %tmp.2
}

To this:

_eq0:
        cntlzw r2, r3
        srwi r3, r2, 5
        blr

instead of this:

_eq0:
        cntlzw r2, r3
        rlwinm r3, r2, 27, 31, 31
        blr

when setcc is marked illegal on ppc (which restores parity to non-illegal
setcc).  Thanks to Nate for pointing this out.

llvm-svn: 23013
2005-08-24 16:46:55 +00:00
Chris Lattner
014e001f23 Start using isOperationLegal and isTypeLegal to simplify the code
llvm-svn: 23012
2005-08-24 16:35:28 +00:00
Chris Lattner
b71b78a79d rename hasNativeSupportFor* -> is(Operation|Type)Legal.
llvm-svn: 23011
2005-08-24 16:34:59 +00:00
Chris Lattner
ea62b04502 Adjust to new interface
llvm-svn: 23010
2005-08-24 16:34:12 +00:00
Misha Brukman
14a6b6e354 Wrap long lines
llvm-svn: 23009
2005-08-24 14:03:07 +00:00
Reid Spencer
124828d796 Remove some tabs.
Wrap a line.

llvm-svn: 23008
2005-08-24 10:57:30 +00:00
Reid Spencer
72838802f3 Whoops, don't use PROJ variables, these are all LLVM headers. This allows
projects to compile properly.

llvm-svn: 23007
2005-08-24 10:55:07 +00:00
Reid Spencer
0b958878bb For PR619:
Make any header files that are automatically generated be preconditions of
the compilation. This ensures that if a *.h.in file is changed then its
corresponding *.h file gets updated on the next rebuild. Note that this can
lead to confusing (but correct) results if the *.h.in file changed
unsubstantially so that autoheader doesn't update the *.h file. In that case,
manually touch the *.h file in question to restore order. Moral of the story,
if you're going to "touch" a *.in file then modify it substantially.

llvm-svn: 23006
2005-08-24 10:43:10 +00:00
Reid Spencer
a1470f81ae For PR616:
These patches make threading optional in LLVM. The configuration scripts are now
modified to accept a --disable-threads switch. If this is used, the Mutex class
will be implemented with all functions as no-op. Furthermore, linking against
libpthread will not be done. Finally, the ParallelJIT example needs libpthread
so its makefile was changed to always add -lpthread to the link line.

llvm-svn: 23003
2005-08-24 10:07:20 +00:00
Nate Begeman
326b3809f4 Whoops, fix a thinko. All cases except SETNE are now handled by the
target independent code in SelectionDAG.cpp

llvm-svn: 23002
2005-08-24 05:06:48 +00:00
Nate Begeman
8e1c08e083 Remove unused statistic
Prefer 'neg X' to 'subfic 0, X' since neg does not set XER[CA]

llvm-svn: 23001
2005-08-24 05:03:20 +00:00
Nate Begeman
5d3e28b04c Add the "ppc specific" setcc-equivalent select_cc cases
Prefer 'neg X' to 'subfic 0, X' since it does not set XER[CA]

llvm-svn: 23000
2005-08-24 04:59:21 +00:00
Nate Begeman
2fc750ca45 Teach SelectionDAG how to simplify a few more setcc-equivalent select_cc
nodes so that backends don't have to.

llvm-svn: 22999
2005-08-24 04:57:57 +00:00
Chris Lattner
f034da3bd4 Add callseq_begin/end support
Call stil not supported yet

llvm-svn: 22998
2005-08-24 00:47:15 +00:00
Chris Lattner
64f7f0beac Make -view-isel-dags show the dag before instruction selecting, in case
the target isel crashes due to unimplemented features like calls :)

llvm-svn: 22997
2005-08-24 00:34:29 +00:00
Nate Begeman
d4fcf86262 Fix optimization of select_cc seteq X, 0, 1, 0 -> srl (ctlz X), log2 X size
llvm-svn: 22995
2005-08-24 00:21:28 +00:00
Chris Lattner
e7c3b71a28 Implement LiveVariables.h change
llvm-svn: 22994
2005-08-24 00:09:33 +00:00
Chris Lattner
180f2050d0 Keep the killed/dead sets sorted, so that "KillsRegister" can do a quick
binary search to test for membership.  This speeds up LLC a bit more on KC++,
e.g. on itanium from 16.6974s to 14.8272s, PPC from 11.4926s to 10.7089s and
X86 from 10.8128s to 9.7943s, with no difference in generated code (like all
of the RA patches).

With these changes, isel is the slowest pass for PPC/X86, but linscan+live
intervals is still > 50% of the compile time for itanium.  More work could
be done, but this is the last for now.

llvm-svn: 22993
2005-08-24 00:09:02 +00:00
Chris Lattner
7e3441972b adjust to new live variables interface
llvm-svn: 22992
2005-08-23 23:42:17 +00:00
Chris Lattner
0444d66753 Adjust to new livevars interface
llvm-svn: 22991
2005-08-23 23:41:14 +00:00
Chris Lattner
3bb878f134 Change live variables from using multimaps to using maps of vectors and
rearrange some of the accessors to be more efficient.

This makes it much more efficient to iterate over all of the things with the
same value.  This speeds up liveintervals analysis from 8.63s to 3.79s with
a release build of llc on kc++ with -march=ia64.  This also speeds up live
var from 1.66s -> 0.87s as well, reducing total llc time from 20.1s->15.2s.

This also speeds up other targets slightly, e.g. llc time on X86 from 16.84
-> 16.45s, and PPC from 17.64->17.03s.

llvm-svn: 22990
2005-08-23 23:40:41 +00:00
Chris Lattner
53b91b741f Simplify this code by using higher-level LiveVariables methods
llvm-svn: 22989
2005-08-23 22:51:41 +00:00
Chris Lattner
51bad854a7 Simplify this code by using LiveVariables::KillsRegister
llvm-svn: 22988
2005-08-23 22:49:55 +00:00
Chris Lattner
f91a79a306 Add RegisterDefIsDead to correspond to KillsRegister, mark both const
llvm-svn: 22987
2005-08-23 22:43:24 +00:00
Chris Lattner
610eeca969 Keep track of which registers are related to which other registers.
Use this information to avoid doing expensive interval intersections for
registers that could not possible be interesting.  This speeds up linscan
on ia64 compiling kc++ in release mode from taking 7.82s to 4.8s(!), total
itanium llc time on this program is 27.3s now.  This marginally speeds up
PPC and X86, but they appear to be limited by other parts of linscan, not
this code.

On this program, on itanium, live intervals now takes 41% of llc time.

llvm-svn: 22986
2005-08-23 22:27:31 +00:00
Chris Lattner
a6da5575c8 add a method
llvm-svn: 22985
2005-08-23 21:45:31 +00:00
Chris Lattner
aba58bd49b Fix PR618 and Regression/CodeGen/CBackend/2005-08-23-Fmod.ll by not emitting
x%y for 'rem' on fp values.

llvm-svn: 22984
2005-08-23 20:22:50 +00:00
Chris Lattner
374051379d New testcase for PR618
llvm-svn: 22983
2005-08-23 20:22:07 +00:00
Chris Lattner
86a4a4745c add a note
llvm-svn: 22982
2005-08-23 06:27:59 +00:00
Nate Begeman
a8ec868347 Ack, typo
llvm-svn: 22981
2005-08-23 05:45:10 +00:00
Nate Begeman
0ac8bb2fe1 Add an option to make SetCC illegal as a beta option
llvm-svn: 22979
2005-08-23 05:42:36 +00:00
Nate Begeman
f1581c11e9 Teach the SelectionDAG how to transform select_cc eq, X, 0, 1, 0 into
either seteq X, 0 or srl (ctlz X), size(X-1), depending on what's legal
for the target.

llvm-svn: 22978
2005-08-23 05:41:12 +00:00
Nate Begeman
885680bafb Teach Legalize how to turn setcc into select_cc
llvm-svn: 22977
2005-08-23 04:29:48 +00:00
Nate Begeman
383c7553a6 Remove some instructions we no longer generate
llvm-svn: 22976
2005-08-23 01:16:46 +00:00
Chris Lattner
86ab578e3e Remove some regs that are not used.
llvm-svn: 22975
2005-08-22 22:32:13 +00:00
Chris Lattner
362eff4ccd Nate noticed that 30% of the malloc/frees in llc come from calls to LowercaseString
in the asmprinter.  This changes the .td files to use lower case register names,
avoiding the need to do this call.  This speeds up the asmprinter from 1.52s
to 1.06s on kc++ in a release build.

llvm-svn: 22974
2005-08-22 22:00:02 +00:00
Chris Lattner
ef8f06856f Fix a crash I introduced into the IA64 backend with my copyfromreg change.
It used to crash on any function that took float arguments.

llvm-svn: 22973
2005-08-22 21:33:11 +00:00
Chris Lattner
2c5f36d938 Try to avoid scanning the fixed list. On architectures with a non-stupid
number of regs (e.g. most riscs), many functions won't need to use callee
clobbered registers.  Do a speculative check to see if we can get a free
register without processing the fixed list (which has all of these).  This
saves a lot of time on machines with lots of callee clobbered regs (e.g.
ppc and itanium, also x86).

This reduces ppc llc compile time from 184s -> 172s on kc++.  This is probably
worth FAR FAR more on itanium though.

llvm-svn: 22972
2005-08-22 20:59:30 +00:00
Chris Lattner
9b0058b424 Move some code in the register assignment case that only needs to happen if
we spill out of the fast path.  The scan of active_ and the calls to
updateSpillWeights don't need to happen unless a spill occurs.  This reduces
debug llc time of kc++ with ppc from 187.3s to 183.2s.

llvm-svn: 22971
2005-08-22 20:20:42 +00:00
Chris Lattner
36b8efcedd Add a pass name for -time-passes output
llvm-svn: 22970
2005-08-22 18:28:09 +00:00
Chris Lattner
d73a5042d9 Fix a problem where constant expr shifts would not have their shift amount
promoted to the right type.  This fixes: IA64/2005-08-22-LegalizerCrash.ll

llvm-svn: 22969
2005-08-22 17:28:31 +00:00
Chris Lattner
7ed2f46d60 Testcase for a crash in the legalizer on ia64. This is reduced from kc++.
llvm-svn: 22968
2005-08-22 17:16:49 +00:00
Chris Lattner
a43a966d4b Add a long-overdue itanium regression test dir: hint hint Duraid :)
llvm-svn: 22967
2005-08-22 17:15:41 +00:00
Chris Lattner
a9710ba54f Speed up this loop a bit, based on some observations that Nate made, and
add some comments.  This loop really needs to be reevaluated!

llvm-svn: 22966
2005-08-22 16:55:22 +00:00
Chris Lattner
5ba4ca426d Revert my patch which changed the code to not work.
llvm-svn: 22965
2005-08-22 16:24:25 +00:00
Chris Lattner
0644097e61 Make the example a bit easier to understand, suggested by Jim.
llvm-svn: 22964
2005-08-22 16:11:46 +00:00
Chris Lattner
4c9d1715ff Implement stores.
llvm-svn: 22963
2005-08-22 01:27:59 +00:00
Chris Lattner
7ce81741ff Add a fast-path for register values. Add support for constant pool entries,
allowing us to compile this:

float %test2(float* %P) {
        %Q = load float* %P
        %R = add float %Q, 10.1
        ret float %R
}

to this:

_test2:
        lfs r2, 0(r3)
        lis r3, ha16(.CPI_test2_0)
        lfs r3, lo16(.CPI_test2_0)(r3)
        fadds f1, r2, r3
        blr

llvm-svn: 22962
2005-08-22 01:04:32 +00:00