summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
Commit message (Collapse)AuthorAgeFilesLines
* Handle 'X' constraint in asm's better.Dale Johannesen2008-01-292-0/+19
| | | | llvm-svn: 46485
* 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
* 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
* 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
* 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
* 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-261-2/+15
| | | | | | | 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
* JITEmitter.cpp was trying to sync the icache for function stubs, butChris Lattner2008-01-251-2/+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
* 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
* 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
* Let each target decide byval alignment. For X86, it's 4-byte unless the ↵Evan Cheng2008-01-232-0/+46
| | | | | | aggregare contains SSE vector(s). For x86-64, it's max of 8 or alignment of the type. llvm-svn: 46286
* The last pieces needed for loading arbitraryDuncan Sands2008-01-237-14/+14
| | | | | | | | | | | | | | | 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
* Honor explicit section information on Darwin.Dale Johannesen2008-01-233-3/+13
| | | | llvm-svn: 46267
* SSE varargs arguments are passed in memory.Evan Cheng2008-01-221-2/+2
| | | | llvm-svn: 46262
* Trivial patch to fix two warnings, please pull into llvm 2.2Chris Lattner2008-01-221-0/+3
| | | | llvm-svn: 46243
* Honour ByVal parameter attribute for name decorationAnton Korobeynikov2008-01-201-3/+12
| | | | llvm-svn: 46200
* Remove Darwin'ismAnton Korobeynikov2008-01-201-4/+1
| | | | llvm-svn: 46199
* Enable PIC codegen on x86-64/linuxAnton Korobeynikov2008-01-201-1/+1
| | | | llvm-svn: 46198
* Need to handle any 'nest' parameter before integerDuncan Sands2008-01-191-8/+8
| | | | | | | | | parameters, since otherwise it won't be passed in the right register. With this change trampolines work on x86-64 (thanks to Luke Guest for providing access to an x86-64 box). llvm-svn: 46192
* Implement flt_rounds for PowerPC.Dale Johannesen2008-01-181-0/+64
| | | | llvm-svn: 46174
* get symbolic information for ppc ldbl nodes.Chris Lattner2008-01-181-0/+5
| | | | llvm-svn: 46165
* Fix a latent bug exposed by my truncstore patch. We compiled stfiwx-2.ll to:Chris Lattner2008-01-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | _test: fctiwz f0, f1 stfiwx f0, 0, r4 blr instead of: _test: fctiwz f0, f1 stfd f0, -8(r1) nop nop lwz r2, -4(r1) stb r2, 0(r4) blr The former is not correct (stores 4 bytes, not 1). llvm-svn: 46161
* make a method publicChris Lattner2008-01-181-7/+7
| | | | llvm-svn: 46159
* Revert the part of 45849 that treated weak globalsDale Johannesen2008-01-171-3/+2
| | | | | | | | as weak globals rather than commons. While not wrong, this change tickled a latent bug in Darwin's strip, so revert it for now as a workaround. llvm-svn: 46147
* Revert the part of 45848 that treated weak globalsDale Johannesen2008-01-172-4/+4
| | | | | | | | as weak globals rather than commons. While not wrong, this change tickled a latent bug in Darwin's strip, so revert it for now as a workaround. llvm-svn: 46144
* Forward progress: crtbegin.c now compiles successfully!Scott Michel2008-01-174-149/+248
| | | | | | | | | | | | | Fixed CellSPU's A-form (local store) address mode, so that all globals, externals, constant pool and jump table symbols are now wrapped within a SPUISD::AFormAddr pseudo-instruction. This now identifies all local store memory addresses, although it requires a bit of legerdemain during instruction selection to properly select loads to and stores from local store, properly generating "LQA" instructions. Also added mul_ops.ll test harness for exercising integer multiplication. llvm-svn: 46142
* This commit changes:Chris Lattner2008-01-1712-44/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* * Introduce a new SelectionDAG::getIntPtrConstant methodChris Lattner2008-01-173-38/+35
| | | | | | | | | | | | | 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
* Trampoline support for x86-64. This looks likeDuncan Sands2008-01-161-7/+56
| | | | | | | | | it should work, but I have no machine to test it on. Committed because it will at least cause no harm, and maybe someone can test it for me! llvm-svn: 46098
* make it more clear that this predicate only applies to scalar FP types.Chris Lattner2008-01-162-10/+10
| | | | llvm-svn: 46058
* introduce a isTypeInSSEReg predicate, which allows us to simplifyChris Lattner2008-01-162-21/+18
| | | | | | some code. No functionality change. llvm-svn: 46055
* My previous commit had an incomplete message, it should have been:Chris Lattner2008-01-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | make the 'fp return in ST(0)' optimization smart enough to look through token factor nodes. THis allows us to compile testcases like CodeGen/X86/fp-stack-retcopy.ll into: _carg: subl $12, %esp call L_foo$stub fstpl (%esp) fldl (%esp) addl $12, %esp ret instead of: _carg: 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 Still not optimal, but much better and this is a trivial patch. Fixing the rest requires invasive surgery that is is not llvm 2.2 material. llvm-svn: 46054
* make the 'fp return in ST(0)' optimization smart enough to Chris Lattner2008-01-161-1/+1
| | | | | | look through token factor llvm-svn: 46053
* various whitespace cleanups, no functionality change.Chris Lattner2008-01-161-7/+7
| | | | llvm-svn: 46052
* Missed file from previous checkin.Dale Johannesen2008-01-151-0/+1
| | | | llvm-svn: 46030
* Fix and enable EH for x86-64 Darwin. AddsDale Johannesen2008-01-153-5/+14
| | | | | | | | | 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
* If someone wants to implement ppc TRAP, they can go for it :)Chris Lattner2008-01-151-0/+1
| | | | llvm-svn: 46019
* rename SDTRet -> SDTNone.Chris Lattner2008-01-157-13/+11
| | | | | | Move definition of 'trap' sdnode up from x86 instrinfo to targetselectiondag.td. llvm-svn: 46017
* Remove DefInst from LiveVariables::VarInfo. Use the facilities on ↵Owen Anderson2008-01-151-3/+0
| | | | | | MachineRegisterInfo instead. llvm-svn: 46016
* no need to expand ISD::TRAP to X86ISD::TRAP, just match ISD::TRAP.Chris Lattner2008-01-153-17/+6
| | | | llvm-svn: 46015
* Fix JIT encoding of trap/ud2 instructionAnton Korobeynikov2008-01-151-2/+1
| | | | llvm-svn: 46012
* For PR1839: add initial support for __builtin_trap. llvm-gcc part is missedAnton Korobeynikov2008-01-153-1/+23
| | | | | | as well as PPC codegen llvm-svn: 46001
* Rename CCIfStruct to CCIfByVal and CCStructAssign to CCPassByVal. Remove ↵Evan Cheng2008-01-152-10/+11
| | | | | | unused parameters of CCStructAssign and add size and alignment requirement info. llvm-svn: 45997
* Both x86-32 and x86-64 handle byval parameter attributes.Evan Cheng2008-01-151-4/+9
| | | | llvm-svn: 45996
* Improve the FP stackifier to decide all on its own whether Chris Lattner2008-01-141-23/+30
| | | | | | | | | an instruction kills a register or not. This is cheap and easy to do now that instructions record this on their flags, and this eliminates the second pass of LiveVariables from the x86 backend. This speeds up a release llc by ~2.5%. llvm-svn: 45955
* Whitespace tweak.Duncan Sands2008-01-131-1/+1
| | | | llvm-svn: 45940
OpenPOWER on IntegriCloud