summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Added "Profile" method to APFloat for use with FoldingSet.Ted Kremenek2008-02-111-3/+3
| | | | | | | | | | 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. llvm-svn: 46957
* Rename MRegisterInfo to TargetRegisterInfo.Dan Gohman2008-02-101-2/+3
| | | | llvm-svn: 46930
* Add truncate and AssertZext result expansion.Duncan Sands2008-02-101-0/+1
| | | | llvm-svn: 46926
* Change ConstantSDNode to store an APInt instead of a uint64_t, andDan Gohman2008-02-081-3/+10
| | | | | | begin adding some methods to use it this way. llvm-svn: 46899
* Avoid needlessly casting away const qualifiers.Dan Gohman2008-02-081-2/+2
| | | | llvm-svn: 46876
* Follow Chris' suggestion; change the PseudoSourceValue accessorsDan Gohman2008-02-071-1/+1
| | | | | | | to return pointers instead of references, since this is always what is needed. llvm-svn: 46857
* Re-apply the memory operand changes, with a fix for the staticDan Gohman2008-02-061-9/+67
| | | | | | | | initializer problem, a minor tweak to the way the DAGISelEmitter finds load/store nodes, and a renaming of the new PseudoSourceValue objects. llvm-svn: 46827
* Fix PR1975: dag isel emitter produces patterns that isel wrong flag result.Evan Cheng2008-02-051-4/+0
| | | | llvm-svn: 46776
* Typo.Evan Cheng2008-02-041-1/+1
| | | | llvm-svn: 46725
* Change the 'global modification' APIs in SelectionDAG to take a newChris Lattner2008-02-031-45/+85
| | | | | | | | | | 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. llvm-svn: 46677
* Generalize the SDOperand->SDOperand form of Chris Lattner2008-02-031-17/+16
| | | | | | | | | 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. llvm-svn: 46674
* SDIsel processes llvm.dbg.declare by recording the variable debug ↵Evan Cheng2008-02-021-0/+12
| | | | | | | | | 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. llvm-svn: 46659
* Revert 46556 and 46585. Dan please fix the PseudoSourceValue problem and ↵Evan Cheng2008-01-311-67/+9
| | | | | | re-commit. llvm-svn: 46623
* Add an extra operand to LABEL nodes which distinguishes between debug, EH, ↵Evan Cheng2008-01-311-0/+16
| | | | | | or misc labels. This fixes the EH breakage. However I am not convinced this is *the* solution. llvm-svn: 46609
* Rename ISD::FLT_ROUNDS to ISD::FLT_ROUNDS_ to avoid conflictingDan Gohman2008-01-311-1/+1
| | | | | | with the real FLT_ROUNDS (defined in <float.h>). llvm-svn: 46587
* Create a new class, MemOperand, for describing memory referencesDan Gohman2008-01-311-9/+67
| | | | | | | | | | | | | | | | 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. llvm-svn: 46585
* Factor the addressing mode and the load/store VT out of LoadSDNodeDan Gohman2008-01-301-13/+13
| | | | | | | | 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. llvm-svn: 46538
* Use empty() instead of comparing size() with zero.Dan Gohman2008-01-291-1/+1
| | | | llvm-svn: 46514
* don't bother making x&-1 only to simplify it in dag combine. This commonly ↵Chris Lattner2008-01-261-0/+2
| | | | | | occurs expanding i64 ops. llvm-svn: 46383
* Simplify SelectionDAG::getNode so that a big switch stmt is not #ifndef Chris Lattner2008-01-221-119/+88
| | | | | | | | 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. llvm-svn: 46254
* Move DAG-changing code out of #ifndef NDEBUG.Dale Johannesen2008-01-211-1/+3
| | | | llvm-svn: 46204
* * Introduce a new SelectionDAG::getIntPtrConstant methodChris Lattner2008-01-171-3/+15
| | | | | | | | | | | | | 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. llvm-svn: 46125
* Fix a ppc long double regression I introduced yesterday due to aChris Lattner2008-01-161-0/+1
| | | | | | simplification. This fixes automotive-basicmath on PPC. llvm-svn: 46072
* Factor the ReachesChainWithoutSideEffects out of dag combiner into Chris Lattner2008-01-161-0/+31
| | | | | | | a public SDOperand::reachesChainWithoutSideEffects method. No functionality change. llvm-svn: 46050
* For PR1839: add initial support for __builtin_trap. llvm-gcc part is missedAnton Korobeynikov2008-01-151-1/+2
| | | | | | as well as PPC codegen llvm-svn: 46001
* Move a bunch more accessors from TargetInstrInfo to TargetInstrDescriptorChris Lattner2008-01-071-1/+1
| | | | llvm-svn: 45680
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* improve support for fgetsignChris Lattner2007-12-221-0/+6
| | | | llvm-svn: 45322
* Fix PR1872: SrcValue and SrcValueOffset should not be used to compute load / ↵Evan Cheng2007-12-181-20/+0
| | | | | | store node id. llvm-svn: 45167
* Also print alignment and volatileness.Evan Cheng2007-12-181-13/+19
| | | | llvm-svn: 45164
* SelectionDAG::dump() should print SrcValue of LoadSDNode and StoreSDNode.Evan Cheng2007-12-181-0/+18
| | | | llvm-svn: 45151
* Allow vector integer constants to be created withDan Gohman2007-12-121-9/+22
| | | | | | | | 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. llvm-svn: 44954
* Pretty print shuffle mask operand.Evan Cheng2007-12-111-0/+13
| | | | llvm-svn: 44837
* Implement necessary bits for flt_rounds gcc builtin. Anton Korobeynikov2007-11-151-0/+1
| | | | | | Codegen bits and llvm-gcc support will follow. llvm-svn: 44182
* If a call to getTruncStore is for a normal store,Duncan Sands2007-10-301-3/+5
| | | | | | | | offload to getStore rather than trying to handle both cases at once (the assertions for example assume the store really is truncating). llvm-svn: 43498
* If the value types are equal then this routineDuncan Sands2007-10-191-1/+1
| | | | | | | | | 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. llvm-svn: 43174
* Add support for byval function whose argument is not 32 bit aligned.Rafael Espindola2007-10-191-0/+24
| | | | | | | | | | 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 :-) llvm-svn: 43172
* Return Expand from getOperationAction for all extendedDuncan Sands2007-10-171-10/+17
| | | | | | | | | | | | | | | | | | | types. This is needed for SIGN_EXTEND_INREG at least. It is not clear if this is correct for other operations. On the other hand, for the various load/store actions it seems to correct to return the type action, as is currently done. Also, it seems that SelectionDAG::getValueType can be called for extended value types; introduce a map for holding these, since we don't really want to extend the vector to be 2^32 pointers long! Generalize DAGTypeLegalizer::PromoteResult_TRUNCATE and DAGTypeLegalizer::PromoteResult_INT_EXTEND to handle the various funky possibilities that apints introduce, for example that you can promote to a type that needs to be expanded. llvm-svn: 43071
* Disable attempts to constant fold PPC f128.Dale Johannesen2007-10-161-36/+41
| | | | | | | Remove the assumption that this will happen from various places. llvm-svn: 43053
* Initial infrastructure for arbitrary precision integerDuncan Sands2007-10-161-26/+32
| | | | | | | | | | codegen support. This should have no effect on codegen for other types. Debatable bits: (1) the use (abuse?) of a set in SDNode::getValueTypeList; (2) the length of getTypeToTransformTo, which maybe should be refactored with a non-inline part for extended value types. llvm-svn: 43030
* add a new CreateStackTemporary helper method.Chris Lattner2007-10-151-0/+13
| | | | llvm-svn: 42994
* One mundane change: Change ReplaceAllUsesOfValueWith to *optionally* Chris Lattner2007-10-151-35/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | take a deleted nodes vector, instead of requiring it. One more significant change: Implement the start of a legalizer that just works on types. This legalizer is designed to run before the operation legalizer and ensure just that the input dag is transformed into an output dag whose operand and result types are all legal, even if the operations on those types are not. This design/impl has the following advantages: 1. When finished, this will *significantly* reduce the amount of code in LegalizeDAG.cpp. It will remove all the code related to promotion and expansion as well as splitting and scalarizing vectors. 2. The new code is very simple, idiomatic, and modular: unlike LegalizeDAG.cpp, it has no 3000 line long functions. :) 3. The implementation is completely iterative instead of recursive, good for hacking on large dags without blowing out your stack. 4. The implementation updates nodes in place when possible instead of deallocating and reallocating the entire graph that points to some mutated node. 5. The code nicely separates out handling of operations with invalid results from operations with invalid operands, making some cases simpler and easier to understand. 6. The new -debug-only=legalize-types option is very very handy :), allowing you to easily understand what legalize types is doing. This is not yet done. Until the ifdef added to SelectionDAGISel.cpp is enabled, this does nothing. However, this code is sufficient to legalize all of the code in 186.crafty, olden and freebench on an x86 machine. The biggest issues are: 1. Vectors aren't implemented at all yet 2. SoftFP is a mess, I need to talk to Evan about it. 3. No lowering to libcalls is implemented yet. 4. Various operations are missing etc. 5. There are FIXME's for stuff I hax0r'd out, like softfp. Hey, at least it is a step in the right direction :). If you'd like to help, just enable the #ifdef in SelectionDAGISel.cpp and compile code with it. If this explodes it will tell you what needs to be implemented. Help is certainly appreciated. Once this goes in, we can do three things: 1. Add a new pass of dag combine between the "type legalizer" and "operation legalizer" passes. This will let us catch some long-standing isel issues that we miss because operation legalization often obfuscates the dag with target-specific nodes. 2. We can rip out all of the type legalization code from LegalizeDAG.cpp, making it much smaller and simpler. When that happens we can then reimplement the core functionality left in it in a much more efficient and non-recursive way. 3. Once the whole legalizer is non-recursive, we can implement whole-function selectiondags maybe... llvm-svn: 42981
* Disable some compile-time optimizations on PPCDale Johannesen2007-10-141-0/+3
| | | | | | long double. llvm-svn: 42958
* Add an ISD::FPOW node type.Dan Gohman2007-10-111-0/+1
| | | | llvm-svn: 42879
* Next PPC long double bits: ppcf128->i32 conversion.Dale Johannesen2007-10-101-0/+6
| | | | | | | Surprisingly complicated. Adds getTargetNode for 2 outputs, no inputs (missing). llvm-svn: 42822
* Add convenience overloads of SelectionDAG::getNode that take a SDVTListDan Gohman2007-10-081-0/+36
| | | | | | and individual SDOperand operands. llvm-svn: 42753
* convertFromInteger, as originally written, expected sign-extendedNeil Booth2007-10-071-1/+1
| | | | | | | | input. APInt unfortunately zero-extends signed integers, so Dale modified the function to expect zero-extended input. Make this assumption explicit in the function name. llvm-svn: 42732
* Provide names for MUL_LOHI and DIVREM operators.Dan Gohman2007-10-051-0/+4
| | | | llvm-svn: 42634
* Add a variant of getTargetNode() that takes a vector of MVT::ValueType.Evan Cheng2007-10-051-0/+7
| | | | llvm-svn: 42620
* remove dup commentDale Johannesen2007-09-301-1/+0
| | | | llvm-svn: 42486
OpenPOWER on IntegriCloud