Commit Graph

502 Commits

Author SHA1 Message Date
Andrew Lenharth
c1c7bd610a Better names as per Evan's request
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47435 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21 16:11:38 +00:00
Andrew Lenharth
ab0b949e0e Atomic op support. If any gcc test uses __sync builtins, it might start failing on archs that haven't implemented them yet
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47430 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21 06:45:13 +00:00
Duncan Sands
f83b1f63dd LegalizeTypes support for scalarizing a vector store
and splitting extract_subvector.  This fixes nine
"make check" testcases, for example
2008-02-04-ExtractSubvector.ll and (partially)
CodeGen/Generic/vector.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47384 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 17:38:09 +00:00
Dan Gohman
ca93a43e84 Use APInt::intersects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47380 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 16:30:17 +00:00
Anton Korobeynikov
4c71dfe356 Update gcc 4.3 warnings fix patch with recent head changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47368 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 11:10:28 +00:00
Chris Lattner
19fc1d3742 Fix an incredibly subtle bug exposed by Ted's change to APInt profiling.
AddNodeIDNode does profiling for a ConstantSDNode, but so does 
SelectionDAG::getConstant.  This profiling should be moved to a common
static function in ConstantSDNode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47359 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 06:28:01 +00:00
Evan Cheng
efec751a1b - When DAG combiner is folding a bit convert into a BUILD_VECTOR, it should check if it's essentially a SCALAR_TO_VECTOR. Avoid turning (v8i16) <10, u, u, u> to <10, 0, u, u, u, u, u, u>. Instead, simply convert it to a SCALAR_TO_VECTOR of the proper type.
- X86 now normalize SCALAR_TO_VECTOR to (BIT_CONVERT (v4i32 SCALAR_TO_VECTOR)). Get rid of X86ISD::S2VEC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47290 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 23:04:32 +00:00
Andrew Lenharth
22c5c1b2df llvm.memory.barrier, and impl for x86 and alpha
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47204 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16 01:24:58 +00:00
Chris Lattner
423be627e6 Fix a miscompilation from Dan's recent apintification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47128 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 18:48:56 +00:00
Dan Gohman
d9fe41c0c8 Allow the APInt form of ComputeMaskedBits to operate on i128 types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47101 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 23:13:32 +00:00
Dan Gohman
72d2fd57b6 Avoid setting bits that aren't demanded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47098 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 22:43:25 +00:00
Dan Gohman
977a76fbb6 Simplify some logic in ComputeMaskedBits. And change ComputeMaskedBits
to pass the mask APInt by value, not by reference. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47096 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 22:28:48 +00:00
Dan Gohman
fd29e0eb06 Convert SelectionDAG::ComputeMaskedBits to use APInt instead of uint64_t.
Add an overload that supports the uint64_t interface for use by clients
that haven't been updated yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47039 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 00:35:47 +00:00
Ted Kremenek
1f801fa5ad Added "Profile" method to APFloat for use with FoldingSet.
Added member template "Add" to FoldingSetNodeID that allows "adding" arbitrary
objects to a profile via dispatch to FoldingSetTrait<T>::Profile().

