oota-llvm.git
19 years agoadd printer support for flag operands
Chris Lattner [Thu, 25 Aug 2005 17:59:23 +0000 (17:59 +0000)]
add printer support for flag operands

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

19 years agosimplify the code a bit using isOperationLegal
Chris Lattner [Thu, 25 Aug 2005 17:54:58 +0000 (17:54 +0000)]
simplify the code a bit using isOperationLegal

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

19 years agoAdd support for sdiv by 2^k and -2^k. Producing code like:
Chris Lattner [Thu, 25 Aug 2005 17:50:06 +0000 (17:50 +0000)]
Add support for sdiv by 2^k and -2^k.  Producing code like:

_test:
        srawi r2, r3, 2
        addze r3, r2
        blr

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

19 years agofit in 80 cols
Chris Lattner [Thu, 25 Aug 2005 17:49:31 +0000 (17:49 +0000)]
fit in 80 cols

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

19 years agoAdd support for flag operands
Chris Lattner [Thu, 25 Aug 2005 17:48:54 +0000 (17:48 +0000)]
Add support for flag operands

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

19 years agoadd a method
Chris Lattner [Thu, 25 Aug 2005 17:24:09 +0000 (17:24 +0000)]
add a method

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

19 years agoadd an enum value
Chris Lattner [Thu, 25 Aug 2005 17:07:09 +0000 (17:07 +0000)]
add an enum value

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

19 years agoRemove Support/Search.h entry
Jim Laskey [Thu, 25 Aug 2005 16:44:13 +0000 (16:44 +0000)]
Remove Support/Search.h entry

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

19 years agoRecommended to use std::algorithms instead.
Jim Laskey [Thu, 25 Aug 2005 16:21:56 +0000 (16:21 +0000)]
Recommended to use std::algorithms instead.

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

19 years agoAdded Support/Search.h to project.
Jim Laskey [Thu, 25 Aug 2005 13:42:04 +0000 (13:42 +0000)]
Added Support/Search.h to project.

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

19 years agoAdded support for generic linear/binary search.
Jim Laskey [Thu, 25 Aug 2005 13:32:25 +0000 (13:32 +0000)]
Added support for generic linear/binary search.

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

19 years agoFix a problem Duraid noticed, where we weren't removing values from the kills
Chris Lattner [Thu, 25 Aug 2005 05:45:31 +0000 (05:45 +0000)]
Fix a problem Duraid noticed, where we weren't removing values from the kills
list when doing two-address and phi node lowering during register allocation.

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

19 years agoImplement support for taking the address of constant pool indices, which
Chris Lattner [Thu, 25 Aug 2005 05:04:11 +0000 (05:04 +0000)]
Implement support for taking the address of constant pool indices, which
is used by the int -> FP code among other things.  This gets
2005-05-12-Int64ToFP past that failure, to dying on lack of support for add_parts

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

19 years agoADd support for TargetConstantPool nodes
Chris Lattner [Thu, 25 Aug 2005 05:03:06 +0000 (05:03 +0000)]
ADd support for TargetConstantPool nodes

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

19 years agoAdd support for TargetConstantPool node
Chris Lattner [Thu, 25 Aug 2005 05:02:41 +0000 (05:02 +0000)]
Add support for TargetConstantPool node

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

19 years agoFor PR614:
Reid Spencer [Thu, 25 Aug 2005 04:59:49 +0000 (04:59 +0000)]
For PR614:
Move the implementation of the fix from Makefile.rules to Makefile. This
ensures that it is only checked on a top-level rebuild, and not in every
single subdirectory. This removes some annoying messages from the build and
numerous executions of config.status if the .in file changes but not
substantively enough to cause the .h file to be modified by config.status.

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

19 years agoAdd support for FP constants, fixing UnitTests/2004-02-02-NegativeZero
Chris Lattner [Thu, 25 Aug 2005 04:47:18 +0000 (04:47 +0000)]
Add support for FP constants, fixing UnitTests/2004-02-02-NegativeZero

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

19 years agoDon't attempt to update LLVM configured header files from a build in a
Reid Spencer [Thu, 25 Aug 2005 04:44:18 +0000 (04:44 +0000)]
Don't attempt to update LLVM configured header files from a build in a
project. Thanks to Chris for pointing out this deficiency.

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

19 years agoFully implement frame index, so that we can pass the address of alloca's
Chris Lattner [Thu, 25 Aug 2005 00:45:43 +0000 (00:45 +0000)]
Fully implement frame index, so that we can pass the address of alloca's
around to functions and stuff

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

