summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Fixed a bug in MergeValueInAsValue() pointed out by David Greene. Replace ↵Evan Cheng2008-01-301-3/+3
| | | | | | val# with previous liverange's. llvm-svn: 46579
* 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
* Adjust loop per review feedback.Dale Johannesen2008-01-301-4/+2
| | | | llvm-svn: 46569
* 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
* Accept getelementptr starting at GV with all 0 indices as aDale Johannesen2008-01-301-0/+14
| | | | | | legitimate way of representing global variable GV in debug info. llvm-svn: 46565
* 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
* Add a new PseudoSourceValue class, which will be used to help trackDan Gohman2008-01-301-0/+33
| | | | | | | memory reference information in the backend. Most of this was written by Florian Brander, cleanup and updating to TOT by me. llvm-svn: 46556
* 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-298-11/+11
| | | | 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
* Use getPreferredAlignmentLog or getPreferredAlignmentDuncan Sands2008-01-292-5/+3
| | | | | | | to get the alignment of global variables, rather than using hand-made versions. llvm-svn: 46495
* RegAllocBigBlock doesn't need LiveVariables either.Owen Anderson2008-01-291-13/+2
| | | | llvm-svn: 46488
* 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-293-21/+50
| | | | 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
* Reg alloc doesn't really need LiveVariables.Owen Anderson2008-01-271-9/+2
| | | | llvm-svn: 46420
* 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
* For long double constants, print an approximation of their value to the .s ↵Chris Lattner2008-01-271-2/+6
| | | | | | file to make it easier to read. llvm-svn: 46407
* 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
* move MachineFrameInfo::CreateFixedObject out of line, give MachineFrameInfoChris Lattner2008-01-251-1/+14
| | | | | | | a reference to TargetFrameInfo. Rearrange order of fields in StackObject to save a word. llvm-svn: 46348
* include alignment and volatility information in -view-*-dags outputChris Lattner2008-01-251-3/+10
| | | | llvm-svn: 46347
* Don't dump the function!Chris Lattner2008-01-241-2/+0
| | | | llvm-svn: 46320
* 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
* Move some functionality for adding flags to MachineInstr's into methods on ↵Owen Anderson2008-01-243-107/+105
| | | | | | MachineInstr rather than LiveVariables. llvm-svn: 46295
* Forgot these.Evan Cheng2008-01-242-4/+8
| | | | llvm-svn: 46292
* The last pieces needed for loading arbitraryDuncan Sands2008-01-231-64/+176
| | | | | | | | | | | | | | | precision integers. This won't actually work (and most of the code is dead) unless the new legalization machinery is turned on. While there, I rationalized the handling of i1, and removed some bogus (and unused) sextload patterns. For i1, this could result in microscopically better code for some architectures (not X86). It might also result in worse code if annotating with AssertZExt nodes turns out to be more harmful than helpful. llvm-svn: 46280
* Fix an iterator invalidation issue.Owen Anderson2008-01-221-2/+8
| | | | llvm-svn: 46263
* Simplify SelectionDAG::getNode so that a big switch stmt is not #ifndef Chris Lattner2008-01-221-119/+88
| | | | | | | | NDEBUG. This is in response to a really nasty bug I introduced that Dale tracked down, hopefully this won't happen in the future. Many thanks Dale. llvm-svn: 46254
* The final piece needed for storing arbitrary precisionDuncan Sands2008-01-221-29/+90
| | | | | | | | integers. Handle truncstore of a legal type to an unusual number of bits. Most of this code is not reachable unless the new legalize infrastructure is turned on. llvm-svn: 46249
* Clarify a deviation from the original algorithm.Owen Anderson2008-01-211-1/+4
| | | | llvm-svn: 46218
* Improve a few comments.Owen Anderson2008-01-211-1/+6
| | | | llvm-svn: 46217
* Move DAG-changing code out of #ifndef NDEBUG.Dale Johannesen2008-01-211-1/+3
| | | | llvm-svn: 46204
* Do not generate a FP_ROUND of f64 to f64.Dale Johannesen2008-01-201-3/+4
| | | | llvm-svn: 46195
* remove extraneous &'s.Chris Lattner2008-01-181-2/+2
| | | | llvm-svn: 46171
* This commit changes:Chris Lattner2008-01-173-22/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Legalize now always promotes truncstore of i1 to i8. 2. Remove patterns and gunk related to truncstore i1 from targets. 3. Rename the StoreXAction stuff to TruncStoreAction in TLI. 4. Make the TLI TruncStoreAction table a 2d table to handle from/to conversions. 5. Mark a wide variety of invalid truncstores as such in various targets, e.g. X86 currently doesn't support truncstore of any of its integer types. 6. Add legalize support for truncstores with invalid value input types. 7. Add a dag combine transform to turn store(truncate) into truncstore when safe. The later allows us to compile CodeGen/X86/storetrunc-fp.ll to: _foo: fldt 20(%esp) fldt 4(%esp) faddp %st(1) movl 36(%esp), %eax fstps (%eax) ret instead of: _foo: subl $4, %esp fldt 24(%esp) fldt 8(%esp) faddp %st(1) fstps (%esp) movl 40(%esp), %eax movss (%esp), %xmm0 movss %xmm0, (%eax) addl $4, %esp ret llvm-svn: 46140
* code cleanups, no functionality change.Chris Lattner2008-01-171-7/+9
| | | | llvm-svn: 46126
* * Introduce a new SelectionDAG::getIntPtrConstant methodChris Lattner2008-01-178-114/+133
| | | | | | | | | | | | | and switch various codegen pieces and the X86 backend over to using it. * Add some comments to SelectionDAGNodes.h * Introduce a second argument to FP_ROUND, which indicates whether the FP_ROUND changes the value of its input. If not it is safe to xform things like fp_extend(fp_round(x)) -> x. llvm-svn: 46125
* When a live virtual register is being clobbered by an implicit def, it is ↵Evan Cheng2008-01-171-2/+20
| | | | | | | | | | | spilled and the spill is its kill. However, if the local allocator has determined the register has not been modified (possible when its value was reloaded), it would not issue a restore. In that case, mark the last use of the virtual register as kill. llvm-svn: 46111
* Replace std::vector<bool> with BitVector.Evan Cheng2008-01-171-4/+8
| | | | llvm-svn: 46104
OpenPOWER on IntegriCloud