summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
Commit message (Collapse)AuthorAgeFilesLines
* Rename MRegisterInfo to TargetRegisterInfo.Dan Gohman2008-02-108-55/+58
| | | | llvm-svn: 46930
* Add truncate and AssertZext result expansion.Duncan Sands2008-02-103-0/+33
| | | | llvm-svn: 46926
* Return "(c1 + c2)" instead of yet another ADD node (which made this aBill Wendling2008-02-101-1/+1
| | | | | | no-op). llvm-svn: 46922
* 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-072-19/+19
| | | | | | | 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-064-50/+171
| | | | | | | | 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
* I don't see how NodeUpdated can be called with aDuncan Sands2008-02-041-5/+10
| | | | | | | | | | | | | | | | | | | | ReadyToProcess node - add an assertion to check this. Add an assertion to NodeDeleted that checks that processed/ready nodes are indeed not deleted. It is because they are never deleted that none of the maps can have a deleted node as the source of a mapping. It does however seem to be possible in theory to have a deleted value as the target of a mapping, however this has not yet been spotted in the wild. Still mulling on what to do about this. [The theoretical situation is this: a node A is expanded/promoted/whatever to a newly created node B. Thus A->B is added to a map. When the subtree rooted at B is legalized it is conceivable that B is deleted due to RAUW on a node somewhere above it]. llvm-svn: 46705
* Fix typoChris Lattner2008-02-031-1/+1
| | | | llvm-svn: 46682
* handle the case where a node can become ready to processChris Lattner2008-02-032-3/+4
| | | | | | multiple times due to a RAUW. llvm-svn: 46680
* Use the new infrastructure for listening to node updates to Chris Lattner2008-02-032-31/+34
| | | | | | | | keep the LegalizeTypes node flags up to date when doing a RAUW. This fixes a nasty bug that Duncan ran into and makes the previous (nonbuggy case) more efficent. llvm-svn: 46679
* the world doesn't need my debugging code.Chris Lattner2008-02-031-1/+0
| | | | llvm-svn: 46678
* Change the 'global modification' APIs in SelectionDAG to take a newChris Lattner2008-02-032-162/+209
| | | | | | | | | | 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
* add a -view-legalize-types-dags option, for viewing the dags going into ↵Chris Lattner2008-02-031-0/+13
| | | | | | legalize types. llvm-svn: 46672
* SDIsel processes llvm.dbg.declare by recording the variable debug ↵Evan Cheng2008-02-024-6/+30
| | | | | | | | | 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
* Remove the nasty LABEL hack with a much less evil one. Now ↵Evan Cheng2008-02-012-28/+15
| | | | | | llvm.dbg.func.start implies a stoppoint is set. SelectionDAGISel records a new source line but does not create a ISD::LABEL node for this special stoppoint. Asm printer will magically print this label. This ensures nothing is emitted before. llvm-svn: 46635
* Rename RecordLabel to RecordSourceLine because that's what it is doing.Evan Cheng2008-02-011-1/+1
| | | | llvm-svn: 46628
* Revert 46556 and 46585. Dan please fix the PseudoSourceValue problem and ↵Evan Cheng2008-01-314-159/+48
| | | | | | re-commit. llvm-svn: 46623
* Add a comment for a nasty short term hack.Evan Cheng2008-01-311-0/+4
| | | | llvm-svn: 46610
* Add an extra operand to LABEL nodes which distinguishes between debug, EH, ↵Evan Cheng2008-01-314-19/+41
| | | | | | or misc labels. This fixes the EH breakage. However I am not convinced this is *the* solution. llvm-svn: 46609
* Add more thorough error checking for NULL register classes.Christopher Lamb2008-01-311-1/+2
| | | | llvm-svn: 46605
* Rename ISD::FLT_ROUNDS to ISD::FLT_ROUNDS_ to avoid conflictingDan Gohman2008-01-313-3/+3
| | | | | | with the real FLT_ROUNDS (defined in <float.h>). llvm-svn: 46587
* Create a new class, MemOperand, for describing memory referencesDan Gohman2008-01-314-48/+159
| | | | | | | | | | | | | | | | 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
* Treat the label for the first @llvm.dbg.stoppoint the same way as the ↵Evan Cheng2008-01-301-4/+4
| | | | | | | | | | dbg_func_start label. Make sure nothing else is inserted before them. Note this solution might be somewhat fragile since ISD::LABEL may be used for other purposes. If that ends up to be an issue, we may need to introduce a different node for debug labels. llvm-svn: 46571
* A semi-gross fix for a debug info issue. When inserting the "function start" ↵Evan Cheng2008-01-301-9/+26
| | | | | | label (i.e. first label in the entry block) take care to insert it at the beginning of the block. llvm-svn: 46568
* Even though InsertAtEndOfBasicBlock is an ugly hack it still deserves a ↵Evan Cheng2008-01-302-5/+5
| | | | | | | | proper name. Rename it to EmitInstrWithCustomInserter since it does not necessarily insert instruction at the end. llvm-svn: 46562
* Factor the addressing mode and the load/store VT out of LoadSDNodeDan Gohman2008-01-307-66/+66
| | | | | | | | 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
* When expanding an operand, it's not the result valueDuncan Sands2008-01-291-2/+2
| | | | | | | | | | | type that matters but the operand type. This fixes 2008-01-08-IllegalCMP.ll which crashed with the new legalize infrastructure because SETCC with result type i8 and operand type i64 was being custom expanded by the X86 backend. With this fix, the gcc build gets as far as the first libcall. llvm-svn: 46525
* Use empty() instead of comparing size() with zero.Dan Gohman2008-01-295-6/+6
| | | | llvm-svn: 46514
* Fix a typo in a comment.Dan Gohman2008-01-291-1/+1
| | | | llvm-svn: 46513
* Fix a typo in a comment.Dan Gohman2008-01-291-1/+0
| | | | llvm-svn: 46508
* Properly expand extract-element for non-power-of-2 codegenNate Begeman2008-01-291-2/+3
| | | | llvm-svn: 46486
* Handle 'X' constraint in asm's better.Dale Johannesen2008-01-292-19/+47
| | | | llvm-svn: 46485
* Fix PowerPC/./2007-10-18-PtrArithmetic.llChris Lattner2008-01-271-7/+14
| | | | llvm-svn: 46424
* fix a crash on CodeGen/X86/vector-rem.llChris Lattner2008-01-271-4/+6
| | | | llvm-svn: 46422
* Implement some dag combines that allow doing fneg/fabs/fcopysign in integerChris Lattner2008-01-271-2/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | registers if used by a bitconvert or using a bitconvert. This allows us to avoid constant pool loads and use cheaper integer instructions when the values come from or end up in integer regs anyway. For example, we now compile CodeGen/X86/fp-in-intregs.ll to: _test1: movl $2147483648, %eax xorl 4(%esp), %eax ret _test2: movl $1065353216, %eax orl 4(%esp), %eax andl $3212836864, %eax ret Instead of: _test1: movss 4(%esp), %xmm0 xorps LCPI2_0, %xmm0 movd %xmm0, %eax ret _test2: movss 4(%esp), %xmm0 andps LCPI3_0, %xmm0 movss LCPI3_1, %xmm1 andps LCPI3_2, %xmm1 orps %xmm0, %xmm1 movd %xmm1, %eax ret bitconverts can happen due to various calling conventions that require fp values to passed in integer regs in some cases, e.g. when returning a complex. llvm-svn: 46414
* Infer alignment of loads and increase their alignment when we can tell they are Chris Lattner2008-01-261-4/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | from the stack. This allows us to compile stack-align.ll to: _test: movsd LCPI1_0, %xmm0 movapd %xmm0, %xmm1 *** andpd 4(%esp), %xmm1 andpd _G, %xmm0 addsd %xmm1, %xmm0 movl 20(%esp), %eax movsd %xmm0, (%eax) ret instead of: _test: movsd LCPI1_0, %xmm0 ** movsd 4(%esp), %xmm1 ** andpd %xmm0, %xmm1 andpd _G, %xmm0 addsd %xmm1, %xmm0 movl 20(%esp), %eax movsd %xmm0, (%eax) ret llvm-svn: 46401
* Fix some bugs in SimplifyNodeWithTwoResults where it would call deletenode to Chris Lattner2008-01-261-41/+31
| | | | | | | | | | delete a node even if it was not dead in some cases. Instead, just add it to the worklist. Also, make sure to use the CombineTo methods, as it was doing things that were unsafe: the top level combine loop could touch dangling memory. This fixes CodeGen/Generic/2008-01-25-dag-combine-mul.ll llvm-svn: 46384
* 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
* reduce indentationChris Lattner2008-01-251-42/+44
| | | | llvm-svn: 46377
* fix long lines.Chris Lattner2008-01-251-2/+3
| | | | llvm-svn: 46355
* Add skeletal code to increase the alignment of loads and stores whenChris Lattner2008-01-251-0/+38
| | | | | | | we can infer it. This will eventually help stuff, though it doesn't do much right now because all fixed FI's have an alignment of 1. llvm-svn: 46349
* include alignment and volatility information in -view-*-dags outputChris Lattner2008-01-251-3/+10
| | | | llvm-svn: 46347
* clarify a comment, thanks Duncan.Chris Lattner2008-01-241-2/+3
| | | | llvm-svn: 46313
* Fix this buggy transformation. Two observations:Chris Lattner2008-01-241-17/+8
| | | | | | | | | | | | 1. we already know the value is dead, so don't bother replacing it with undef. 2. The very case the comment describes actually makes the load live which asserts in deletenode. If we do the replacement and the node becomes live, just treat it as new. This fixes a failure on X86/2008-01-16-InvalidDAGCombineXform.ll with some local changes in my tree. llvm-svn: 46306
* The dag combiner is missing revisiting nodes that it really should, and thus ↵Chris Lattner2008-01-241-0/+5
| | | | | | | | | | leaving dead stuff around. This gets fed into the isel pass and causes certain foldings from happening because nodes have extraneous uses floating around. For example, if we turned foo(bar(x)) -> baz(x), we sometimes left bar(x) around. llvm-svn: 46305
* fold fp_round(fp_round(x)) -> fp_round(x).Chris Lattner2008-01-241-0/+9
| | | | llvm-svn: 46304
OpenPOWER on IntegriCloud