19 years agoadd a new TargetFrameIndex node
Chris Lattner [Thu, 25 Aug 2005 00:43:01 +0000 (00:43 +0000)]
add a new TargetFrameIndex node

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

19 years agoimplement unconditional branches, fixing UnitTests/2003-05-02-DependentPHI.c
Chris Lattner [Thu, 25 Aug 2005 00:29:58 +0000 (00:29 +0000)]
implement unconditional branches, fixing UnitTests/2003-05-02-DependentPHI.c

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

19 years agoLFS/STFS load and store FP values, not integer ones. This change allows us
Chris Lattner [Thu, 25 Aug 2005 00:26:22 +0000 (00:26 +0000)]
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.

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

19 years agoFix a broken assertion
Chris Lattner [Thu, 25 Aug 2005 00:19:12 +0000 (00:19 +0000)]
Fix a broken assertion

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

19 years agoFix a warning
Chris Lattner [Thu, 25 Aug 2005 00:05:15 +0000 (00:05 +0000)]
Fix a warning

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

19 years agofix a warning in optimized build
Chris Lattner [Thu, 25 Aug 2005 00:03:21 +0000 (00:03 +0000)]
fix a warning in optimized build

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

19 years agoFix some warnings
Chris Lattner [Thu, 25 Aug 2005 00:00:26 +0000 (00:00 +0000)]
Fix some warnings

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

19 years agoSplit IMPLICIT_DEF into IMPLICIT_DEF_GPR and IMPLICIT_DEF_FP, so that the
Chris Lattner [Wed, 24 Aug 2005 23:08:16 +0000 (23:08 +0000)]
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.

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

19 years agoadd a method
Chris Lattner [Wed, 24 Aug 2005 23:00:29 +0000 (23:00 +0000)]
add a method

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

19 years agoimplement support for calls
Chris Lattner [Wed, 24 Aug 2005 22:45:17 +0000 (22:45 +0000)]
implement support for calls

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

19 years agoAdd ReplaceAllUsesWith that can take a vector of replacement values.
Chris Lattner [Wed, 24 Aug 2005 22:44:39 +0000 (22:44 +0000)]
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.

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

19 years agoadd two new methods
Chris Lattner [Wed, 24 Aug 2005 22:43:53 +0000 (22:43 +0000)]
add two new methods

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

19 years agoRemove some dead cases.
Chris Lattner [Wed, 24 Aug 2005 22:21:47 +0000 (22:21 +0000)]
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.  :)

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

19 years agoAdd support for external symbols, and support for variable arity instructions
Chris Lattner [Wed, 24 Aug 2005 22:02:41 +0000 (22:02 +0000)]
Add support for external symbols, and support for variable arity instructions

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

19 years agoFix pasto that prevented VT ndoes from showing up in -view-isel-dags correctly
Chris Lattner [Wed, 24 Aug 2005 18:30:00 +0000 (18:30 +0000)]
Fix pasto that prevented VT ndoes from showing up in -view-isel-dags correctly

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

19 years agoadd an idea
Chris Lattner [Wed, 24 Aug 2005 18:15:24 +0000 (18:15 +0000)]
add an idea

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

19 years agoFix Regression/Transforms/Reassociate/2005-08-24-Crash.ll
Chris Lattner [Wed, 24 Aug 2005 17:55:32 +0000 (17:55 +0000)]
Fix Regression/Transforms/Reassociate/2005-08-24-Crash.ll

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

19 years agonew testcase that crashes -reassociate
Chris Lattner [Wed, 24 Aug 2005 17:54:56 +0000 (17:54 +0000)]
new testcase that crashes -reassociate

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

19 years agoTransform floor((double)FLT) -> (double)floorf(FLT), implementing
Chris Lattner [Wed, 24 Aug 2005 17:22:17 +0000 (17:22 +0000)]
Transform floor((double)FLT) -> (double)floorf(FLT), implementing
Regression/Transforms/SimplifyLibCalls/floor.ll.  This triggers 19 times in
177.mesa.

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

19 years agonew testcase
Chris Lattner [Wed, 24 Aug 2005 17:20:30 +0000 (17:20 +0000)]
new testcase

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

19 years agofloor/ceil don't read/write memory. This allows gcse to eliminate 6 calls
Chris Lattner [Wed, 24 Aug 2005 16:58:56 +0000 (16:58 +0000)]
floor/ceil don't read/write memory.  This allows gcse to eliminate 6 calls
in mesa.

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

