Commit Graph

306 Commits

Author SHA1 Message Date
Evan Cheng
bf57e1f456 Missing a cast previously.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26434 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 00:58:54 +00:00
Chris Lattner
5ee3e14127 Add C_Memory operand type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26344 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-24 01:10:14 +00:00
Chris Lattner
410354fe0c Make the LLVM headers "-ansi -pedantic -Wno-long-long" clean.
Patch by Martin Partel!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26313 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-22 16:23:43 +00:00
Chris Lattner
1efa40f6a4 split register class handling from explicit physreg handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26308 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-22 00:56:39 +00:00
Chris Lattner
aba3b13fb3 Pass in a value type to getRegForInlineAsmConstraint, allowing targets to
select different sets of registers depending on the type requested.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26304 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-21 23:10:29 +00:00
Nate Begeman
70804d3e14 Fix a nit sabre noticed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26262 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 18:06:19 +00:00
Nate Begeman
368e18d56a Rework the SelectionDAG-based implementations of SimplifyDemandedBits
and ComputeMaskedBits to match the new improved versions in instcombine.
Tested against all of multisource/benchmarks on ppc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26238 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 21:11:51 +00:00
Evan Cheng
a03a5dc7ce Rename maxStoresPerMemSet to maxStoresPerMemset, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26174 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-14 08:38:30 +00:00
Chris Lattner
eac707f702 getConstraintType should be virtual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26041 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-07 20:13:44 +00:00
Chris Lattner
c991cf58aa Add some methods for inline asm support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25950 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-04 02:12:09 +00:00
Nate Begeman
de99629e2a Add a framework for eliminating instructions that produces undemanded bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25945 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-03 22:24:05 +00:00
Chris Lattner
cb0b555663 Clear the OpAction field before setting it. This allows a target to set
an instruction operation action to Expand, then set it to Legal later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25812 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-30 06:09:03 +00:00
Chris Lattner
553d8007ad Move MaskedValueIsZero from the DAGCombiner to the TargetLowering interface,
making isMaskedValueZeroForTargetNode simpler, and useable from other parts
of the compiler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25802 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-30 04:08:18 +00:00
Chris Lattner
030dae5bce Pass the address of the main MaskedValueIsZero function to allow recursion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25797 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-30 03:48:36 +00:00
Chris Lattner
e3bd778e4d Clean up the interface to ValueTypeActions, allowing Legalize to use a copy
of it more cleanly.  Double the size of OpActions, allowing it to hold actions
for any VT.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25782 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-29 08:40:37 +00:00
Chris Lattner
7e871b28a2 remove this method I just added, now is not the time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25729 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-28 03:43:33 +00:00
Chris Lattner
4f16e70faa add a new callback
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25727 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-28 03:37:03 +00:00
Nate Begeman
0aed7840ec Implement Promote for VAARG, and allow it to be custom promoted for people
who don't want the default behavior (Alpha).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25726 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-28 03:14:31 +00:00
Nate Begeman
ee625573b5 Remove TLI.LowerReturnTo, and just let targets custom lower ISD::RET for
the same functionality.  This addresses another piece of bug 680.  Next,
on to fixing Alpha VAARG, which I broke last time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25696 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-27 21:09:22 +00:00
Chris Lattner
bc9ae377d9 Add a method for inline asm support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25656 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-26 20:27:33 +00:00
Nate Begeman
acc398c195 First part of bug 680:
Remove TLI.LowerVA* and replace it with SDNodes that are lowered the same
way as everything else.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25606 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-25 18:21:52 +00:00
Evan Cheng
d854b62afa Add a enum to specify target scheduling preference: SchedulingForLatency or
SchedulingForRegPressure. Added corresponding methods to set / get the value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25598 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-25 09:09:02 +00:00
Chris Lattner
d90ef9ef2b Provide an interface for Targets to specify their stack pointer register
for llvm.stacksave/restore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25275 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-13 17:47:52 +00:00
Jeff Cohen
9337de8651 Oh oh... Unix is case sensitive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24928 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 01:46:59 +00:00
Jeff Cohen
f31a60cd71 Make it compile with VC++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24927 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 01:44:51 +00:00
Evan Cheng
c85b33f264 Added TargetLowering::isMaskedValueZeroForTargetNode() declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24923 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 23:15:41 +00:00
Evan Cheng
7226158d7e Added a hook to print out names of target specific DAG nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24877 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-20 06:22:03 +00:00
Nate Begeman
6a648614e8 Add the majority of the vector machien value types we expect to support,
and make a few changes to the legalization machinery to support more than
16 types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24511 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-29 05:45:29 +00:00
Nate Begeman
395cba8d41 Teach the type lowering code about turning packed types into vector types.
Next step: generating vector dag nodes, and legalizing them into scalar
code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24404 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 21:44:42 +00:00
Nate Begeman
405e3ecb56 Invert the TargetLowering flag that controls divide by consant expansion.
Add a new flag to TargetLowering indicating if the target has really cheap
  signed division by powers of two, make ppc use it.  This will probably go
  away in the future.
