summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* 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-295-21/+69
| | | | llvm-svn: 46485
* Filter loops that subtract induction variables.Devang Patel2008-01-291-17/+17
| | | | | | | | These loops are not yet handled. Fix PR 1912. llvm-svn: 46484
* 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. llvm-svn: 46483
* Simplify the code and fix a typo.Lauro Ramos Venancio2008-01-281-7/+4
| | | | llvm-svn: 46458
* Fix fpcmp infinite loop when comparing "29-266" with "29-268".Lauro Ramos Venancio2008-01-281-5/+21
| | | | llvm-svn: 46455
* 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. llvm-svn: 46449
* Transform calls to memcpy into llvm.memcpy calls, patch by Eli Friedman.Chris Lattner2008-01-281-0/+30
| | | | llvm-svn: 46433
* Handle some more combinations of extend and icmp. Fixes PR1940.Nick Lewycky2008-01-282-8/+25
| | | | llvm-svn: 46431
* Fix PR1932 by disabling an xform invalid for fdiv.Chris Lattner2008-01-281-9/+10
| | | | llvm-svn: 46429
* 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. llvm-svn: 46427
* 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
* Be more careful modifying the use_list while also iterating through it.Nick Lewycky2008-01-271-1/+2
| | | | llvm-svn: 46417
* Revert r46393: readonly/readnone functions are noDuncan Sands2008-01-271-9/+6
| | | | | | longer allowed to write through byval arguments. llvm-svn: 46416
* 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
* add a noteChris Lattner2008-01-271-0/+39
| | | | llvm-svn: 46413
* Use fldz and fld1 for long double constants instead of a constant pool load.Chris Lattner2008-01-271-1/+14
| | | | llvm-svn: 46411
* The CorrelatedExpressionElimination pass is known to be buggy. Remove it.Bill Wendling2008-01-271-1486/+0
| | | | | | This fixes PR1769. llvm-svn: 46408
* 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
* Fold fptrunc(add (fpextend x), (fpextend y)) -> add(x,y), as GCC does.Chris Lattner2008-01-271-3/+75
| | | | llvm-svn: 46406
* Add some notes.Chris Lattner2008-01-261-0/+18
| | | | llvm-svn: 46405
* Remove some code for inferring alignment info from the x86 backend Chris Lattner2008-01-261-10/+1
| | | | | | now that the dag combiner does it. llvm-svn: 46404
* 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
* 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. llvm-svn: 46398
* 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. llvm-svn: 46394
* Create an explicit copy for byval parameters evenDuncan Sands2008-01-261-6/+9
| | | | | | when inlining a readonly function. llvm-svn: 46393
* 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. llvm-svn: 46387
* 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
* Do this more neatly.Duncan Sands2008-01-251-2/+1
| | | | llvm-svn: 46369
* fix long lines.Chris Lattner2008-01-251-2/+3
| | | | llvm-svn: 46355
* JITEmitter.cpp was trying to sync the icache for function stubs, butChris Lattner2008-01-252-10/+19
| | | | | | | | was actually passing a completely incorrect size to sys_icache_invalidate. Instead of having the JITEmitter do this (which doesn't have the correct size), just make the target sync its own stubs. llvm-svn: 46354
* DeadStoreElimination can treat byval parameters as if there were alloca's ↵Owen Anderson2008-01-251-5/+6
| | | | | | for the purpose of removing end-of-function stores. llvm-svn: 46351
* 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
* optimize fxor like forChris Lattner2008-01-251-3/+6
| | | | llvm-svn: 46345
* Add target-specific dag combines for FAND(x,0) and FOR(x,0). This allowsChris Lattner2008-01-251-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | us to compile: double test(double X) { return copysign(0.0, X); } into: _test: andpd LCPI1_0(%rip), %xmm0 ret instead of: _test: pxor %xmm1, %xmm1 andpd LCPI1_0(%rip), %xmm1 movapd %xmm0, %xmm2 andpd LCPI1_1(%rip), %xmm2 movapd %xmm1, %xmm0 orpd %xmm2, %xmm0 ret llvm-svn: 46344
* Provide correct DWARF register numbering for debug information emission on ↵Anton Korobeynikov2008-01-253-9/+9
| | | | | | | | x86-32/Darwin. This should fix bunch of issues. llvm-svn: 46337
* Don't dump the function!Chris Lattner2008-01-241-2/+0
| | | | llvm-svn: 46320
* getUnderlyingObject can return null, handle this.Chris Lattner2008-01-241-2/+3
| | | | llvm-svn: 46318
* Teach basicaa that 'byval' arguments define a new memory location thatChris Lattner2008-01-241-34/+34
| | | | | | | can't be aliased to other known objects. This allows us to know that byval pointer args don't alias globals, etc. llvm-svn: 46315
* Add hasByValAttr() and hasNoAliasAttr() methods to the Argument class.Chris Lattner2008-01-241-0/+31
| | | | llvm-svn: 46314
* clarify a comment, thanks Duncan.Chris Lattner2008-01-241-2/+3
| | | | llvm-svn: 46313
* Significantly simplify and improve handling of FP function results on x86-32.Chris Lattner2008-01-243-127/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This case returns the value in ST(0) and then has to convert it to an SSE register. This causes significant codegen ugliness in some cases. For example in the trivial fp-stack-direct-ret.ll testcase we used to generate: _bar: subl $28, %esp call L_foo$stub fstpl 16(%esp) movsd 16(%esp), %xmm0 movsd %xmm0, 8(%esp) fldl 8(%esp) addl $28, %esp ret because we move the result of foo() into an XMM register, then have to move it back for the return of bar. Instead of hacking ever-more special cases into the call result lowering code we take a much simpler approach: on x86-32, fp return is modeled as always returning into an f80 register which is then truncated to f32 or f64 as needed. Similarly for a result, we model it as an extension to f80 + return. This exposes the truncate and extensions to the dag combiner, allowing target independent code to hack on them, eliminating them in this case. This gives us this code for the example above: _bar: subl $12, %esp call L_foo$stub addl $12, %esp ret The nasty aspect of this is that these conversions are not legal, but we want the second pass of dag combiner (post-legalize) to be able to hack on them. To handle this, we lie to legalize and say they are legal, then custom expand them on entry to the isel pass (PreprocessForFPConvert). This is gross, but less gross than the code it is replacing :) This also allows us to generate better code in several other cases. For example on fp-stack-ret-conv.ll, we now generate: _test: subl $12, %esp call L_foo$stub fstps 8(%esp) movl 16(%esp), %eax cvtss2sd 8(%esp), %xmm0 movsd %xmm0, (%eax) addl $12, %esp ret where before we produced (incidentally, the old bad code is identical to what gcc produces): _test: subl $12, %esp call L_foo$stub fstpl (%esp) cvtsd2ss (%esp), %xmm0 cvtss2sd %xmm0, %xmm0 movl 16(%esp), %eax movsd %xmm0, (%eax) addl $12, %esp ret Note that we generate slightly worse code on pr1505b.ll due to a scheduling deficiency that is unrelated to this patch. llvm-svn: 46307
* 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
OpenPOWER on IntegriCloud