19 years agoMake sure this doesn't break when we're improving the isels
Chris Lattner [Wed, 24 Aug 2005 16:48:49 +0000 (16:48 +0000)]
Make sure this doesn't break when we're improving the isels

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

19 years agoteach selection dag mask tracking about the fact that select_cc operates like
Chris Lattner [Wed, 24 Aug 2005 16:46:55 +0000 (16:46 +0000)]
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.

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

19 years agoStart using isOperationLegal and isTypeLegal to simplify the code
Chris Lattner [Wed, 24 Aug 2005 16:35:28 +0000 (16:35 +0000)]
Start using isOperationLegal and isTypeLegal to simplify the code

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

19 years agorename hasNativeSupportFor* -> is(Operation|Type)Legal.
Chris Lattner [Wed, 24 Aug 2005 16:34:59 +0000 (16:34 +0000)]
rename hasNativeSupportFor* -> is(Operation|Type)Legal.

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

19 years agoAdjust to new interface
Chris Lattner [Wed, 24 Aug 2005 16:34:12 +0000 (16:34 +0000)]
Adjust to new interface

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

19 years agoWrap long lines
Misha Brukman [Wed, 24 Aug 2005 14:03:07 +0000 (14:03 +0000)]
Wrap long lines

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

19 years agoRemove some tabs.
Reid Spencer [Wed, 24 Aug 2005 10:57:30 +0000 (10:57 +0000)]
Remove some tabs.
Wrap a line.

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

19 years agoWhoops, don't use PROJ variables, these are all LLVM headers. This allows
Reid Spencer [Wed, 24 Aug 2005 10:55:07 +0000 (10:55 +0000)]
Whoops, don't use PROJ variables, these are all LLVM headers. This allows
projects to compile properly.

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

19 years agoFor PR619:
Reid Spencer [Wed, 24 Aug 2005 10:43:10 +0000 (10:43 +0000)]
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.

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

19 years agoFor PR616:
Reid Spencer [Wed, 24 Aug 2005 10:07:20 +0000 (10:07 +0000)]
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.

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

19 years agoWhoops, fix a thinko. All cases except SETNE are now handled by the
Nate Begeman [Wed, 24 Aug 2005 05:06:48 +0000 (05:06 +0000)]
Whoops, fix a thinko.  All cases except SETNE are now handled by the
target independent code in SelectionDAG.cpp

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

19 years agoRemove unused statistic
Nate Begeman [Wed, 24 Aug 2005 05:03:20 +0000 (05:03 +0000)]
Remove unused statistic
Prefer 'neg X' to 'subfic 0, X' since neg does not set XER[CA]

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

19 years agoAdd the "ppc specific" setcc-equivalent select_cc cases
Nate Begeman [Wed, 24 Aug 2005 04:59:21 +0000 (04:59 +0000)]
Add the "ppc specific" setcc-equivalent select_cc cases
Prefer 'neg X' to 'subfic 0, X' since it does not set XER[CA]

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

19 years agoTeach SelectionDAG how to simplify a few more setcc-equivalent select_cc
Nate Begeman [Wed, 24 Aug 2005 04:57:57 +0000 (04:57 +0000)]
Teach SelectionDAG how to simplify a few more setcc-equivalent select_cc
nodes so that backends don't have to.

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

19 years agoAdd callseq_begin/end support
Chris Lattner [Wed, 24 Aug 2005 00:47:15 +0000 (00:47 +0000)]
Add callseq_begin/end support
Call stil not supported yet

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

19 years agoMake -view-isel-dags show the dag before instruction selecting, in case
Chris Lattner [Wed, 24 Aug 2005 00:34:29 +0000 (00:34 +0000)]
Make -view-isel-dags show the dag before instruction selecting, in case
the target isel crashes due to unimplemented features like calls :)

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

19 years agoFix optimization of select_cc seteq X, 0, 1, 0 -> srl (ctlz X), log2 X size
Nate Begeman [Wed, 24 Aug 2005 00:21:28 +0000 (00:21 +0000)]
Fix optimization of select_cc seteq X, 0, 1, 0 -> srl (ctlz X), log2 X size

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

19 years agoImplement LiveVariables.h change
Chris Lattner [Wed, 24 Aug 2005 00:09:33 +0000 (00:09 +0000)]
Implement LiveVariables.h change

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

