summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make DBG_STOPPOINT nodes, and therefore DBG_LABEL labels, get a DebugLoc, so ↵Chris Lattner2009-05-041-1/+2
| | | | | | | | | that it shows up in -print-machineinstrs. This doesn't appear to affect anything, but it was weird for some DBG_LABELs to have DebugLocs but not all of them. llvm-svn: 70921
* Update comment, replace theoretically impossible check with an assert.Nate Begeman2009-04-291-3/+1
| | | | llvm-svn: 70391
* Implement review feedback for vector shuffle work.Nate Begeman2009-04-291-25/+33
| | | | llvm-svn: 70372
* Add a public method called getAddressSpace() to the GlobalAddressSDNode.Sanjiv Gupta2009-04-291-0/+7
| | | | llvm-svn: 70366
* 2nd attempt, fixing SSE4.1 issues and implementing feedback from duncan.Nate Begeman2009-04-271-19/+135
| | | | | | | | | | | | | | PR2957 ISD::VECTOR_SHUFFLE now stores an array of integers representing the shuffle mask internal to the node, rather than taking a BUILD_VECTOR of ConstantSDNodes as the shuffle mask. A value of -1 represents UNDEF. In addition to eliminating the creation of illegal BUILD_VECTORS just to represent shuffle masks, we are better about canonicalizing the shuffle mask, resulting in substantially better code for some classes of shuffles. llvm-svn: 70225
* Fix PR 4057, a crash doing float->char const folding.Dale Johannesen2009-04-241-3/+4
| | | | | | | | This particular one is undefined behavior (although this isn't related to the crash), so it will no longer do it at compile time, which seems better. llvm-svn: 69990
* Revert 69952. Causes testsuite failures on linux x86-64.Rafael Espindola2009-04-241-131/+22
| | | | llvm-svn: 69967
* PR2957Nate Begeman2009-04-241-22/+131
| | | | | | | | | | | | | | ISD::VECTOR_SHUFFLE now stores an array of integers representing the shuffle mask internal to the node, rather than taking a BUILD_VECTOR of ConstantSDNodes as the shuffle mask. A value of -1 represents UNDEF. In addition to eliminating the creation of illegal BUILD_VECTORS just to represent shuffle masks, we are better about canonicalizing the shuffle mask, resulting in substantially better code for some classes of shuffles. A clean up of x86 shuffle code, and some canonicalizing in DAGCombiner is next. llvm-svn: 69952
* Simplify this code. getConstant knows how to makeDan Gohman2009-04-201-10/+3
| | | | | | broadcasted vector constants. llvm-svn: 69634
* Revise my previous change 68996 as suggested by Duncan.Bob Wilson2009-04-201-1/+2
| | | | llvm-svn: 69607
* Now that BUILD_VECTOR operands are allowed to beDuncan Sands2009-04-191-9/+6
| | | | | | | | bigger than the vector element type, turn checking of the operand type back on again, appropriately adjusted. llvm-svn: 69516
* Don't try to make BUILD_VECTOR operands have the sameDuncan Sands2009-04-181-1/+4
| | | | | | | | | | | | | | | | | type as the vector element type: allow them to be of a wider integer type than the element type all the way through the system, and not just as far as LegalizeDAG. This should be safe because it used to be this way (the old type legalizer would produce such nodes), so backends should be able to handle it. In fact only targets which have legal vector types with an illegal promoted element type will ever see this (eg: <4 x i16> on ppc). This fixes a regression with the new type legalizer (vec_splat.ll). Also, treat SCALAR_TO_VECTOR the same as BUILD_VECTOR. After all, it is just a special case of BUILD_VECTOR. llvm-svn: 69467
* Generalize one of the SelectionDAG::ReplaceAllUsesWith overloadsDan Gohman2009-04-151-5/+8
| | | | | | | | to support replacing a node with another that has a superset of the result types. Use this instead of calling ReplaceAllUsesOfValueWith for each value. llvm-svn: 69209
* Change SelectionDAG type legalization to allow BUILD_VECTOR operands to beBob Wilson2009-04-131-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | promoted to legal types without changing the type of the vector. This is following a suggestion from Duncan (http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-February/019923.html). The transformation that used to be done during type legalization is now postponed to DAG legalization. This allows the BUILD_VECTORs to be optimized and potentially handled specially by target-specific code. It turns out that this is also consistent with an optimization done by the DAG combiner: a BUILD_VECTOR and INSERT_VECTOR_ELT may be combined by replacing one of the BUILD_VECTOR operands with the newly inserted element; but INSERT_VECTOR_ELT allows its scalar operand to be larger than the element type, with any extra high bits being implicitly truncated. The result is a BUILD_VECTOR where one of the operands has a type larger the the vector element type. Any code that operates on BUILD_VECTORs may now need to be aware of the potential type discrepancy between the vector element type and the BUILD_VECTOR operands. This patch updates all of the places that I could find to handle that case. llvm-svn: 68996
* Remove the obsolete SelectionDAG::getNodeValueTypes and simplifyDan Gohman2009-04-091-28/+21
| | | | | | code that uses it by using SelectionDAG::getVTList instead. llvm-svn: 68744
* Delete ISD::INSERT_SUBREG and ISD::EXTRACT_SUBREG, which are unused.Dan Gohman2009-04-031-3/+0
| | | | | | | Note that these are distinct from TargetInstrInfo::INSERT_SUBREG and TargetInstrInfo::EXTRACT_SUBREG, which are used. llvm-svn: 68355
* Now that errs() is properly non-buffered, there's no need toDan Gohman2009-03-231-2/+0
| | | | | | explicitly flush it. llvm-svn: 67526
* Fix some significant problems with constant pools that resulted in ↵Evan Cheng2009-03-131-4/+2
| | | | | | | | | | | | | | | | | | | | | | | unnecessary paddings between constant pool entries, larger than necessary alignments (e.g. 8 byte alignment for .literal4 sections), and potentially other issues. 1. ConstantPoolSDNode alignment field is log2 value of the alignment requirement. This is not consistent with other SDNode variants. 2. MachineConstantPool alignment field is also a log2 value. 3. However, some places are creating ConstantPoolSDNode with alignment value rather than log2 values. This creates entries with artificially large alignments, e.g. 256 for SSE vector values. 4. Constant pool entry offsets are computed when they are created. However, asm printer group them by sections. That means the offsets are no longer valid. However, asm printer uses them to determine size of padding between entries. 5. Asm printer uses expensive data structure multimap to track constant pool entries by sections. 6. Asm printer iterate over SmallPtrSet when it's emitting constant pool entries. This is non-deterministic. Solutions: 1. ConstantPoolSDNode alignment field is changed to keep non-log2 value. 2. MachineConstantPool alignment field is also changed to keep non-log2 value. 3. Functions that create ConstantPool nodes are passing in non-log2 alignments. 4. MachineConstantPoolEntry no longer keeps an offset field. It's replaced with an alignment field. Offsets are not computed when constant pool entries are created. They are computed on the fly in asm printer and JIT. 5. Asm printer uses cheaper data structure to group constant pool entries. 6. Asm printer compute entry offsets after grouping is done. 7. Change JIT code to compute entry offsets on the fly. llvm-svn: 66875
* Oops...I committed too much.Bill Wendling2009-03-131-5/+2
| | | | llvm-svn: 66867
* Temporarily XFAIL this test.Bill Wendling2009-03-131-2/+5
| | | | llvm-svn: 66866
* Fix BuildVectorSDNode::isConstantSplat to handle one-element vectors.Bob Wilson2009-03-041-2/+2
| | | | | | | It is an error to call APInt::zext with a size that is equal to the value's current size, so use zextOrTrunc instead. llvm-svn: 66039
* Generalize BuildVectorSDNode::isConstantSplat to use APInts and handleBob Wilson2009-03-021-78/+49
| | | | | | | | arbitrary vector sizes. Add an optional MinSplatBits parameter to specify a minimum for the splat element size. Update the PPC target to use the revised interface. llvm-svn: 65899
* Combine PPC's GetConstantBuildVectorBits and isConstantSplat functions to a newBob Wilson2009-03-011-0/+91
| | | | | | method in a BuildVectorSDNode "pseudo-class". llvm-svn: 65747
* Revert BuildVectorSDNode related patches: 65426, 65427, and 65296.Evan Cheng2009-02-251-144/+12
| | | | llvm-svn: 65482
* Expand tabs to spaces (overlooked in previous commit)Scott Michel2009-02-251-12/+12
| | | | llvm-svn: 65427
* Remove all "cached" data from BuildVectorSDNode, preferring to retrieveScott Michel2009-02-251-13/+8
| | | | | | | | | results via reference parameters. This patch also appears to fix Evan's reported problem supplied as a reduced bugpoint test case. llvm-svn: 65426
* Fix a ValueTracking rule: RHS means operand 1, not 0. Add a simpleDan Gohman2009-02-241-1/+1
| | | | | | | ashr instcombine to help expose this code. And apply the fix to SelectionDAG's copy of this code too. llvm-svn: 65364
* Introduce the BuildVectorSDNode class that encapsulates the ISD::BUILD_VECTORScott Michel2009-02-221-8/+145
| | | | | | | | | instruction. The class also consolidates the code for detecting constant splats that's shared across PowerPC and the CellSPU backends (and might be useful for other backends.) Also introduces SelectionDAG::getBUID_VECTOR() for generating new BUILD_VECTOR nodes. llvm-svn: 65296
* Remove trailing whitespace to reduce later commit patch noise.Scott Michel2009-02-171-169/+169
| | | | | | | | (Note: Eventually, commits like this will be handled via a pre-commit hook that does this automagically, as well as expand tabs to spaces and look for 80-col violations.) llvm-svn: 64827
* Use getDebugLoc forwarder instead of getNode()->getDebugLoc.Dale Johannesen2009-02-071-1/+1
| | | | | | No functional change. llvm-svn: 64026
* Make SDNode constructors take a DebugLoc always.Dale Johannesen2009-02-071-36/+4
| | | | | | | | | Adjust derived classes to pass UnknownLoc where a DebugLoc does not make sense. Pick one of DebugLoc and non-DebugLoc variants to survive for all such classes. llvm-svn: 64000
* Remove now-unused constructors.Dale Johannesen2009-02-071-21/+0
| | | | llvm-svn: 63995
* Get rid of the last non-DebugLoc versions of getNode!Dale Johannesen2009-02-071-14/+1
| | | | | | | | | | | | Many targets build placeholder nodes for special operands, e.g. GlobalBaseReg on X86 and PPC for the PIC base. There's no sensible way to associate debug info with these. I've left them built with getNode calls with explicit DebugLoc::getUnknownLoc operands. I'm not too happy about this but don't see a good improvement; I considered adding a getPseudoOperand or something, but it seems to me that'll just make it harder to read. llvm-svn: 63992
* Remove more non-DebugLoc getNode variants. UseDale Johannesen2009-02-061-27/+16
| | | | | | | | getCALLSEQ_{END,START} to permit passing no DebugLoc there. UNDEF doesn't logically have DebugLoc; add getUNDEF to encapsulate this. llvm-svn: 63978
* Remove more non-DebugLoc versions of getNode.Dale Johannesen2009-02-061-22/+0
| | | | llvm-svn: 63969
* Eliminate remaining non-DebugLoc version of getTargetNode.Dale Johannesen2009-02-061-39/+0
| | | | llvm-svn: 63951
* get rid of some non-DebugLoc getTargetNode variants.Dale Johannesen2009-02-061-41/+0
| | | | llvm-svn: 63909
* Get rid of one more non-DebugLoc getNode andDale Johannesen2009-02-061-11/+5
| | | | | | | its corresponding getTargetNode. Lots of caller changes. llvm-svn: 63904
* Remove a non-DebugLoc version of getNode.Dale Johannesen2009-02-051-6/+0
| | | | llvm-svn: 63889
* Remove 3 non-DebugLoc variants of getNode.Dale Johannesen2009-02-051-14/+0
| | | | llvm-svn: 63886
* Fix a bug where we were not emitting a cvt rnd sat node for convertingMon P Wang2009-02-051-2/+4
| | | | | | between a unsigned integer and signed integer. llvm-svn: 63831
* Get rid of 3 non-DebugLoc getNode variants.Dale Johannesen2009-02-051-17/+0
| | | | llvm-svn: 63808
* Remove non-DebugLoc versions of getMergeValues, ZeroExtendInReg.Dale Johannesen2009-02-051-20/+0
| | | | llvm-svn: 63800
* Remove non-DebugLoc forms of CopyToReg and CopyFromReg.Dale Johannesen2009-02-041-1/+1
| | | | | | Adjust callers. llvm-svn: 63789
* 80 column rule.Stuart Hastings2009-02-041-1/+2
| | | | llvm-svn: 63768
* Remove non-DebugLoc versions of getLoad and getStore.Dale Johannesen2009-02-041-85/+0
| | | | | | Adjust the many callers of those versions. llvm-svn: 63767
* Since I'm obliged to work with a development OS that currently doesn'tStuart Hastings2009-02-041-9/+56
| | | | | | | | | | support GraphViz, I've been using the foo->dump() facility. This patch is a minor rewrite to the SelectionDAG dump() stuff to make it a little more helpful. The existing foo->dump() functionality does not change; this patch adds foo->dumpr(). All of this is only useful when running LLVM under a debugger. llvm-svn: 63736
* Remove non-DebugLoc forms of the exotic formsDale Johannesen2009-02-041-82/+0
| | | | | | of Lod and Sto; patch uses. llvm-svn: 63716
* Remove some more non-DebugLoc versions of constructionDale Johannesen2009-02-041-40/+0
| | | | | | functions, with callers adjusted to fit. llvm-svn: 63705
* Remove a few non-DebugLoc versions of node creationDale Johannesen2009-02-041-138/+0
| | | | | | functions. llvm-svn: 63703
OpenPOWER on IntegriCloud