summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix the alignment of loads from constant pool entries when theDan Gohman2008-09-221-0/+2
| | | | | | | load address has an offset from the base of the constant pool entry. llvm-svn: 56479
* Change SelectionDAG::getConstantPool to always set the alignment of theDan Gohman2008-09-161-7/+14
| | | | | | | | | | | | | | | | | | | | 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-6/+5
| | | | | | Apologies for the thrashing. llvm-svn: 56251
* - Change "ExternalSymbolSDNode" to "SymbolSDNode".Bill Wendling2008-09-161-5/+6
| | | | | | | | | | - 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
* Change ConstantSDNode and ConstantFPSDNode to use ConstantInt* andDan Gohman2008-09-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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-19/+20
| | | | | | | with ConstantInt. This led to fixing a bug in TargetLowering.cpp using getValue instead of getAPIntValue. llvm-svn: 56159
* The sequence for ppcf128 compares was not IEEEDale Johannesen2008-09-121-4/+6
| | | | | | safe in the presence of NaNs. llvm-svn: 56136
* A few more places where FPOW is being ignored.Evan Cheng2008-09-091-7/+13
| | | | llvm-svn: 56032
* Legalizer was missing code that expand fpow to a libcall.Evan Cheng2008-09-091-10/+12
| | | | llvm-svn: 56028
* Add intrinsics for log, log2, log10, exp, exp2.Dale Johannesen2008-09-041-0/+70
| | | | | | No functional change (and no FE change to generate them). llvm-svn: 55753
* erect abstraction boundaries for accessing SDValue members, rename Val -> ↵Gabor Greif2008-08-281-131/+131
| | | | | | Node to reflect semantics llvm-svn: 55504
* Split the ATOMIC NodeType's to include the size, e.g.Dale Johannesen2008-08-281-25/+101
| | | | | | | | | | | | | | | | ATOMIC_LOAD_ADD_{8,16,32,64} instead of ATOMIC_LOAD_ADD. Increased the Hardcoded Constant OpActionsCapacity to match. Large but boring; no functional change. This is to support partial-word atomics on ppc; i8 is not a valid type there, so by the time we get to lowering, the ATOMIC_LOAD nodes looks the same whether the type was i8 or i32. The information can be added to the AtomicSDNode, but that is the largest SDNode; I don't fully understand the SDNode allocation, but it is sensitive to the largest node size, so increasing that must be bad. This is the alternative. llvm-svn: 55457
* disallow direct access to SDValue::ResNo, provide a getter insteadGabor Greif2008-08-261-23/+23
| | | | llvm-svn: 55394
* Optimize SelectionDAG's topological sort to use one pass insteadDan Gohman2008-08-261-44/+5
| | | | | | | | of two, and to not need a scratch std::vector. Also, use the SelectionDAG's topological sort in LegalizeDAG instead of having a separate implementation. llvm-svn: 55389
* Add libcalls for the new rounding opcodes.Dan Gohman2008-08-211-0/+55
| | | | llvm-svn: 55133
* Add libm-oriented ISD opcodes for rounding operations.Dan Gohman2008-08-211-0/+5
| | | | llvm-svn: 55130
* Improve support for vector casts in LLVM IR and CodeGen.Dan Gohman2008-08-141-57/+130
| | | | llvm-svn: 54784
* Fix broken CellSPU lowering, re-instate braces in LegalizeNate Begeman2008-07-291-4/+2
| | | | llvm-svn: 54168
* Disable a fix in the previous patch, since it breaks CellSPU.Nate Begeman2008-07-291-2/+4
| | | | | | | The CellSPU codegen is broken, but needs to be fixed before we can put this back in. llvm-svn: 54164
* Add vector shifts to the IR, patch by Eli Friedman.Nate Begeman2008-07-291-3/+16
| | | | | | CodeGen & Clang work coming next. llvm-svn: 54161
* Rename SDOperand to SDValue.Dan Gohman2008-07-271-433/+433
| | | | llvm-svn: 54128
* Tidy SDNode::use_iterator, and complete the transition to have itDan Gohman2008-07-271-4/+2
| | | | | | | parallel its analogue, Value::value_use_iterator. The operator* method now returns the user, rather than the use. llvm-svn: 54127
* When splitting a vector shuffle, fixed which type we used for the hi partMon P Wang2008-07-251-1/+1
| | | | llvm-svn: 54007
* Add titles to the various SelectionDAG viewGraph callsDan Gohman2008-07-211-10/+0
| | | | | | | that include useful information like the name of the block being viewed and the current phase of compilation. llvm-svn: 53872
* Add VerifyNode, a place to put sanity checks onDuncan Sands2008-07-211-3/+4
| | | | | | | | | | | | generic SDNode's (nodes with their own constructors should do sanity checking in the constructor). Add sanity checks for BUILD_VECTOR and fix all the places that were producing bogus BUILD_VECTORs, as found by "make check". My favorite is the BUILD_VECTOR with only two operands that was being used to build a vector with four elements! llvm-svn: 53850
* Factorize some code for determining which libcall to use.Duncan Sands2008-07-171-167/+27
| | | | llvm-svn: 53713
* Fixed potential bug if the source and target of a bit convert have different ↵Mon P Wang2008-07-151-1/+3
| | | | | | alignment llvm-svn: 53590
* Include a frame index in the "fixed stack" pseudo source valueDan Gohman2008-07-111-16/+13
| | | | | | | instead of using the frame index for the SVOffset, which was inconsistent. llvm-svn: 53486
* Fix a bug in the soft-float handling of FCOPYSIGN that Duncan noticedChris Lattner2008-07-101-2/+5
| | | | | | | when working on legalizetypes. Both legalizetypes and legalizeops now produce hte same code for CodeGen/ARM/fcopysign.ll. llvm-svn: 53435
* Add a mysteriously missing libcall, FPTOSINT_F80_I32.Duncan Sands2008-07-101-0/+4
| | | | | | | Be nice to 16 bit machines by supporting FP_TO_XINT expansion for these. llvm-svn: 53407
* Do not CSE DEBUG_LOC, DBG_LABEL, DBG_STOPPOINT, DECLARE, and EH_LABEL ↵Evan Cheng2008-07-081-26/+36
| | | | | | SDNode's. This improves compile time slightly at -O0 -g. llvm-svn: 53246
* Add explicit keywords.Dan Gohman2008-07-071-2/+1
| | | | llvm-svn: 53179
* Make DenseMap's insert return a pair, to more closely resemble std::map.Dan Gohman2008-07-071-2/+3
| | | | llvm-svn: 53177
* LegalizeSetCCOperands should legalize the result of ExpandLibCall. Patch by ↵Evan Cheng2008-07-071-1/+1
| | | | | | Richard Osborne. llvm-svn: 53169
* Fixed generating incorrect aligned stores that I backout of r53031Mon P Wang2008-07-051-9/+15
| | | | | | | | that fixed problems in EmitStackConvert where the source and target type have different alignment by creating a stack slot with the max alignment of source and target type. llvm-svn: 53150
* Rather than having a different custom legalizationDuncan Sands2008-07-041-8/+8
| | | | | | | | | | | | hook for each way in which a result type can be legalized (promotion, expansion, softening etc), just use one: ReplaceNodeResults, which returns a node with exactly the same result types as the node passed to it, but presumably with a bunch of custom code behind the scenes. No change if the new LegalizeTypes infrastructure is not turned on. llvm-svn: 53137
* Backed out 53031.Evan Cheng2008-07-031-15/+9
| | | | llvm-svn: 53110
* Add a new getMergeValues method that does not needDuncan Sands2008-07-021-8/+7
| | | | | | | | | | to be passed the list of value types, and use this where appropriate. Inappropriate places are where the value type list is already known and may be long, in which case the existing method is more efficient. llvm-svn: 53035
* Fixed problem in EmitStackConvert where the source and target typeMon P Wang2008-07-021-9/+15
| | | | | | | have different alignment by creating a stack slot with the max alignment of source and target type. llvm-svn: 53031
* Eliminate a compile time warning.Evan Cheng2008-07-011-1/+1
| | | | llvm-svn: 52982
* Split ISD::LABEL into ISD::DBG_LABEL and ISD::EH_LABEL, eliminatingDan Gohman2008-07-011-12/+9
| | | | | | | | | | | | | | | | the need for a flavor operand, and add a new SDNode subclass, LabelSDNode, for use with them to eliminate the need for a label id operand. Change instruction selection to let these label nodes through unmodified instead of creating copies of them. Teach the MachineInstr emitter how to emit a MachineInstr directly from an ISD label node. This avoids the need for allocating SDNodes for the label id and flavor value, as well as SDNodes for each of the post-isel label, label id, and label flavor. llvm-svn: 52943
* Rename ISD::LOCATION to ISD::DBG_STOPPOINT to better reflect itsDan Gohman2008-06-301-15/+10
| | | | | | | | | | | | | | | | | purpose, and give it a custom SDNode subclass so that it doesn't need to have line number, column number, filename string, and directory string, all existing as individual SDNodes to be the operands. This was the only user of ISD::STRING, StringSDNode, etc., so remove those and some associated code. This makes stop-points considerably easier to read in -view-legalize-dags output, and reduces overhead (creating new nodes and copying std::strings into them) on code containing debugging information. llvm-svn: 52924
* Revert the SelectionDAG optimization that makesDuncan Sands2008-06-301-9/+6
| | | | | | | | | | | | | | | | | | it impossible to create a MERGE_VALUES node with only one result: sometimes it is useful to be able to create a node with only one result out of one of the results of a node with more than one result, for example because the new node will eventually be used to replace a one-result node using ReplaceAllUsesWith, cf X86TargetLowering::ExpandFP_TO_SINT. On the other hand, most users of MERGE_VALUES don't need this and for them the optimization was valuable. So add a new utility method getMergeValues for creating MERGE_VALUES nodes which by default performs the optimization. Change almost everywhere to use getMergeValues (and tidy some stuff up at the same time). llvm-svn: 52893
* Implement split and scalarize for SELECT_CC, fixing PR2504Chris Lattner2008-06-301-0/+23
| | | | llvm-svn: 52887
* Remove the OrigVT member from AtomicSDNode, as it is redundant withDan Gohman2008-06-251-2/+2
| | | | | | the base SDNode's VTList. llvm-svn: 52722
* Added MemOperands to Atomic operations since Atomics touches memory.Mon P Wang2008-06-251-13/+17
| | | | | | | | Added abstract class MemSDNode for any Node that have an associated MemOperand Changed atomic.lcs => atomic.cmp.swap, atomic.las => atomic.load.add, and atomic.lss => atomic.load.sub llvm-svn: 52706
* Make custom lowering of ADD work correctly. ThisDuncan Sands2008-06-221-3/+3
| | | | | | | | | | fixes PR2476; patch by Richard Osborne. The same problem exists for a bunch of other operators, but I'm ignoring this because they will be automagically fixed when the new LegalizeTypes infrastructure lands, since it already solves this problem centrally. llvm-svn: 52610
* Clean up some uses of std::distance, now that we have allnodes_size.Dan Gohman2008-06-201-2/+1
| | | | llvm-svn: 52545
* ISD::UNDEF should be expanded recursively / iteratively.Evan Cheng2008-06-191-1/+0
| | | | llvm-svn: 52508
* add missing atomic intrinsic from gccAndrew Lenharth2008-06-141-0/+2
| | | | llvm-svn: 52270
OpenPOWER on IntegriCloud