Commit Graph

19758 Commits

Author SHA1 Message Date
Chris Lattner 4ae278a760 LFS/STFS load and store FP values, not integer ones. This change allows us
to codegen this: float foo() { return 1.245; }

into this:

_foo:
        lis r2, ha16(.CPI_foo_0)
        lfs f1, lo16(.CPI_foo_0)(r2)
        blr

instead of this:

_foo:
        lis r2, ha16(.CPI_foo_0)
        lfs r2, lo16(.CPI_foo_0)(r2)   <-- ouch
        or f1, r2, r2                  <-- ouch
        blr

with the dag isel.

llvm-svn: 23033
2005-08-25 00:26:22 +00:00
Chris Lattner 794eb6684d Fix a broken assertion
llvm-svn: 23032
2005-08-25 00:19:12 +00:00
Chris Lattner c146940f0d Fix a warning
llvm-svn: 23031
2005-08-25 00:05:15 +00:00
Chris Lattner daae1e10f7 fix a warning in optimized build
llvm-svn: 23030
2005-08-25 00:03:21 +00:00
Chris Lattner 751c6c3944 Fix some warnings
llvm-svn: 23029
2005-08-25 00:00:26 +00:00
Chris Lattner a3fbdae515 Split IMPLICIT_DEF into IMPLICIT_DEF_GPR and IMPLICIT_DEF_FP, so that the
instructions take a consistent reg class.  Implement ISD::UNDEF in the dag->dag
selector to generate this, fixing UnitTests/2003-07-06-IntOverflow.

llvm-svn: 23028
2005-08-24 23:08:16 +00:00
Chris Lattner 45e1ce4e28 add a method
llvm-svn: 23027
2005-08-24 23:00:29 +00:00
Chris Lattner d83cd354bd implement support for calls
llvm-svn: 23026
2005-08-24 22:45:17 +00:00
Chris Lattner d7ee4d8671 Add ReplaceAllUsesWith that can take a vector of replacement values.
Add some foldings to hopefully help the illegal setcc issue, and move some code around.

llvm-svn: 23025
2005-08-24 22:44:39 +00:00
Chris Lattner 9130192229 add two new methods
llvm-svn: 23024
2005-08-24 22:43:53 +00:00
Chris Lattner 1fc2a7f006 Remove some dead cases.
Emit the indcall sequence as:

mtctr inreg
mr R12, inreg
btctr

If inreg and R12 aren't coallesced, this reduces the odds of having the mtctr
and btctr in the same dispatch group.  :)

llvm-svn: 23023
2005-08-24 22:21:47 +00:00
Chris Lattner ad9565dfbe Add support for external symbols, and support for variable arity instructions
llvm-svn: 23022
2005-08-24 22:02:41 +00:00
Chris Lattner bb8cc0acb2 Fix pasto that prevented VT ndoes from showing up in -view-isel-dags correctly
llvm-svn: 23021
2005-08-24 18:30:00 +00:00
Chris Lattner 1e98a330f2 add an idea
llvm-svn: 23020
2005-08-24 18:15:24 +00:00
Chris Lattner 8ca5b2a6d2 Fix Regression/Transforms/Reassociate/2005-08-24-Crash.ll
llvm-svn: 23019
2005-08-24 17:55:32 +00:00
Chris Lattner 347f5cb985 new testcase that crashes -reassociate
llvm-svn: 23018
2005-08-24 17:54:56 +00:00
Chris Lattner 4201cd1bbc Transform floor((double)FLT) -> (double)floorf(FLT), implementing
Regression/Transforms/SimplifyLibCalls/floor.ll.  This triggers 19 times in
177.mesa.

llvm-svn: 23017
2005-08-24 17:22:17 +00:00
Chris Lattner 16a382df29 new testcase
llvm-svn: 23016
2005-08-24 17:20:30 +00:00
Chris Lattner 898e50ecb3 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 03e64f6c1e 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 86b1658d58 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 f12eb4d676 Start using isOperationLegal and isTypeLegal to simplify the code
llvm-svn: 23012
2005-08-24 16:35:28 +00:00
Chris Lattner 5ff1bf4f0a rename hasNativeSupportFor* -> is(Operation|Type)Legal.
llvm-svn: 23011
2005-08-24 16:34:59 +00:00
Chris Lattner ade525491f Adjust to new interface
llvm-svn: 23010
2005-08-24 16:34:12 +00:00
Misha Brukman 28a0d918c1 Wrap long lines
llvm-svn: 23009
2005-08-24 14:03:07 +00:00
Reid Spencer 87f95722b2 Remove some tabs.
Wrap a line.

llvm-svn: 23008
2005-08-24 10:57:30 +00:00
Reid Spencer bfb0c16606 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 b48e3f8b74 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 f85fabeb71 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 7c1ba938be 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 a1e0a2f72b 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 6948b79b26 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 45bbbb3f11 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 b6d034a841 Add callseq_begin/end support
Call stil not supported yet

llvm-svn: 22998
2005-08-24 00:47:15 +00:00
Chris Lattner 99282c7b92 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 72eab5dd5c 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 eeacce5a60 Implement LiveVariables.h change
llvm-svn: 22994
2005-08-24 00:09:33 +00:00
Chris Lattner ff978b6d76 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 469652752c adjust to new live variables interface
llvm-svn: 22992
2005-08-23 23:42:17 +00:00
Chris Lattner cdc0cbbcd0 Adjust to new livevars interface
llvm-svn: 22991
2005-08-23 23:41:14 +00:00
Chris Lattner 9fa2f949ae 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 774158239b Simplify this code by using higher-level LiveVariables methods
llvm-svn: 22989
2005-08-23 22:51:41 +00:00
Chris Lattner 7c1c6e06f3 Simplify this code by using LiveVariables::KillsRegister
llvm-svn: 22988
2005-08-23 22:49:55 +00:00
Chris Lattner 59057175ee Add RegisterDefIsDead to correspond to KillsRegister, mark both const
llvm-svn: 22987
2005-08-23 22:43:24 +00:00
Chris Lattner 22e91cc3b5 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 808a9bdb13 add a method
llvm-svn: 22985
2005-08-23 21:45:31 +00:00
Chris Lattner 9c0a243ce5 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 65de2689b4 New testcase for PR618
llvm-svn: 22983
2005-08-23 20:22:07 +00:00
Chris Lattner 5e3953d761 add a note
llvm-svn: 22982
2005-08-23 06:27:59 +00:00
Nate Begeman f3ce09b36e Ack, typo
llvm-svn: 22981
2005-08-23 05:45:10 +00:00