aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* More cleanups for CellSPU:Scott Michel2008-01-3018-3868/+4951
| | | | | | | | | | - Expand tabs... (poss 80-col violations, will get them later...) - Consolidate logic for SelectDFormAddr and SelectDForm2Addr into a single function, simplifying maintenance. Also reduced custom instruction generation for SPUvecinsert/INSERT_MASK. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46544 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DSE much more aggressive by performing DCE earlier. Update a testcase ↵Owen Anderson2008-01-301-2/+55
| | | | | | to reflect this increased aggressiveness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46542 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an issue where, under very specific circumstances, memdep could end up ↵Owen Anderson2008-01-301-2/+2
| | | | | | | | | dereferencing the end of one of its internal maps. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46541 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug where scalarrepl would discard offset if type would match.Chris Lattner2008-01-301-2/+2
| | | | | | | | In practice this can only happen on code with already undefined behavior, but this is still a good thing to handle correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46539 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor the addressing mode and the load/store VT out of LoadSDNodeDan Gohman2008-01-3014-108/+108
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46538 91177308-0d34-0410-b5e6-96231b3b80d8
* Work in progress. This patch *fixes* x86-64 calls which are modelled as ↵Evan Cheng2008-01-296-96/+283
| | | | | | | | | StructRet but really should be return in registers, e.g. _Complex long double, some 128-bit aggregates. This is a short term solution that is necessary only because llvm, for now, cannot model i128 nor call's with multiple results. Status: This only works for direct calls, and only the caller side is done. Disabled for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46527 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46525 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't let globalopt hack on volatile loads or stores.Chris Lattner2008-01-291-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46523 91177308-0d34-0410-b5e6-96231b3b80d8
* Use empty() instead of comparing size() with zero.Dan Gohman2008-01-2917-22/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46514 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo in a comment.Dan Gohman2008-01-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46513 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix 80-col violations.Dan Gohman2008-01-293-10/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46510 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove top-level const qualifiers from casts, avoiding associatedDan Gohman2008-01-291-10/+10
| | | | | | | compiler warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46509 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo in a comment.Dan Gohman2008-01-291-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46508 91177308-0d34-0410-b5e6-96231b3b80d8
* Add explicit keywords.Dan Gohman2008-01-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46506 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate additions of 0.0 when they are obviously dead. This has to be ↵Chris Lattner2008-01-291-0/+47
| | | | | | | | | careful to avoid turning -0.0 + 0.0 -> -0.0 which is incorrect. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46499 91177308-0d34-0410-b5e6-96231b3b80d8
* Use getPreferredAlignmentLog or getPreferredAlignmentDuncan Sands2008-01-296-19/+26
| | | | | | | | to get the alignment of global variables, rather than using hand-made versions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46495 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for eliminating memcpy's at the end of functions. Also fix some ↵Owen Anderson2008-01-291-26/+63
| | | | | | | | | errors I noticed in the handling of eliminating stores to byval arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46494 91177308-0d34-0410-b5e6-96231b3b80d8
* RegAllocBigBlock doesn't need LiveVariables either.Owen Anderson2008-01-291-13/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46488 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly expand extract-element for non-power-of-2 codegenNate Begeman2008-01-291-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46486 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle 'X' constraint in asm's better.Dale Johannesen2008-01-295-21/+69
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46485 91177308-0d34-0410-b5e6-96231b3b80d8
* Filter loops that subtract induction variables.Devang Patel2008-01-291-17/+17
| | | | | | | | | These loops are not yet handled. Fix PR 1912. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46484 91177308-0d34-0410-b5e6-96231b3b80d8
* Overhaul Cell SPU's addressing mode internals so that there are nowScott Michel2008-01-298-680/+566
| | | | | | | | | | | | | | | only two addressing mode nodes, SPUaform and SPUindirect (vice the three previous ones, SPUaform, SPUdform and SPUxform). This improves code somewhat because we now avoid using reg+reg addressing when it can be avoided. It also simplifies the address selection logic, which was the main point for doing this. Also, for various global variables that would be loaded using SPU's A-form addressing, prefer D-form offs[reg] addressing, keeping the base in a register if the variable is used more than once. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46483 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the code and fix a typo.Lauro Ramos Venancio2008-01-281-7/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46458 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix fpcmp infinite loop when comparing "29-266" with "29-268".Lauro Ramos Venancio2008-01-281-5/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46455 91177308-0d34-0410-b5e6-96231b3b80d8
* If the function has no machine instructions, then emit a "nop" so thatBill Wendling2008-01-281-0/+10
| | | | | | | the function label isn't associated with something it shouldn't be. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46449 91177308-0d34-0410-b5e6-96231b3b80d8
* Transform calls to memcpy into llvm.memcpy calls, patch by Eli Friedman.Chris Lattner2008-01-281-0/+30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46433 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle some more combinations of extend and icmp. Fixes PR1940.Nick Lewycky2008-01-282-8/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46431 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR1932 by disabling an xform invalid for fdiv.Chris Lattner2008-01-281-9/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46429 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR1938 by forcing the code that uses an undefined value to branch oneChris Lattner2008-01-281-4/+19
| | | | | | | | | way or the other. Rewriting the code itself prevents subsequent analysis passes from making contradictory conclusions about the code that could cause an infeasible path to be made feasible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46427 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PowerPC/./2007-10-18-PtrArithmetic.llChris Lattner2008-01-271-7/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46424 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a crash on CodeGen/X86/vector-rem.llChris Lattner2008-01-271-4/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46422 91177308-0d34-0410-b5e6-96231b3b80d8
* Reg alloc doesn't really need LiveVariables.Owen Anderson2008-01-271-9/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46420 91177308-0d34-0410-b5e6-96231b3b80d8
* Be more careful modifying the use_list while also iterating through it.Nick Lewycky2008-01-271-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46417 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r46393: readonly/readnone functions are noDuncan Sands2008-01-271-9/+6
| | | | | | | longer allowed to write through byval arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46416 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46414 91177308-0d34-0410-b5e6-96231b3b80d8
* add a noteChris Lattner2008-01-271-0/+39
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46413 91177308-0d34-0410-b5e6-96231b3b80d8
* Use fldz and fld1 for long double constants instead of a constant pool load.Chris Lattner2008-01-271-1/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46411 91177308-0d34-0410-b5e6-96231b3b80d8
* The CorrelatedExpressionElimination pass is known to be buggy. Remove it.Bill Wendling2008-01-271-1486/+0
| | | | | | | This fixes PR1769. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46408 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46407 91177308-0d34-0410-b5e6-96231b3b80d8
* Fold fptrunc(add (fpextend x), (fpextend y)) -> add(x,y), as GCC does.Chris Lattner2008-01-271-3/+75
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46406 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some notes.Chris Lattner2008-01-261-0/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46405 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some code for inferring alignment info from the x86 backend Chris Lattner2008-01-261-10/+1
| | | | | | | | now that the dag combiner does it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46404 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46401 91177308-0d34-0410-b5e6-96231b3b80d8
* If there's no instructions being emitted on X86 for a function, emit aBill Wendling2008-01-262-8/+14
| | | | | | | nop. Emit the nop directly for PPC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46398 91177308-0d34-0410-b5e6-96231b3b80d8
* If there are no machine instructions emitted for a function, then insertBill Wendling2008-01-262-16/+16
| | | | | | | | | a "nop" instruction so that we don't have the function's label associated with something that it's not supposed to be associated with. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46394 91177308-0d34-0410-b5e6-96231b3b80d8
* Create an explicit copy for byval parameters evenDuncan Sands2008-01-261-6/+9
| | | | | | | when inlining a readonly function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46393 91177308-0d34-0410-b5e6-96231b3b80d8
* If we have a function like this:Bill Wendling2008-01-261-1/+14
| | | | | | | | | | | | | | | | | | | | | | | void bork() { int *address = 0; *address = 0; } It's compiled into LLVM code that looks like this: define void @bork() noreturn nounwind { entry: unreachable } This is bad on some platforms (like PPC) because it will generate the label for the function but no body. The label could end up being associated with some non-code related stuff, like a section. This places a "trap" instruction if the SimplifyCFG pass removed all code from the function leaving only one "unreachable" instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46387 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46384 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46383 91177308-0d34-0410-b5e6-96231b3b80d8
* reduce indentationChris Lattner2008-01-251-42/+44
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46377 91177308-0d34-0410-b5e6-96231b3b80d8