19 years agoKeep the killed/dead sets sorted, so that "KillsRegister" can do a quick
Chris Lattner [Wed, 24 Aug 2005 00:09:02 +0000 (00:09 +0000)]
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.

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

19 years agoadjust to new live variables interface
Chris Lattner [Tue, 23 Aug 2005 23:42:17 +0000 (23:42 +0000)]
adjust to new live variables interface

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

19 years agoAdjust to new livevars interface
Chris Lattner [Tue, 23 Aug 2005 23:41:14 +0000 (23:41 +0000)]
Adjust to new livevars interface

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

19 years agoChange live variables from using multimaps to using maps of vectors and
Chris Lattner [Tue, 23 Aug 2005 23:40:41 +0000 (23:40 +0000)]
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.

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

19 years agoSimplify this code by using higher-level LiveVariables methods
Chris Lattner [Tue, 23 Aug 2005 22:51:41 +0000 (22:51 +0000)]
Simplify this code by using higher-level LiveVariables methods

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

19 years agoSimplify this code by using LiveVariables::KillsRegister
Chris Lattner [Tue, 23 Aug 2005 22:49:55 +0000 (22:49 +0000)]
Simplify this code by using LiveVariables::KillsRegister

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

19 years agoAdd RegisterDefIsDead to correspond to KillsRegister, mark both const
Chris Lattner [Tue, 23 Aug 2005 22:43:24 +0000 (22:43 +0000)]
Add RegisterDefIsDead to correspond to KillsRegister, mark both const

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

19 years agoKeep track of which registers are related to which other registers.
Chris Lattner [Tue, 23 Aug 2005 22:27:31 +0000 (22:27 +0000)]
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.

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

19 years agoadd a method
Chris Lattner [Tue, 23 Aug 2005 21:45:31 +0000 (21:45 +0000)]
add a method

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

19 years agoFix PR618 and Regression/CodeGen/CBackend/2005-08-23-Fmod.ll by not emitting
Chris Lattner [Tue, 23 Aug 2005 20:22:50 +0000 (20:22 +0000)]
Fix PR618 and Regression/CodeGen/CBackend/2005-08-23-Fmod.ll by not emitting
x%y for 'rem' on fp values.

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

19 years agoNew testcase for PR618
Chris Lattner [Tue, 23 Aug 2005 20:22:07 +0000 (20:22 +0000)]
New testcase for PR618

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

19 years agoadd a note
Chris Lattner [Tue, 23 Aug 2005 06:27:59 +0000 (06:27 +0000)]
add a note

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

19 years agoAck, typo
Nate Begeman [Tue, 23 Aug 2005 05:45:10 +0000 (05:45 +0000)]
Ack, typo

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

19 years agoAdd an option to make SetCC illegal as a beta option
Nate Begeman [Tue, 23 Aug 2005 05:42:36 +0000 (05:42 +0000)]
Add an option to make SetCC illegal as a beta option

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

19 years agoTeach the SelectionDAG how to transform select_cc eq, X, 0, 1, 0 into
Nate Begeman [Tue, 23 Aug 2005 05:41:12 +0000 (05:41 +0000)]
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.

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

19 years agoTeach Legalize how to turn setcc into select_cc
Nate Begeman [Tue, 23 Aug 2005 04:29:48 +0000 (04:29 +0000)]
Teach Legalize how to turn setcc into select_cc

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

19 years agoRemove some instructions we no longer generate
Nate Begeman [Tue, 23 Aug 2005 01:16:46 +0000 (01:16 +0000)]
Remove some instructions we no longer generate

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

19 years agoRemove some regs that are not used.
Chris Lattner [Mon, 22 Aug 2005 22:32:13 +0000 (22:32 +0000)]
Remove some regs that are not used.

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

19 years agoNate noticed that 30% of the malloc/frees in llc come from calls to LowercaseString
Chris Lattner [Mon, 22 Aug 2005 22:00:02 +0000 (22:00 +0000)]
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.

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

19 years agoFix a crash I introduced into the IA64 backend with my copyfromreg change.
Chris Lattner [Mon, 22 Aug 2005 21:33:11 +0000 (21:33 +0000)]
Fix a crash I introduced into the IA64 backend with my copyfromreg change.
It used to crash on any function that took float arguments.

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

19 years agoTry to avoid scanning the fixed list. On architectures with a non-stupid
Chris Lattner [Mon, 22 Aug 2005 20:59:30 +0000 (20:59 +0000)]
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.

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

19 years agoMove some code in the register assignment case that only needs to happen if
Chris Lattner [Mon, 22 Aug 2005 20:20:42 +0000 (20:20 +0000)]
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.

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