Removed FoldingSetNodeID::AddAPFloat and FoldingSetNodeID::APInt, as their
functionality is now replaced using the above mentioned member template.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46957 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-11 17:24:50 +00:00
Dan Gohman
6f0d024a53 Rename MRegisterInfo to TargetRegisterInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46930 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-10 18:45:23 +00:00
Duncan Sands
d885dbdf9e Add truncate and AssertZext result expansion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46926 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-10 10:08:52 +00:00
Dan Gohman
6394b099e8 Change ConstantSDNode to store an APInt instead of a uint64_t, and
begin adding some methods to use it this way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46899 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-08 22:59:30 +00:00
Dan Gohman
547ca537b6 Avoid needlessly casting away const qualifiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46876 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-08 03:26:46 +00:00
Dan Gohman
3069b87437 Follow Chris' suggestion; change the PseudoSourceValue accessors
to return pointers instead of references, since this is always what
is needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46857 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07 18:41:25 +00:00
Dan Gohman
69de1932b3 Re-apply the memory operand changes, with a fix for the static
initializer problem, a minor tweak to the way the
DAGISelEmitter finds load/store nodes, and a renaming of the
new PseudoSourceValue objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46827 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06 22:27:42 +00:00
Evan Cheng
a58891ff1e Fix PR1975: dag isel emitter produces patterns that isel wrong flag result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46776 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05 22:50:29 +00:00
Evan Cheng
fc718542a3 Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46725 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-04 23:10:38 +00:00
Chris Lattner
f8dc0617ba Change the 'global modification' APIs in SelectionDAG to take a new
DAGUpdateListener object pointer instead of just returning a vector 
of deleted nodes.  This makes the interfaces more efficient (no more
allocating a vector [at least a malloc], filling it in, then walking
it) and more clean.  This also allows the client to be notified of
nodes that are *changed* but not deleted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46677 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-03 06:49:24 +00:00
Chris Lattner
11d049c87f Generalize the SDOperand->SDOperand form of
SelectionDAG::ReplaceAllUsesWith to handle replacement of
an SDOperand with *any* sdoperand, not just one for a node with
a single result.  Note that this has a horrible FIXME'd hack in it
to work around PR1975.  This should be removed when PR1975 is fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46674 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-03 03:35:22 +00:00
Evan Cheng
a844bdeab3 SDIsel processes llvm.dbg.declare by recording the variable debug information descriptor and its corresponding stack frame index in MachineModuleInfo. This only works if the local variable is "homed" in the stack frame. It does not work for byval parameter, etc.
Added ISD::DECLARE node type to represent llvm.dbg.declare intrinsic. Now the intrinsic calls are lowered into a SDNode and lives on through out the codegen passes.
For now, since all the debugging information recording is done at isel time, when a ISD::DECLARE node is selected, it has the side effect of also recording the variable. This is a short term solution that should be fixed in time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-02 04:07:54 +00:00
Evan Cheng
334dc1f58d Revert 46556 and 46585. Dan please fix the PseudoSourceValue problem and re-commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46623 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 21:00:00 +00:00
Evan Cheng
bb81d97feb Add an extra operand to LABEL nodes which distinguishes between debug, EH, or misc labels. This fixes the EH breakage. However I am not convinced this is *the* solution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46609 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 09:59:15 +00:00
Dan Gohman
1a0248690a Rename ISD::FLT_ROUNDS to ISD::FLT_ROUNDS_ to avoid conflicting
with the real FLT_ROUNDS (defined in <float.h>).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46587 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 00:41:03 +00:00
Dan Gohman
c6c391dadd Create a new class, MemOperand, for describing memory references
in the backend. Introduce a new SDNode type, MemOperandSDNode, for
holding a MemOperand in the SelectionDAG IR, and add a MemOperand
list to MachineInstr, and code to manage them. Remove the offset
field from SrcValueSDNode; uses of SrcValueSDNode that were using
it are all all using MemOperandSDNode now.

Also, begin updating some getLoad and getStore calls to use the
PseudoSourceValue objects.

