oota-llvm.git
18 years agoFix a huge annoyance: SelectNodeTo took types before the opcode unlike
Chris Lattner [Fri, 26 Aug 2005 16:36:26 +0000 (16:36 +0000)]
Fix a huge annoyance: SelectNodeTo took types before the opcode unlike
every other SD API.  Fix it to take the opcode before the types.

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

18 years agoChanged unsigned long to unsigned.
Jim Laskey [Fri, 26 Aug 2005 09:25:54 +0000 (09:25 +0000)]
Changed unsigned long to unsigned.

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

18 years agoChange unsigned lng to unsigned.
Jim Laskey [Fri, 26 Aug 2005 09:24:46 +0000 (09:24 +0000)]
Change unsigned lng to unsigned.

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

18 years agoFix JIT encoding of conditional branches
Nate Begeman [Fri, 26 Aug 2005 04:11:42 +0000 (04:11 +0000)]
Fix JIT encoding of conditional branches

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

18 years agoadd initial support for converting select_cc -> fsel in the legalizer
Chris Lattner [Fri, 26 Aug 2005 00:52:45 +0000 (00:52 +0000)]
add initial support for converting select_cc -> fsel in the legalizer
instead of in the backend.  This currently handles fsel cases with registers,
but doesn't have the 0.0 and -0.0 optimization enabled yet.

Once this is finished, special hack for fp immediates can go away.

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

18 years agothe 5th operand is the 4th number
Chris Lattner [Fri, 26 Aug 2005 00:43:46 +0000 (00:43 +0000)]
the 5th operand is the 4th number

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

18 years agoSUBFIC produces two results, not one.
Nate Begeman [Fri, 26 Aug 2005 00:34:06 +0000 (00:34 +0000)]
SUBFIC produces two results, not one.

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

18 years agoImplement SHL_PARTS and SRL_PARTS
Nate Begeman [Fri, 26 Aug 2005 00:28:00 +0000 (00:28 +0000)]
Implement SHL_PARTS and SRL_PARTS

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

18 years agoAdd support for targets that want to custom expand select_cc in some cases.
Chris Lattner [Fri, 26 Aug 2005 00:23:59 +0000 (00:23 +0000)]
Add support for targets that want to custom expand select_cc in some cases.

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

18 years agoAllow LowerOperation to return a null SDOperand in case it wants to lower
Chris Lattner [Fri, 26 Aug 2005 00:14:16 +0000 (00:14 +0000)]
Allow LowerOperation to return a null SDOperand in case it wants to lower
some things given to it, but not all.

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

18 years agoFix a nasty bug from a previous patch of mine
Chris Lattner [Fri, 26 Aug 2005 00:13:12 +0000 (00:13 +0000)]
Fix a nasty bug from a previous patch of mine

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

18 years agoEmit the lo/hi parts in the right order :)
Chris Lattner [Thu, 25 Aug 2005 23:36:49 +0000 (23:36 +0000)]
Emit the lo/hi parts in the right order :)

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

18 years agoAdded cl::bits option type (bit vectors). See "Collecting options as a set
Jim Laskey [Thu, 25 Aug 2005 23:31:45 +0000 (23:31 +0000)]
Added cl::bits option type (bit vectors).  See "Collecting options as a set
of flags" in the Command Line doc.

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

18 years agoimplement support for 64-bit add/sub, fix a broken assertion for 64-bit
Chris Lattner [Thu, 25 Aug 2005 23:21:06 +0000 (23:21 +0000)]
implement support for 64-bit add/sub, fix a broken assertion for 64-bit
return.  Allow the udiv breaker-upper to work with any non-zero constant
operand.

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

18 years agosimplify the add/sub_parts code
Chris Lattner [Thu, 25 Aug 2005 23:19:58 +0000 (23:19 +0000)]
simplify the add/sub_parts code

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

18 years agoTweak of multiple occurance paragraph.
Jim Laskey [Thu, 25 Aug 2005 23:01:25 +0000 (23:01 +0000)]
Tweak of multiple occurance paragraph.

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

18 years agoDocumentation updated to include upcoming support for bit vector support
Jim Laskey [Thu, 25 Aug 2005 22:52:43 +0000 (22:52 +0000)]
Documentation updated to include upcoming support for bit vector support
(flags.)

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

18 years agoFinish implementing SDIV/UDIV by copying over the majik constant code from
Chris Lattner [Thu, 25 Aug 2005 22:04:30 +0000 (22:04 +0000)]
Finish implementing SDIV/UDIV by copying over the majik constant code from
ISelPattern

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

18 years agoSimplify some code. It's not clear why the UDIV expanded sequence
Chris Lattner [Thu, 25 Aug 2005 22:03:50 +0000 (22:03 +0000)]
Simplify some code.  It's not clear why the UDIV expanded sequence
doesn't work for large uint constants, but we'll keep the current behavior

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

18 years agoImplement setcc correctly for G5 and non-G5 systems
Chris Lattner [Thu, 25 Aug 2005 21:39:42 +0000 (21:39 +0000)]
Implement setcc correctly for G5 and non-G5 systems

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

18 years agoimplement setcc on the G5. We're still missing the non-g5 specific bits, but
Chris Lattner [Thu, 25 Aug 2005 20:08:18 +0000 (20:08 +0000)]
implement setcc on the G5.  We're still missing the non-g5 specific bits, but
they will come later.

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

18 years agoNew fold for SELECT_CC
Nate Begeman [Thu, 25 Aug 2005 20:04:38 +0000 (20:04 +0000)]
New fold for SELECT_CC

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

18 years agoRemove option to make SetCC illegal on PowerPC after long discussion with
Nate Begeman [Thu, 25 Aug 2005 20:01:10 +0000 (20:01 +0000)]
Remove option to make SetCC illegal on PowerPC after long discussion with
Chris.  This will be accomplished through correctly modeling CR's and
subregs.

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

18 years agoDon't auto-cse nodes that return flags
Chris Lattner [Thu, 25 Aug 2005 19:12:10 +0000 (19:12 +0000)]
Don't auto-cse nodes that return flags

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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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