summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Removoe MachineModuleInfo methods (and related DebugInfoDesc class ↵Devang Patel2009-01-131-1/+1
| | | | | | hierarchy) that were used to handle debug info. llvm-svn: 62199
* Undo previous checkin.Devang Patel2009-01-131-3/+2
| | | | llvm-svn: 62190
* Use dwarf writer to decide whether the module has debug info or not.Devang Patel2009-01-131-2/+3
| | | | llvm-svn: 62184
* Use DebugInfo interface to lower dbg_* intrinsics.Devang Patel2009-01-131-2/+2
| | | | llvm-svn: 62127
* Request DwarfWriter. This will be used to handle dbg_* intrinsics.Devang Patel2009-01-091-1/+3
| | | | llvm-svn: 61999
* Clean up the atomic opcodes in SelectionDAG.Dan Gohman2008-12-231-150/+47
| | | | | | | | | | | | | This removes all the _8, _16, _32, and _64 opcodes and replaces each group with an unsuffixed opcode. The MemoryVT field of the AtomicSDNode is now used to carry the size information. In tablegen, the size-specific opcodes are replaced by size-independent opcodes that utilize the ability to compose them with predicates. This shrinks the per-opcode tables and makes the code that handles atomics much more concise. llvm-svn: 61389
* Avoid generating a convert_rndsat node when the src and dest type are the same.Mon P Wang2008-12-111-0/+4
| | | | llvm-svn: 60869
* Add sub/mul overflow intrinsics. This currently doesn't have aBill Wendling2008-12-091-0/+12
| | | | | | | target-independent way of determining overflow on multiplication. It's very tricky. Patch by Zoltan Varga! llvm-svn: 60800
* Fix PR3117: not all nodes being legalized. TheDuncan Sands2008-12-091-0/+16
| | | | | | | | | | | | | | | | | | | | | | | essential problem was that the DAG can contain random unused nodes which were never analyzed. When remapping a value of a node being processed, such a node may become used and need to be analyzed; however due to operands being transformed during analysis the node may morph into a different one. Users of the morphing node need to be updated, and this wasn't happening. While there I added a bunch of documentation and sanity checks, so I (or some other poor soul) won't have to scratch their head over this stuff so long trying to remember how it was all supposed to work next time some obscure problem pops up! The extra sanity checking exposed a few places where invariants weren't being preserved, so those are fixed too. Since some of the sanity checking is expensive, I added a flag to turn it on. It is also turned on when building with ENABLE_EXPENSIVE_CHECKS=1. llvm-svn: 60797
* Fix getNode to allow a vector for the shift amount for shifts of vectors.Mon P Wang2008-12-091-2/+4
| | | | | | | | Fix the shift amount when unrolling a vector shift into scalar shifts. Fix problem in getShuffleScalarElt where it assumes that the input of a bit convert must be a vector. llvm-svn: 60740
* When allocating a stack temporary, use the correctDuncan Sands2008-12-041-1/+1
| | | | | | | number of bytes for types such as i1 which are not a multiple of 8 bits in length. llvm-svn: 60543
* Expand getVTList, getNodeValueTypes, and SelectNodeTo to handle more value ↵Bill Wendling2008-12-011-0/+33
| | | | | | types. llvm-svn: 60381
* There are no longer any places that require aDuncan Sands2008-12-011-4/+4
| | | | | | | | MERGE_VALUES node with only one operand, so get rid of special code that only existed to handle that possibility. llvm-svn: 60349
* Eliminate some unused variable compile time warnings.Evan Cheng2008-11-241-0/+2
| | | | llvm-svn: 59952
* Rename SetCCResultContents to BooleanContents. InDuncan Sands2008-11-231-5/+5
| | | | | | | practice these booleans are mostly produced by SetCC, however the concept is more general. llvm-svn: 59911
* Cleanup of the [SU]ADDO type legalization code. Patch by Duncan!Bill Wendling2008-11-221-1/+11
| | | | | | | | | | "It simplifies the type legalization part a bit, and produces better code by teaching SelectionDAG about the extra bits in an i8 SADDO/UADDO node. In essence, I spontaneously decided that on x86 this i8 boolean result would be either 0 or 1, and on other platforms 0/1 or 0/-1, depending on whether the platform likes it's boolean zero extended or sign extended." llvm-svn: 59864
* Update comments.Dan Gohman2008-11-211-3/+3
| | | | llvm-svn: 59834
* Rename "ADDO" to "SADDO" and "UADDO". The "UADDO" isn't equivalent to "ADDC"Bill Wendling2008-11-211-1/+2
| | | | | | | because the boolean it returns to indicate an overflow may not be treated like as a flag. It could be stored to memory, for instance. llvm-svn: 59780
* Implement the sadd_with_overflow intrinsic. This is converted intoBill Wendling2008-11-211-2/+1
| | | | | | | | "ISD::ADDO". ISD::ADDO is lowered into a target-independent form that does the addition and then checks if the result is less than one of the operands. (If it is, then there was an overflow.) llvm-svn: 59779
* Add UADDO and SADDO nodes. These will be used for determining an overflowBill Wendling2008-11-211-0/+2
| | | | | | condition in an addition operation. llvm-svn: 59760
* Added CONVERT_RNDSAT (conversion with rounding and saturation) SDNode toMon P Wang2008-11-101-0/+31
| | | | | | | support targets that support these conversions. Users should avoid using this node as the current targets don't generating code for it. llvm-svn: 59001
* Added support for the following definition of shufflevector Mon P Wang2008-11-101-1/+2
| | | | | | <result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask> llvm-svn: 58964
* Fix PR2986: do not use a potentially illegalDuncan Sands2008-10-301-1/+6
| | | | | | | | | | type for the shift amount type. Add a check that shifts and rotates use the type returned by getShiftAmountTy for the amount. This exposed some problems in CellSPU and PPC, which have already been fixed. llvm-svn: 58455
* Add sanity checking for BUILD_PAIR (I noticed theDuncan Sands2008-10-291-4/+18
| | | | | | | | | other day that PPC custom lowering could create a BUILD_PAIR of two f64 with a result type of... f64! - already fixed). Fix a place that triggers the sanity check. llvm-svn: 58378
* fix some whitespace stuffChris Lattner2008-10-281-3/+3
| | | | llvm-svn: 58319
* Fix UpdateNodeOperands so that it does CSE of callsDuncan Sands2008-10-271-86/+52
| | | | | | | | | (and a bunch of other node types). While there, I added a doNotCSE predicate and used it to reduce code duplication (some of the duplicated code was wrong...). This fixes ARM/cse-libcalls.ll when using LegalizeTypes. llvm-svn: 58249
* Initialize uninitialized variable.Dale Johannesen2008-10-241-1/+1
| | | | llvm-svn: 58057
* Temporarily allow the operands of a BUILD_VECTORDuncan Sands2008-10-221-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | to have a different type to the vector element type. This should be fairly harmless because in the past guys like this were being built all over the place (and were cleaned up when I added this check). The reason for relaxing this check is that it helps LegalizeTypes legalize vector shuffles: the mask is a BUILD_VECTOR that it is *not always possible* to legalize while keeping it a BUILD_VECTOR (vector_shuffle requires the mask to be a BUILD_VECTOR, as opposed to a vector with the right vector type). With this check it is even harder to legalize the mask - turning the check off means that LegalizeTypes manages to legalize almost all vector shuffles encountered in practice. The correct solution is to change vector_shuffle to be a variadic node with the mask built into it as operands. While waiting for that change, this hack stops the problem with vector_shuffle from blocking the turning on of LegalizeTypes. llvm-svn: 57965
* Don't create TargetGlobalAddress nodes with offsets that don't fitDan Gohman2008-10-211-1/+1
| | | | | | | | | | | | | | in the 32-bit signed offset field of addresses. Even though this may be intended, some linkers refuse to relocate code where the relocated address computation overflows. Also, fix the sign-extension of constant offsets to use the actual pointer size, rather than the size of the GlobalAddress node, which may be different, for example on x86-64 where MVT::i32 is used when the address is being fit into the 32-bit displacement field. llvm-svn: 57885
* Set N->OperandList to 0 after deletion. Otherwise, it's possible that it willBill Wendling2008-10-191-15/+26
| | | | | | be either deleted or referenced afterwards. llvm-svn: 57786
* Don't truncate GlobalAddress offsets to int in debug output.Dan Gohman2008-10-181-1/+1
| | | | llvm-svn: 57770
* Teach DAGCombine to fold constant offsets into GlobalAddress nodes,Dan Gohman2008-10-181-2/+8
| | | | | | | | | | | | | | | | | | | | | | and add a TargetLowering hook for it to use to determine when this is legal (i.e. not in PIC mode, etc.) This allows instruction selection to emit folded constant offsets in more cases, such as the included testcase, eliminating the need for explicit arithmetic instructions. This eliminates the need for the C++ code in X86ISelDAGToDAG.cpp that attempted to achieve the same effect, but wasn't as effective. Also, fix handling of offsets in GlobalAddressSDNodes in several places, including changing GlobalAddressSDNode's offset from int to int64_t. The Mips, Alpha, Sparc, and CellSPU targets appear to be unaware of GlobalAddress offsets currently, so set the hook to false on those targets. llvm-svn: 57748
* Added MemIntrinsicNode which is useful to represent target intrinsics thatMon P Wang2008-10-171-2/+59
| | | | | | touches memory and need an associated MemOperand llvm-svn: 57712
* Add a "loses information" return value to APFloat::convertDale Johannesen2008-10-091-9/+14
| | | | | | | and APFloat::convertToInteger. Restore return value to IEEE754. Adjust all users accordingly. llvm-svn: 57329
* Use -1ULL instead of uint64_t(-1), at Anton's suggestion.Dan Gohman2008-10-031-2/+2
| | | | llvm-svn: 57021
* Make some implicit conversions explicit, to avoid compiler warnings.Dan Gohman2008-10-011-2/+2
| | | | llvm-svn: 56927
* Fold trivial two-operand tokenfactors where the operands are equalDan Gohman2008-10-011-0/+1
| | | | | | immediately. llvm-svn: 56921
* Implement the -fno-builtin option in the front-end, not in the back-end.Bill Wendling2008-10-011-6/+1
| | | | llvm-svn: 56900
* - Initialize "--no-builtin" to "false".Bill Wendling2008-09-301-1/+1
| | | | | | - Testcase for r56885. llvm-svn: 56886
* Add the new `-no-builtin' flag. This flag is meant to mimic the GCCBill Wendling2008-09-301-1/+7
| | | | | | | | | `-fno-builtin' flag. Currently, it's used to replace "memset" with "_bzero" instead of "__bzero" on Darwin10+. This arguably violates the meaning of this flag, but is currently sufficient. The meaning of this flag should become more specific over time. llvm-svn: 56885
* Optimize SelectionDAG's AssignTopologicalOrder even further.Dan Gohman2008-09-301-26/+62
| | | | | | | | | | | | | | | | | | | Completely eliminate the TopOrder std::vector. Instead, sort the AllNodes list in place. This also eliminates the need to call AllNodes.size(), a linear-time operation, before performing the sort. Also, eliminate the Sources temporary std::vector, since it essentially duplicates the sorted result as it is being built. This also changes the direction of the topological sort from bottom-up to top-down. The AllNodes list starts out in roughly top-down order, so this reduces the amount of reordering needed. Top-down is also more convenient for Legalize, and ISel needed only minor adjustments. llvm-svn: 56867
* Add "inreg" field to CallSDNode (doesn't increaseDale Johannesen2008-09-261-5/+5
| | | | | | | | | its size). Adjust various lowering functions to pass this info through from CallInst. Use it to implement sseregparm returns on X86. Remove X86_ssecall calling convention. llvm-svn: 56677
* Forgot this part with my last patch. Sorry about the breakage.Bill Wendling2008-09-241-27/+38
| | | | llvm-svn: 56552
* Change SelectionDAG::getConstantPool to always set the alignment of theDan Gohman2008-09-161-0/+6
| | | | | | | | | | | | | | | | | | | | ConstantPoolSDNode, using the target's preferred alignment for the constant type. In LegalizeDAG, when performing loads from the constant pool, the ConstantPoolSDNode's alignment is used in the calls to getLoad and getExtLoad. This change prevents SelectionDAG::getLoad/getExtLoad from incorrectly choosing the ABI alignment for constant pool loads when Alignment == 0. The incorrect alignment is only a performance issue when ABI alignment does not equal preferred alignment (i.e., on x86 it was generating MOVUPS instead of MOVAPS for v4f32 constant loads when the default ABI alignment for 128bit vectors is forced to 1 byte.) Patch by Paul Redmond! llvm-svn: 56253
* Reverting r56249. On further investigation, this functionality isn't needed.Bill Wendling2008-09-161-43/+28
| | | | | | Apologies for the thrashing. llvm-svn: 56251
* - Change "ExternalSymbolSDNode" to "SymbolSDNode".Bill Wendling2008-09-161-28/+43
| | | | | | | | | | - Add linkage to SymbolSDNode (default to external). - Change ISD::ExternalSymbol to ISD::Symbol. - Change ISD::TargetExternalSymbol to ISD::TargetSymbol These changes pave the way to allowing SymbolSDNodes with non-external linkage. llvm-svn: 56249
* Re-enable SelectionDAG CSE for calls. It matters in the case ofDan Gohman2008-09-151-6/+20
| | | | | | libcalls, as in this testcase on ARM. llvm-svn: 56226
* Define CallSDNode, an SDNode subclass for use with ISD::CALL.Dan Gohman2008-09-131-8/+31
| | | | | | | | | | | | | Currently it just holds the calling convention and flags for isVarArgs and isTailCall. And it has several utility methods, which eliminate magic 5+2*i and similar index computations in several places. CallSDNodes are not CSE'd. Teach UpdateNodeOperands to handle nodes that are not CSE'd gracefully. llvm-svn: 56183
* Change ConstantSDNode and ConstantFPSDNode to use ConstantInt* andDan Gohman2008-09-121-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | ConstantFP* instead of APInt and APFloat directly. This reduces the amount of time to create ConstantSDNode and ConstantFPSDNode nodes when ConstantInt* and ConstantFP* respectively are already available, as is the case in SelectionDAGBuild.cpp. Also, it reduces the amount of time to legalize constants into constant pools, and the amount of time to add ConstantFP operands to MachineInstrs, due to eliminating ConstantInt::get and ConstantFP::get calls. It increases the amount of work needed to create new constants in cases where the client doesn't already have a ConstantInt* or ConstantFP*, such as legalize expanding 64-bit integer constants to 32-bit constants. And it adds a layer of indirection for the accessor methods. But these appear to be outweight by the benefits in most cases. It will also make it easier to make ConstantSDNode and ConstantFPNode more consistent with ConstantInt and ConstantFP. llvm-svn: 56162
* Rename ConstantSDNode::getValue to getZExtValue, for consistencyDan Gohman2008-09-121-28/+31
| | | | | | | with ConstantInt. This led to fixing a bug in TargetLowering.cpp using getValue instead of getAPIntValue. llvm-svn: 56159
OpenPOWER on IntegriCloud