Most of this was written by Florian Brander, some
reorganization and updating to TOT by me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46585 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 00:25:39 +00:00
Dan Gohman
b625f2f896 Factor the addressing mode and the load/store VT out of LoadSDNode
and StoreSDNode into their common base class LSBaseSDNode. Member
functions getLoadedVT and getStoredVT are replaced with the common
getMemoryVT to simplify code that will handle both loads and stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46538 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-30 00:15:11 +00:00
Dan Gohman
3035959425 Use empty() instead of comparing size() with zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46514 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 13:02:09 +00:00
Chris Lattner
9967c15183 don't bother making x&-1 only to simplify it in dag combine. This commonly occurs expanding i64 ops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46383 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-26 01:05:42 +00:00
Chris Lattner
8e1f7ac87d Simplify SelectionDAG::getNode so that a big switch stmt is not #ifndef
NDEBUG.  This is in response to a really nasty bug I introduced that 
Dale tracked down, hopefully this won't happen in the future.  
Many thanks Dale.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46254 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-22 19:09:33 +00:00
Dale Johannesen
da9bb3578e Move DAG-changing code out of #ifndef NDEBUG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46204 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 01:00:34 +00:00
Chris Lattner
0bd4893a07 * Introduce a new SelectionDAG::getIntPtrConstant method
and switch various codegen pieces and the X86 backend over
  to using it.

* Add some comments to SelectionDAGNodes.h

* Introduce a second argument to FP_ROUND, which indicates
  whether the FP_ROUND changes the value of its input. If
  not it is safe to xform things like fp_extend(fp_round(x)) -> x.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46125 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 07:00:52 +00:00
Chris Lattner
7e2e033e23 Fix a ppc long double regression I introduced yesterday due to a
simplification.  This fixes automotive-basicmath on PPC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46072 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16 17:59:31 +00:00
Chris Lattner
572dee71af Factor the ReachesChainWithoutSideEffects out of dag combiner into
a public SDOperand::reachesChainWithoutSideEffects method.  No 
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46050 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16 05:49:24 +00:00
Anton Korobeynikov
66fac79b89 For PR1839: add initial support for __builtin_trap. llvm-gcc part is missed
as well as PPC codegen


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46001 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 07:02:33 +00:00
Chris Lattner
349c495200 Move a bunch more accessors from TargetInstrInfo to TargetInstrDescriptor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45680 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 03:13:06 +00:00
Chris Lattner
4ee451de36 Remove attribution from file headers, per discussion on llvmdev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 20:36:04 +00:00
Chris Lattner
d268a497f9 improve support for fgetsign
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45322 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-22 21:26:52 +00:00
Evan Cheng
636e5a216c Fix PR1872: SrcValue and SrcValueOffset should not be used to compute load / store node id.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45167 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18 19:38:14 +00:00
Evan Cheng
8131013861 Also print alignment and volatileness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45164 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18 19:06:30 +00:00
Evan Cheng
88ce93e0ef SelectionDAG::dump() should print SrcValue of LoadSDNode and StoreSDNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45151 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18 07:02:08 +00:00
Dan Gohman
890813243f Allow vector integer constants to be created with
SelectionDAG::getConstant, in the same way as vector floating-point
constants. This allows the legalize expansion code for @llvm.ctpop and
friends to be usable with vector types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44954 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 22:21:26 +00:00
Evan Cheng
ce25443608 Pretty print shuffle mask operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44837 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 02:08:35 +00:00
Anton Korobeynikov
917c2a6ff2 Implement necessary bits for flt_rounds gcc builtin.
Codegen bits and llvm-gcc support will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44182 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 23:25:33 +00:00
Duncan Sands
ba3b1d10fd If a call to getTruncStore is for a normal store,
offload to getStore rather than trying to handle
both cases at once (the assertions for example
assume the store really is truncating).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43498 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 12:40:58 +00:00
Duncan Sands
5d868b1ffe If the value types are equal then this routine
asserts in later checks rather than producing
the ordinary load it is supposed to.  Avoid all
such hassles by directly returning an ordinary
load in this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43174 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 13:05:40 +00:00
Rafael Espindola
5c0d6ed325 Add support for byval function whose argument is not 32 bit aligned.
To do this it is necessary to add a "always inline" argument to the
memcpy node. For completeness I have also added this node to memmove
and memset.  I have also added getMem* functions, because the extra
argument makes it cumbersome to use getNode and because I get confused
by it :-)




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43172 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 10:41:11 +00:00