summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix uninitialized uses of the FPC variable.Dan Gohman2008-05-011-2/+2
| | | | llvm-svn: 50558
* don't randomly miscompile seto/setuo just because we are in Chris Lattner2008-05-011-4/+4
| | | | | | | | | ffastmath mode. This fixes rdar://5902801, a miscompilation of gcc.dg/builtins-8.c. Bill, please pull this into Tak. llvm-svn: 50523
* Tail call optimization improvements:Arnold Schwaighofer2008-04-301-6/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move platform independent code (lowering of possibly overwritten arguments, check for tail call optimization eligibility) from target X86ISelectionLowering.cpp to TargetLowering.h and SelectionDAGISel.cpp. Initial PowerPC tail call implementation: Support ppc32 implemented and tested (passes my tests and test-suite llvm-test). Support ppc64 implemented and half tested (passes my tests). On ppc tail call optimization is performed if caller and callee are fastcc call is a tail call (in tail call position, call followed by ret) no variable argument lists or byval arguments option -tailcallopt is enabled Supported: * non pic tail calls on linux/darwin * module-local tail calls on linux(PIC/GOT)/darwin(PIC) * inter-module tail calls on darwin(PIC) If constraints are not met a normal call will be emitted. A test checking the argument lowering behaviour on x86-64 was added. llvm-svn: 50477
* Fix custom target lowering for zero/any/sign_extend: make sure thatScott Michel2008-04-301-5/+3
| | | | | | | DAG.UpdateNodeOperands() is called before (not after) the call to TLI.LowerOperation(). llvm-svn: 50461
* Use std::set instead of std::priority_queue for the RegReductionPriorityQueue. Roman Levenstein2008-04-291-44/+29
| | | | | | | | | | | | | | This removes the existing bottleneck related to the removal of elements from the middle of the queue. Also fixes a subtle bug in ScheduleDAGRRList::CapturePred: It was updating the state of the SUnit before removing it. As a result, the comparison operators were working incorrectly and this SUnit could not be removed from the queue properly. Reviewed by Evan and Dan. Approved by Dan. llvm-svn: 50412
* make the vector conversion magic handle multiple results.Chris Lattner2008-04-291-7/+16
| | | | | | | | | | | | | | | | | | | | | We now compile test2/test3 to: _test2: ## InlineAsm Start set %xmm0, %xmm1 ## InlineAsm End addps %xmm1, %xmm0 ret _test3: ## InlineAsm Start set %xmm0, %xmm1 ## InlineAsm End paddd %xmm1, %xmm0 ret as expected. llvm-svn: 50389
* add support for multiple return values in inline asm. This is a step Chris Lattner2008-04-291-12/+19
| | | | | | | | | | | | | | | | | | towards PR2094. It now compiles the attached .ll file to: _sad16_sse2: movslq %ecx, %rax ## InlineAsm Start %ecx %rdx %rax %rax %r8d %rdx %rsi ## InlineAsm End ## InlineAsm Start set %eax ## InlineAsm End ret which is pretty decent for a 3 output, 4 input asm. llvm-svn: 50386
* Fix a bug in RegsForValue::getCopyToRegs() that causes cyclical scheduling ↵Evan Cheng2008-04-281-2/+12
| | | | | | | | | | | | | | units. If it's creating multiple CopyToReg nodes that are "flagged" together, it should not create a TokenFactor for it's chain outputs: c1, f1 = CopyToReg c2, f2 = CopyToReg c3 = TokenFactor c1, c2 ... = user c3, ..., f2 Now that the two CopyToReg's and the user are "flagged" together. They effectively forms a single scheduling unit. The TokenFactor is now both an operand and a successor of the Flagged nodes. llvm-svn: 50376
* Evan pointed out that folding sext to zext may not be correctDan Gohman2008-04-281-1/+2
| | | | | | if the zext is not legal. llvm-svn: 50368
* Delete an unused constructor.Dan Gohman2008-04-281-3/+0
| | | | llvm-svn: 50367
* Add a comment to CreateRegForValue that clarifies the handling ofDan Gohman2008-04-281-0/+4
| | | | | | aggregate types. llvm-svn: 50366
* Rewrite the comments for RegsForValue and its members, andDan Gohman2008-04-281-20/+30
| | | | | | reorder some of the members for clarity. llvm-svn: 50365
* Don't call size() on each iteration of the loop.Dan Gohman2008-04-281-2/+2
| | | | llvm-svn: 50361
* 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
* Teach DAGCombine to convert (sext x) to (zext x) when theDan Gohman2008-04-281-0/+4
| | | | | | sign-bit of x is known to be zero. llvm-svn: 50357
* Another collection of random cleanups. No functionality change.Chris Lattner2008-04-281-64/+61
| | | | llvm-svn: 50341
* Remove the SmallVector ctor that converts from a SmallVectorImpl. ThisChris Lattner2008-04-281-48/+53
| | | | | | | | | | conversion open the door for many nasty implicit conversion issues, and can be easily solved by initializing with (V.begin(), V.end()) when needed. This patch includes many small cleanups for sdisel also. llvm-svn: 50340
* switch RegsForValue::Regs to be a SmallVector to avoidChris Lattner2008-04-281-4/+4
| | | | | | heap thrash on tiny (usually single-element) vectors. llvm-svn: 50335
* move static function out of anon namespace, no functionality change.Chris Lattner2008-04-271-25/+23
| | | | llvm-svn: 50330
* Another step to getting multiple result inline asm to work.Chris Lattner2008-04-271-6/+14
| | | | llvm-svn: 50329
* typoChris Lattner2008-04-271-1/+1
| | | | llvm-svn: 50316
* Implement a signficant optimization for inline asm:Chris Lattner2008-04-272-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | When choosing between constraints with multiple options, like "ir", test to see if we can use the 'i' constraint and go with that if possible. This produces more optimal ASM in all cases (sparing a register and an instruction to load it), and fixes inline asm like this: void test () { asm volatile (" %c0 %1 " : : "imr" (42), "imr"(14)); } Previously we would dump "42" into a memory location (which is ok for the 'm' constraint) which would cause a problem because the 'c' modifier is not valid on memory operands. Isn't it great how inline asm turns 'missed optimization' into 'compile failed'?? Incidentally, this was the todo in PowerPC/2007-04-24-InlineAsm-I-Modifier.ll Please do NOT pull this into Tak. llvm-svn: 50315
* isa+cast -> dyn_castChris Lattner2008-04-271-4/+2
| | | | llvm-svn: 50314
* Move a bunch of inline asm code out of line.Chris Lattner2008-04-272-1/+98
| | | | llvm-svn: 50313
* A few inline asm cleanups:Chris Lattner2008-04-261-8/+6
| | | | | | | | | - Make targetlowering.h fit in 80 cols. - Make LowerAsmOperandForConstraint const. - Make lowerXConstraint -> LowerXConstraint - Make LowerXConstraint return a const char* instead of taking a string byref. llvm-svn: 50312
* Remove the code from CodeGenPrepare that moved getresult instructionsDan Gohman2008-04-251-83/+156
| | | | | | | | | | | to the block that defines their operands. This doesn't work in the case that the operand is an invoke, because invoke is a terminator and must be the last instruction in a block. Replace it with support in SelectionDAGISel for copying struct values into sequences of virtual registers. llvm-svn: 50279
* Pull the code to perform an INSERT_VECTOR_ELT in memory out into its own Nate Begeman2008-04-251-43/+68
| | | | | | | function, and then use it to fix a bug in SplitVectorOp that expected inserts to always have constant insertion indices. llvm-svn: 50273
* Use isa instead of dyn_cast.Dan Gohman2008-04-231-1/+1
| | | | llvm-svn: 50181
* Add support to codegen for getresult instructions with undef operands.Dan Gohman2008-04-231-2/+7
| | | | llvm-svn: 50180
* Fix an out-of-bounds access in -view-sunit-dags in the case of anDan Gohman2008-04-211-1/+2
| | | | | | empty ScheduleDAG. llvm-svn: 50054
* 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
* Switch to using Simplified ConstantFP::get API.Chris Lattner2008-04-202-9/+7
| | | | llvm-svn: 49977
* Implement a bit more softfloat support inDuncan Sands2008-04-182-5/+187
| | | | | | | | LegalizeTypes. Correct the load logic so that it actually works, and also teach it to handle floating point extending loads. llvm-svn: 49923
* Add some more FIXME's for indexed loads and stores.Duncan Sands2008-04-183-0/+6
| | | | llvm-svn: 49916
* Provide an explicit list of operands to MakeLibcall,Duncan Sands2008-04-183-72/+81
| | | | | | | | | | rather than having it suck them out of a node. Add a bunch of new libcalls, and remove dead softfloat code (dead, because FloatToInt is used not Expand in this case). Note that indexed stores probably aren't handled properly, likewise for loads. llvm-svn: 49915
* 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
* Correct the SrcValue information in the Expand code for va_copy.Dan Gohman2008-04-171-2/+2
| | | | llvm-svn: 49839
* Ongoing work on improving the instruction selection infrastructure:Roman Levenstein2008-04-166-79/+80
| | | | | | | | | | 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
* Fix the new scheduler assertion checks to work whenDan Gohman2008-04-151-2/+10
| | | | | | | the scheduler has inserted no-ops. This fixes the 2006-07-03-schedulers.ll regression on ppc32. llvm-svn: 49747
* Change Divided flag to Split, as suggested by EvanNicolas Geoffray2008-04-151-2/+2
| | | | llvm-svn: 49715
* Treat EntryToken nodes as "passive" so that they aren't added to theDan Gohman2008-04-153-35/+51
| | | | | | | | | | | | | | | | | ScheduleDAG; they don't correspond to any actual instructions so they don't need to be scheduled. This fixes a bug where the EntryToken was being scheduled multiple times in some cases, though it ended up not causing any trouble because EntryToken doesn't expand into anything. With this fixed the schedulers reliably schedule the expected number of units, so we can check this with an assertion. This requires a tweak to test/CodeGen/X86/loop-hoist.ll because it ends up getting scheduled differently in a trivial way, though it was enough to fool the prcontext+grep that the test does. llvm-svn: 49701
* In -view-sunit-dags, display "special" chain dependencies as cyanDan Gohman2008-04-141-0/+2
| | | | | | instead of blue to distinguish them from regular dependencies. llvm-svn: 49696
* 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
* Fix /test/CodeGen/PowerPC/big-endian-actual-args.ll for linux/ppc32Nicolas Geoffray2008-04-141-4/+4
| | | | llvm-svn: 49652
* Initial libcall support for LegalizeTypes. This isDuncan Sands2008-04-143-0/+116
| | | | | | | | much simpler than in LegalizeDAG because calls are not yet expanded into call sequences: that happens after type legalization has finished. llvm-svn: 49634
* LegalizeTypes can sometimes have deleted nodesDuncan Sands2008-04-132-0/+51
| | | | | | | | | in its maps. Add some sanity checks that catch this kind of thing. Hopefully these can be removed one day (once all problems are fixed!) but for the moment it seems wise to have them in. llvm-svn: 49612
* Add a divided flag for the first piece of an argument divided into mulitple ↵Nicolas Geoffray2008-04-131-2/+7
| | | | | | parts. Fixes PR1643 llvm-svn: 49611
* Factor some libcall code.Duncan Sands2008-04-121-61/+49
| | | | llvm-svn: 49583
OpenPOWER on IntegriCloud