19 years agoAdd a pass name for -time-passes output
Chris Lattner [Mon, 22 Aug 2005 18:28:09 +0000 (18:28 +0000)]
Add a pass name for -time-passes output

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

19 years agoFix a problem where constant expr shifts would not have their shift amount
Chris Lattner [Mon, 22 Aug 2005 17:28:31 +0000 (17:28 +0000)]
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

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

19 years agoTestcase for a crash in the legalizer on ia64. This is reduced from kc++.
Chris Lattner [Mon, 22 Aug 2005 17:16:49 +0000 (17:16 +0000)]
Testcase for a crash in the legalizer on ia64.  This is reduced from kc++.

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

19 years agoAdd a long-overdue itanium regression test dir: hint hint Duraid :)
Chris Lattner [Mon, 22 Aug 2005 17:15:41 +0000 (17:15 +0000)]
Add a long-overdue itanium regression test dir: hint hint Duraid :)

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

19 years agoSpeed up this loop a bit, based on some observations that Nate made, and
Chris Lattner [Mon, 22 Aug 2005 16:55:22 +0000 (16:55 +0000)]
Speed up this loop a bit, based on some observations that Nate made, and
add some comments.  This loop really needs to be reevaluated!

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

19 years agoRevert my patch which changed the code to not work.
Chris Lattner [Mon, 22 Aug 2005 16:24:25 +0000 (16:24 +0000)]
Revert my patch which changed the code to not work.

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

19 years agoMake the example a bit easier to understand, suggested by Jim.
Chris Lattner [Mon, 22 Aug 2005 16:11:46 +0000 (16:11 +0000)]
Make the example a bit easier to understand, suggested by Jim.

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

19 years agoImplement stores.
Chris Lattner [Mon, 22 Aug 2005 01:27:59 +0000 (01:27 +0000)]
Implement stores.

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

19 years agoAdd a fast-path for register values. Add support for constant pool entries,
Chris Lattner [Mon, 22 Aug 2005 01:04:32 +0000 (01:04 +0000)]
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

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

19 years agoFix compilation of:
Chris Lattner [Mon, 22 Aug 2005 00:59:14 +0000 (00:59 +0000)]
Fix compilation of:
float %test2(float* %P) {
        %Q = load float* %P
        %R = add float %Q, %Q
        ret float %R
}

By returning the right result.

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

19 years agoMake sure expressions only have one use before emitting them into a place that is...
Chris Lattner [Mon, 22 Aug 2005 00:47:28 +0000 (00:47 +0000)]
Make sure expressions only have one use before emitting them into a place that is conditionally executed

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

19 years agoImplement most of load support. There is still a bug though.
Chris Lattner [Sun, 21 Aug 2005 22:31:09 +0000 (22:31 +0000)]
Implement most of load support.  There is still a bug though.

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

19 years agoadd a method
Chris Lattner [Sun, 21 Aug 2005 22:30:42 +0000 (22:30 +0000)]
add a method

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

19 years agoadd anew method
Chris Lattner [Sun, 21 Aug 2005 22:30:30 +0000 (22:30 +0000)]
add anew method

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

19 years agoAdd support for frame index nodes
Chris Lattner [Sun, 21 Aug 2005 19:56:04 +0000 (19:56 +0000)]
Add support for frame index nodes

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

19 years agoadd a method
Chris Lattner [Sun, 21 Aug 2005 19:48:59 +0000 (19:48 +0000)]
add a method

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

19 years agoADd a method
Chris Lattner [Sun, 21 Aug 2005 19:48:53 +0000 (19:48 +0000)]
ADd a method

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

19 years agoDon't print out the MBB label for the entry mbb
Chris Lattner [Sun, 21 Aug 2005 19:09:33 +0000 (19:09 +0000)]
Don't print out the MBB label for the entry mbb

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

19 years agoSimplify the logic for BRTWOWAY_CC handling. The isel code already
Chris Lattner [Sun, 21 Aug 2005 19:03:28 +0000 (19:03 +0000)]
Simplify the logic for BRTWOWAY_CC handling.  The isel code already
simplifies BRTWOWAY into BR if one of the results is a fall-through.
Unless I'm missing something, there is no reason to duplicate this
in the target-specific code.

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

19 years agoImplement selection for branches.
Chris Lattner [Sun, 21 Aug 2005 18:50:37 +0000 (18:50 +0000)]
Implement selection for branches.

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