Implement some more ISD::SDIV folds in the dag combiner
Remove now dead code in the x86 backend.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23853 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-21 00:02:42 +00:00
Nate Begeman
d32d4a93f6 Enable targets to say that integer divide is expensive, which will trigger
an upcoming optimization in the DAG Combiner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23834 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-20 02:14:14 +00:00
Nate Begeman
4a95945fa5 Add the ability to lower return instructions to TargetLowering. This
allows us to lower legal return types to something else, to meet ABI
requirements (such as that i64 be returned in two i32 regs on Darwin/ppc).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23802 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-18 23:23:37 +00:00
Chris Lattner
5e93fbe68c Add a new flag for targets where setjmp/longjmp saves/restores the signal mask,
and _setjmp/_longjmp should be used instead (for llvm.setjmp/llvm.longjmp).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23479 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 22:13:36 +00:00
Reid Spencer
0f9beca707 Change the names of member variables per Chris' instructions, and document
them more clearly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23118 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-27 19:09:02 +00:00
Chris Lattner
050967c4d1 add some forward defs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23100 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 21:06:40 +00:00
Chris Lattner
8fae46675d spell this right!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23097 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 20:53:44 +00:00
Chris Lattner
a8fbee6f09 Add a hook
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23096 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 20:53:09 +00:00
Chris Lattner
de6a4bc058 rename hasNativeSupportFor* -> is(Operation|Type)Legal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23011 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-24 16:34:59 +00:00
Jeff Cohen
9eb59ec548 Eliminate tabs and trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22520 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-27 05:53:44 +00:00
Reid Spencer
a0f5bf306c For: memory operations -> stores
This is the first incremental patch to implement this feature. It adds no
functionality to LLVM but setup up the information needed from targets in
order to implement the optimization correctly. Each target needs to specify
the maximum number of store operations for conversion of the llvm.memset,
llvm.memcpy, and llvm.memmove intrinsics into a sequence of store operations.
The limit needs to be chosen at the threshold of performance for such an
optimization (generally smallish). The target also needs to specify whether
the target can support unaligned stores for multi-byte store operations.
This helps ensure the optimization doesn't generate code that will trap on
an alignment errors.
More patches to follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22468 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-19 04:52:44 +00:00
Chris Lattner
e64e72b794 Make several cleanups to Andrews varargs change:
1. Pass Value*'s into lowering methods so that the proper pointers can be
   added to load/stores from the valist
2. Intrinsics that return void should only return a token chain, not a token
   chain/retval pair.
3. Rename LowerVAArgNext -> LowerVAArg, because VANext is long gone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22338 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-05 19:57:53 +00:00
Andrew Lenharth
f542821385 header file changes for varargs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22253 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-18 18:31:30 +00:00
Chris Lattner
bc83996b31 Pass the dag into LowerOperation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22005 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 05:51:05 +00:00
Chris Lattner
adf6a965a3 Add an isTailCall flag to LowerCallTo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21958 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 18:50:42 +00:00
Chris Lattner
b15a8f5f8c LowerCallTo now takes the cc to use
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21901 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 19:57:08 +00:00
Chris Lattner
39d7f8f338 Add a little hook
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21883 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 02:02:21 +00:00
Misha Brukman
34695381d6 Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21412 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 20:59:05 +00:00
Chris Lattner
7b5987d56e Allow targets which produce setcc results in non-MVT::i1 registers to describe
what the contents of the top bits of these registers are, in the common cases
of targets that sign and zero extend the results.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21145 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-07 19:41:18 +00:00
Nate Begeman
5ebc3dbc1c Change LowerCallTo to take a boolean isVarArg argument. This is needed
by the PowerPC backend, and probably others in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20843 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-26 01:30:30 +00:00
Chris Lattner
6147a7aa17 Move all data members to the end of the class.
Add a hook to find out how the target handles shift amounts that are out of
range.  Either they are undefined (the default), they mask the shift amount
to the size of the register (X86, Alpha, etc), or they extend the shift (PPC).

This defaults to undefined, which is conservatively correct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19676 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 03:36:03 +00:00
Chris Lattner
6ae76fcc06 Add comments
Add fields to hold the result type of setcc operations and shift amounts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19618 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-16 23:59:30 +00:00
Chris Lattner
7e5ee40979 Revamp supported ops. Instead of just being supported or not, we now keep
track of how to deal with it, and provide the target with a hook that they
can use to legalize arbitrary operations in arbitrary ways.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19609 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-16 07:27:49 +00:00
Chris Lattner
bb97d81cc8 Move some information out of LegalizeDAG into the generic Target interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19581 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-16 01:10:58 +00:00
Chris Lattner
f19ae7df65 Add interfaces to lower varargs and return/frame address intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19406 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-09 00:00:31 +00:00
Chris Lattner
d4b1c9a938 Make LowerCallTo more generic and useful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19373 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-08 19:25:39 +00:00
Chris Lattner
75c2d0a351 First draft of a new Target interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19323 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-07 07:44:22 +00:00