summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Fixes a nasty dag combiner bug that causes a bunch of tests to fail at -O0.Evan Cheng2008-01-161-6/+44
| | | | | | | | | | | | | | | | | | | | It's not safe to use the two value CombineTo variant to combine away a dead load. e.g. v1, chain2 = load chain1, loc v2, chain3 = load chain2, loc v3 = add v2, c Now we replace use of v1 with undef, use of chain2 with chain1. ReplaceAllUsesWith() will iterate through uses of the first load and update operands: v1, chain2 = load chain1, loc v2, chain3 = load chain1, loc v3 = add v2, c Now the second load is the same as the first load, SelectionDAG cse will ensure the use of second load is replaced with the first load. v1, chain2 = load chain1, loc v3 = add v1, c Then v1 is replaced with undef and bad things happen. llvm-svn: 46099
* Do not mark EH tables no-dead-strip unless theDale Johannesen2008-01-162-13/+40
| | | | | | associated function is so marked. llvm-svn: 46088
* Fix a ppc long double regression I introduced yesterday due to aChris Lattner2008-01-161-0/+1
| | | | | | simplification. This fixes automotive-basicmath on PPC. llvm-svn: 46072
* merge a few pieces of code that do the store/load to stack Chris Lattner2008-01-161-30/+12
| | | | | | pattern to use EmitStackConvert now. llvm-svn: 46066
* rename ExpandBIT_CONVERT to EmitStackConvert, generalizing Chris Lattner2008-01-161-15/+37
| | | | | | it to allow it to emit different load and store kinds. llvm-svn: 46065
* simplify a bunch of code by using SelectionDAG::CreateStackTemporary Chris Lattner2008-01-161-28/+6
| | | | | | instead of inlining its body. llvm-svn: 46062
* Change legalizeop of FP_ROUND and FP_EXTEND to not fall throughChris Lattner2008-01-161-32/+55
| | | | | | | | | into the ANY_EXTEND/ZERO_EXTEND/SIGN_EXTEND code to simplify it. Unmerge the code for FP_ROUND and FP_EXTEND from each other to make each one simpler. llvm-svn: 46061
* Factor the ReachesChainWithoutSideEffects out of dag combiner into Chris Lattner2008-01-162-28/+32
| | | | | | | a public SDOperand::reachesChainWithoutSideEffects method. No functionality change. llvm-svn: 46050
* Fix and enable EH for x86-64 Darwin. AddsDale Johannesen2008-01-151-8/+12
| | | | | | | | | ShortenEHDataFor64Bits as a not-very-accurate abstraction to cover all the changes in DwarfWriter. Some cosmetic changes to Darwin assembly code for gcc testsuite compatibility. llvm-svn: 46029
* Move some calls to getVRegDef higher in the callgraph, so they don't get ↵Owen Anderson2008-01-151-11/+11
| | | | | | executed as frequently in performance sensitive code. llvm-svn: 46027
* The type of the 'abort' node should be pointer type (becauseChris Lattner2008-01-151-1/+2
| | | | | | | it's a function pointer) not MVT::Other. This fixes builtin_trap lowering on ppc, alpha, ia64 llvm-svn: 46018
* Remove DefInst from LiveVariables::VarInfo. Use the facilities on ↵Owen Anderson2008-01-153-35/+20
| | | | | | MachineRegisterInfo instead. llvm-svn: 46016
* Add support for targets that have a legal ISD::TRAP.Chris Lattner2008-01-152-4/+12
| | | | llvm-svn: 46014
* Oops. Forgot to commit this.Evan Cheng2008-01-151-5/+12
| | | | llvm-svn: 46002
* For PR1839: add initial support for __builtin_trap. llvm-gcc part is missedAnton Korobeynikov2008-01-153-1/+26
| | | | | | as well as PPC codegen llvm-svn: 46001
* ByVal stack slot alignment should be at least as large as pointer ABI alignment.Evan Cheng2008-01-151-1/+3
| | | | llvm-svn: 45995
* don't create the post-ra scheduler unless it is enabled.Chris Lattner2008-01-142-17/+8
| | | | llvm-svn: 45972
* remove dead #includeChris Lattner2008-01-141-1/+0
| | | | llvm-svn: 45971
* Remove the assumption that byval has been applied toDuncan Sands2008-01-131-12/+12
| | | | | | a pointer to a struct. llvm-svn: 45939
* implement support for sinking a load out the bottom of a block thatChris Lattner2008-01-121-16/+23
| | | | | | | | | has no stores between the load and the end of block. This works great and sinks hundreds of stores, but we can't turn it on because machineinstrs don't have volatility information and we don't want to sink volatile stores :( llvm-svn: 45894
* Simplify the side effect stuff a bit more and make licm/sinkingChris Lattner2008-01-102-16/+35
| | | | | | | | | | | | | | | | both work right according to the new flags. This removes the TII::isReallySideEffectFree predicate, and adds TII::isInvariantLoad. It removes NeverHasSideEffects+MayHaveSideEffects and adds UnmodeledSideEffects as machine instr flags. Now the clients can decide everything they need. I think isRematerializable can be implemented in terms of the flags we have now, though I will let others tackle that. llvm-svn: 45843
* Clamp down on sinking of lots of instructions.Chris Lattner2008-01-101-0/+9
| | | | llvm-svn: 45841
* Output sinl for a long double FSIN node, not sin.Duncan Sands2008-01-102-55/+61
| | | | | | | | Likewise fix up a bunch of other libcalls. While there I remove NEG_F32 and NEG_F64 since they are not used anywhere. This fixes 9 Ada ACATS failures. llvm-svn: 45833
* Only remat loads from immutable stack slots.Evan Cheng2008-01-101-2/+2
| | | | llvm-svn: 45831
* Simplify some code.Evan Cheng2008-01-101-8/+2
| | | | llvm-svn: 45830
* Don't use LiveVariables::VarInfo::DefInst.Owen Anderson2008-01-101-1/+8
| | | | llvm-svn: 45815
* Emit unused EH frames for weak definitions on Darwin,Dale Johannesen2008-01-101-8/+15
| | | | | | | because assembler/linker can't cope with weak absolutes. PR 1880. llvm-svn: 45811
* Get rid of all uses of LiveVariables::VarInfo::DefInst in favor of the ↵Owen Anderson2008-01-101-58/+66
| | | | | | | | equivalent API from MachineRegisterInfo. Once all clients are switched over, the former will be going away. llvm-svn: 45805
* Add more comments explaining the basics of how the decision of when to ↵Owen Anderson2008-01-101-7/+37
| | | | | | | | rename and when to insert copies is made. llvm-svn: 45799
* Get rid of the isKillInst predicate. LiveVariables already provides this ↵Owen Anderson2008-01-101-14/+10
| | | | | | information. llvm-svn: 45797
OpenPOWER on IntegriCloud