summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename ISD::LOCATION to ISD::DBG_STOPPOINT to better reflect itsDan Gohman2008-06-301-15/+27
| | | | | | | | | | | | | | | | | 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-2/+1
| | | | | | | | | | | | | | | | | | 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
* - Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an ↵Evan Cheng2008-06-301-29/+34
| | | | | | | | empty string for ConstantAggregateZero case which surprises selectiondag. - Correctly handle memcpy from constant string which is zero-initialized. llvm-svn: 52891
* Revert (52748 and friends):Anton Korobeynikov2008-06-291-7/+13
| | | | | | | | | | | | Move GetConstantStringInfo to lib/Analysis. Remove string output routine from Constant. Update all callers. Change debug intrinsic api slightly to accomodate move of routine, these now return values instead of strings. This unbreaks llvm-gcc bootstrap. llvm-svn: 52884
* Really fix the bootstrap failure.Chris Lattner2008-06-281-9/+5
| | | | llvm-svn: 52854
* Add back the capability to include nul characters in strings with Chris Lattner2008-06-281-1/+1
| | | | | | | GetConstantStringInfo. This will hopefully restore llvm-gcc to happy bootstrap land. llvm-svn: 52851
* simplify this check, GetConstantStringInfo validates that aChris Lattner2008-06-271-5/+3
| | | | | | global is constant already. No functionality change. llvm-svn: 52812
* Move GetConstantStringInfo to lib/Analysis. RemoveEric Christopher2008-06-261-2/+2
| | | | | | | | | string output routine from Constant. Update all callers. Change debug intrinsic api slightly to accomodate move of routine, these now return values instead of strings. llvm-svn: 52748
* - Fix a x86 vector isel bug: illegal transformation of a vector_shuffle into aEvan Cheng2008-06-251-11/+11
| | | | | | | | shift. - Add a readme entry for a missing vector_shuffle optimization that results in awful codegen. llvm-svn: 52740
* Add support for expanding PPC 128 bit floats.Duncan Sands2008-06-251-4/+3
| | | | | | | | | | | | | | | | | | | | For this it is convenient to permit floats to be used with EXTRACT_ELEMENT, so I tweaked things to allow that. I also added libcalls for ppcf128 to i32 forms of FP_TO_XINT, since they exist in libgcc and this case can certainly occur (and does occur in the testsuite) - before the i64 libcall was being used. Also, the XINT_TO_FP result seemed to be wrong when the argument is an i128: the wrong fudge factor was added (the i32 and i64 cases were handled directly, but the i128 code fell through to some generic softening code which seemed to think it was i64 to f32!). So I fixed it by adding a fudge factor that I found in my breakfast cereal. llvm-svn: 52739
* Remove the OrigVT member from AtomicSDNode, as it is redundant withDan Gohman2008-06-251-7/+5
| | | | | | the base SDNode's VTList. llvm-svn: 52722
* Added MemOperands to Atomic operations since Atomics touches memory.Mon P Wang2008-06-251-13/+66
| | | | | | | | 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
* Use clear() to zero an existing APInt.Dan Gohman2008-06-211-1/+1
| | | | llvm-svn: 52601
* add missing atomic intrinsic from gccAndrew Lenharth2008-06-141-0/+2
| | | | llvm-svn: 52270
* Sometimes (rarely) nodes held in LegalizeTypesDuncan Sands2008-06-111-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | maps can be deleted. This happens when RAUW replaces a node N with another equivalent node E, deleting the first node. Solve this by adding (N, E) to ReplacedNodes, which is already used to remap nodes to replacements. This means that deleted nodes are being allowed in maps, which can be delicate: the memory may be reused for a new node which might get confused with the old deleted node pointer hanging around in the maps, so detect this and flush out maps if it occurs (ExpungeNode). The expunging operation is expensive, however it never occurs during a llvm-gcc bootstrap or anywhere in the nightly testsuite. It occurs three times in "make check": Alpha/illegal-element-type.ll, PowerPC/illegal-element-type.ll and X86/mmx-shift.ll. If expunging proves to be too expensive then there are other more complicated ways of solving the problem. In the normal case this patch adds the overhead of a few more map lookups, which is hopefully negligable. llvm-svn: 52214
* Remove comparison methods for MVT. The main causeDuncan Sands2008-06-081-21/+15
| | | | | | | | | | | of apint codegen failure is the DAG combiner doing the wrong thing because it was comparing MVT's using < rather than comparing the number of bits. Removing the < method makes this mistake impossible to commit. Instead, add helper methods for comparing bits and use them. llvm-svn: 52098
* Tighten up the abstraction slightly.Duncan Sands2008-06-061-10/+10
| | | | llvm-svn: 52045
* Wrap MVT::ValueType in a struct to get type safetyDuncan Sands2008-06-061-274/+260
| | | | | | | | | | | | | | | | and better control the abstraction. Rename the type to MVT. To update out-of-tree patches, the main thing to do is to rename MVT::ValueType to MVT, and rewrite expressions like MVT::getSizeInBits(VT) in the form VT.getSizeInBits(). Use VT.getSimpleVT() to extract a MVT::SimpleValueType for use in switch statements (you will get an assert failure if VT is an extended value type - these shouldn't exist after type legalization). This results in a small speedup of codegen and no new testsuite failures (x86-64 linux). llvm-svn: 52044
* Fix a memcpy lowering bug. Even though the memcpy alignment is smaller than ↵Evan Cheng2008-06-041-2/+3
| | | | | | the desired alignment, the frame destination alignment may still be larger than the desired alignment. Don't change its alignment to something smaller. llvm-svn: 51970
* Fold adds and subtracts of zero immediately, instead of waitingDan Gohman2008-06-021-4/+4
| | | | | | for dagcombine to do this. llvm-svn: 51886
* Remove an unused variable.Dan Gohman2008-05-311-1/+0
| | | | llvm-svn: 51807
* Expand small memmovs using inline code. Set the X86 threshold for expandingDan Gohman2008-05-291-5/+73
| | | | | | memmove to a more plausible value, now that it's actually being used. llvm-svn: 51696
* Implement vector shift up / down and insert zero with ps{rl}lq / ps{rl}ldq.Evan Cheng2008-05-291-3/+10
| | | | llvm-svn: 51667
* Fix some constructs that gcc-4.4 warns about.Duncan Sands2008-05-271-1/+1
| | | | llvm-svn: 51591
* Generalize the new code in instcombine's ComputeNumSignBits for handlingDan Gohman2008-05-231-7/+13
| | | | | | | and/or to handle more cases (such as this add-sitofp.ll testcase), and port it to selectiondag's ComputeNumSignBits. llvm-svn: 51469
* Port the fix for the select operator from instcombine'sDan Gohman2008-05-201-2/+2
| | | | | | ComputeNumSignBits to SelectionDAG's ComputeNumSignBits. llvm-svn: 51348
* Make use of vector load and store operations to implement memcpy, memmove, ↵Evan Cheng2008-05-151-90/+135
| | | | | | and memset. Currently only X86 target is taking advantage of these. llvm-svn: 51140
* When bit-twiddling CondCode values for integer comparisons producesDan Gohman2008-05-141-0/+1
| | | | | | SETOEQ, is it does with (SETEQ & SETULE), map it to SETEQ. llvm-svn: 51112
* Instead of a vector load, shuffle and then extract an element. Load the ↵Evan Cheng2008-05-131-0/+22
| | | | | | | | | | | element from address with an offset. pshufd $1, (%rdi), %xmm0 movd %xmm0, %eax => movl 4(%rdi), %eax llvm-svn: 51026
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-1/+1
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Add support for vicmp/vfcmp codegen, more legalize support coming.Nate Begeman2008-05-121-0/+1
| | | | | | This is necessary to unbreak the build. llvm-svn: 50988
* Fix a bug in the ComputeMaskedBits logic for multiply.Dan Gohman2008-05-071-2/+2
| | | | llvm-svn: 50793
* Correct the value of LowBits in srem and urem handling inDan Gohman2008-05-061-3/+3
| | | | | | ComputeMaskedBits. llvm-svn: 50692
* Added addition atomic instrinsics and, or, xor, min, and max.Mon P Wang2008-05-051-2/+14
| | | | llvm-svn: 50663
* Fix a mistake in the computation of leading zeros for udiv.Dan Gohman2008-05-021-3/+5
| | | | llvm-svn: 50591
* Fix a typo in a comment.Dan Gohman2008-05-021-1/+1
| | | | llvm-svn: 50562
* Fix the SVOffset values for loads and stores produced byDan Gohman2008-04-281-18/+20
| | | | | | | memcpy/memset expansion. It was a bug for the SVOffset value to be used in the actual address calculations. llvm-svn: 50359
* Teach InstCombine's ComputeMaskedBits what SelectionDAG'sDan Gohman2008-04-281-33/+124
| | | | | | | | | | | ComputeMaskedBits knows about cttz, ctlz, and ctpop. Teach SelectionDAG's ComputeMaskedBits what InstCombine's knows about SRem. And teach them both some things about high bits in Mul, UDiv, URem, and Sub. This allows instcombine and dagcombine to eliminate sign-extension operations in several new cases. llvm-svn: 50358
* Check we aren't trying to convert PPC long double.Dale Johannesen2008-04-201-6/+3
| | | | | | This fixes the testsuite failure on ppcf128-4.ll. llvm-svn: 49994
* Remove the implicit conversion from SDOperandPtr to SDOperand*; thisDan Gohman2008-04-171-4/+4
| | | | | | may fix a build error on Visual Studio. llvm-svn: 49876
* Ongoing work on improving the instruction selection infrastructure:Roman Levenstein2008-04-161-50/+50
| | | | | | | | | | Rename SDOperandImpl back to SDOperand. Introduce the SDUse class that represents a use of the SDNode referred by an SDOperand. Now it is more similar to Use/Value classes. Patch is approved by Dan Gohman. llvm-svn: 49795
* Avoid creating MERGE_VALUES nodes for single values.Dan Gohman2008-04-141-1/+2
| | | | llvm-svn: 49676
* Fix const-correctness issues with the SrcValue handling in theDan Gohman2008-04-141-8/+8
| | | | | | memory intrinsic expansion code. llvm-svn: 49666
* Drop ISD::MEMSET, ISD::MEMMOVE, and ISD::MEMCPY, which are not LegalDan Gohman2008-04-121-22/+347
| | | | | | | | | | | | | | | | | | | | | | | | | | | on any current target and aren't optimized in DAGCombiner. Instead of using intermediate nodes, expand the operations, choosing between simple loads/stores, target-specific code, and library calls, immediately. Previously, the code to emit optimized code for these operations was only used at initial SelectionDAG construction time; now it is used at all times. This fixes some cases where rep;movs was being used for small copies where simple loads/stores would be better. This also cleans up code that checks for alignments less than 4; let the targets make that decision instead of doing it in target-independent code. This allows x86 to use rep;movs in low-alignment cases. Also, this fixes a bug that resulted in the use of rep;stos for memsets of 0 with non-constant memory size when the alignment was at least 4. It's better to use the library in this case, which can be significantly faster when the size is large. This also preserves more SourceValue information when memory intrinsics are lowered into simple loads/stores. llvm-svn: 49572
* detabifyGabor Greif2008-04-111-1/+1
| | | | llvm-svn: 49524
* Rename MemOperand to MachineMemOperand. This was suggested byDan Gohman2008-04-071-10/+11
| | | | | | | review feedback from Chris quite a while ago. No functionality change. llvm-svn: 49348
* Re-commit of the r48822, where the infinite looping problem discoveredRoman Levenstein2008-04-071-70/+84
| | | | | | by Dan Gohman is fixed. llvm-svn: 49330
* Backing out 48222 temporarily.Evan Cheng2008-04-031-99/+70
| | | | llvm-svn: 49124
* Rename getAnyLoad to getLoad is suggested by Evan.Duncan Sands2008-03-281-13/+13
| | | | llvm-svn: 48914
* Implement LegalizeTypes support for softfloat LOAD.Duncan Sands2008-03-271-78/+52
| | | | | | | | In order to handle indexed nodes I had to introduce a new constructor, and since I was there I factorized the code in the various load constructors. llvm-svn: 48894
OpenPOWER on IntegriCloud