summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
Commit message (Collapse)AuthorAgeFilesLines
* Revert r58489. It isn't correct for all cases.Bill Wendling2008-10-311-1/+2
| | | | llvm-svn: 58523
* Change x86 register allocation ordering to match that of gcc. Otherwise some ↵Evan Cheng2008-10-311-19/+19
| | | | | | tools get confused by prologue generated by llvm. llvm-svn: 58517
* Don't skip over all "terminator" instructions when determining where to put theBill Wendling2008-10-311-2/+1
| | | | | | | callee-saved restore code. It could skip over conditional jumps accidentally. Instead, just skip the "return" instructions. llvm-svn: 58489
* Use MOVSSmr instead of EXTRACTPSmr in the case of extractingDan Gohman2008-10-311-2/+6
| | | | | | vector element 0 for a store, as it's smaller and faster. llvm-svn: 58483
* I think we got non-machine specific constpool entries covered.Evan Cheng2008-10-301-1/+2
| | | | llvm-svn: 58474
* Shift amounts should have type getShiftAmountTyDuncan Sands2008-10-301-9/+9
| | | | | | | (i32 for PPC, not i8). Correct this, and some formatting while there. llvm-svn: 58451
* Shift amounts should have the type given byDuncan Sands2008-10-301-5/+5
| | | | | | getShiftAmountTy (i32 in the case of CellSPU). llvm-svn: 58449
* ARM JIT should observe -relocation-model command line option.Evan Cheng2008-10-302-2/+6
| | | | llvm-svn: 58433
* Add initial support for vector widening. Logic is set to widen for X86.Mon P Wang2008-10-302-2/+50
| | | | | | | One will only see an effect if legalizetype is not active. Will move support to LegalizeType soon. llvm-svn: 58426
* Resolve bug 2947: vararg-marked functions must spill registers R3-R79 to stackScott Michel2008-10-302-114/+69
| | | | | | | | | so that va_start/va_arg/et.al. will walk arguments correctly for Cell SPU. N.B.: Because neither clang nor llvm-gcc-4.2 can be built for CellSPU, this is still unexorcised code. llvm-svn: 58415
* Correct way to handle CONSTPOOL_ENTRY instructions.Evan Cheng2008-10-294-37/+82
| | | | llvm-svn: 58409
* Add debugging support.Evan Cheng2008-10-292-1/+26
| | | | llvm-svn: 58408
* Fix PEXTRQ encodingNate Begeman2008-10-291-1/+1
| | | | llvm-svn: 58403
* Add a RM pseudoreg for the rounding mode, whichDale Johannesen2008-10-294-165/+200
| | | | | | | | | | | | | | | | | allows ppcf128->int conversion to work with DeadInstructionElimination. This is now turned off but RM is harmless. It does not do a complete job of modeling the rounding mode. Revert marking MFCR as using all 7 CR subregisters; while correct, this caused the problem in PR 2964, plus the local RA crash noted in the comments. This was needed to make DeadInstructionElimination, but as we are not running that, it is backed out for now. Eventually it should go back in and the other problems fixed where they're broken. llvm-svn: 58391
* Support for constant islands in the ARM JIT.Jim Grosbach2008-10-282-2/+49
| | | | | | | | | | | | | | | | Since the ARM constant pool handling supercedes the standard LLVM constant pool entirely, the JIT emitter does not allocate space for the constants, nor initialize the memory. The constant pool is considered part of the instruction stream. Likewise, when resolving relocations into the constant pool, a hook into the target back end is used to resolve from the constant ID# to the address where the constant is stored. For now, the support in the ARM emitter is limited to 32-bit integer. Future patches will expand this to the full range of constants necessary. llvm-svn: 58338
* Fix darwin ppc llvm-gcc build breakage: interceptDuncan Sands2008-10-281-5/+7
| | | | | | | | | | ppcf128 to i32 conversion and expand it into a code sequence like in LegalizeDAG. This needs custom ppc lowering of FP_ROUND_INREG, so turn that on and make it work with LegalizeTypes. Probably PPC should simply custom lower the original conversion. llvm-svn: 58329
* Fix a nasty miscompilation of 176.gcc on linux/x86 where we synthesizedChris Lattner2008-10-281-4/+9
| | | | | | | | | | | a memset using 16-byte XMM stores, but where the stack realignment code didn't work. Until it does (PR2962) disable use of xmm regs in memcpy and memset formation for linux and other targets with insufficiently aligned stacks. This is part of PR2888 llvm-svn: 58317
* Have TableGen emit setSubgraphColor calls under control of a -gen-debugDavid Greene2008-10-279-9/+9
| | | | | | | | flag. Then in a debugger developers can set breakpoints at these calls to see waht is about to be selected and what the resulting subgraph looks like. This really helps when debugging instruction selection. llvm-svn: 58278
* For now, don't split live intervals around x87 stack register barriers. ↵Evan Cheng2008-10-273-0/+17
| | | | | | FpGET_ST0_80 must be right after a call instruction (and ADJCALLSTACKUP) so we need to find a way to prevent reload of x87 registers between them. llvm-svn: 58230
* Move the code that adds the DeadMachineInstructionElimPass fromDan Gohman2008-10-251-0/+5
| | | | | | | | | | | | target-independent code to target-specific code. This prevents it from running on targets that aren't using fast-isel. In addition to saving compile time, this addresses the problem that not all targets are prepared for it. In order to use this pass, all instructions must declare all their fixed uses and defs of physical registers. llvm-svn: 58144
* Support for allocation of TLS variables in the JIT. Allocation of a globalNicolas Geoffray2008-10-252-1/+20
| | | | | | | | variable is moved to the execution engine. The JIT calls the TargetJITInfo to allocate thread local storage. Currently, only linux/x86 knows how to allocate thread local global variables. llvm-svn: 58142
* Generate code for TLS instructions.Nicolas Geoffray2008-10-253-4/+27
| | | | llvm-svn: 58141
* CMake: lib/Target/ARM/AsmPrinter/CMakeLists.txt added.Oscar Fuentes2008-10-251-0/+9
| | | | llvm-svn: 58133
* Mark MFCR as reading all condition code registers.Dale Johannesen2008-10-241-0/+2
| | | | | | | Prevents some more overzealous deletions (mostly in AltiVec code). llvm-svn: 58121
* Rewrite logic to figure out whether LR needs toDale Johannesen2008-10-242-32/+34
| | | | | | | | be saved/restored in the prolog/epilog. We need to do this iff something in the function stores into it. llvm-svn: 58116
* move the note to the correct READMETorok Edwin2008-10-242-95/+97
| | | | llvm-svn: 58104
* add note about va_arg code on x86 and x86-64Torok Edwin2008-10-241-0/+94
| | | | llvm-svn: 58103
* Fix translateX86CC: if SetCCOpcode is SETULE andDuncan Sands2008-10-241-13/+10
| | | | | | | | | | | | | | LHS is a foldable load, then LHS and RHS are swapped and SetCCOpcode is changed to SETUGT. But the later code is expecting operands to be the wrong way round for SETUGT, but they are not in this case, resulting in an inverted compare. The solution is to move the load normalization before the correction for SETUGT. This bug was tickled by LegalizeTypes which happened to legalize the testcase slightly differently to LegalizeDAG. llvm-svn: 58092
* Fix constant-offset emission for x86-64 absolute addresses. ThisDan Gohman2008-10-242-11/+22
| | | | | | | fixes a bunch of test-suite JIT failures on x86-64 in -relocation-model=static mode. llvm-svn: 58066
* Mark defs and uses of CTR and LR correctly.Dale Johannesen2008-10-232-11/+30
| | | | | | | | Prevents DeadMachineInstructionElim from thinking things like MTCTR are dead (fixes massive testsuite breakage at -O0). llvm-svn: 58043
* remove extraneous #ifdef'sJim Grosbach2008-10-221-4/+0
| | | | llvm-svn: 58006
* Remove allocation of unused stack slot.Dale Johannesen2008-10-221-6/+0
| | | | llvm-svn: 57987
* Get this working with LegalizeTypes: (1) don'tDuncan Sands2008-10-221-5/+9
| | | | | | | | | assume that i64 has been turned into a BUILD_PAIR node (when called from LegalizeTypes this hasn't happened yet) and don't use a vector shuffle mask with an illegal element type. llvm-svn: 57972
* Fix PR2907 by digging through constant expressions to find FP constants thatChris Lattner2008-10-221-42/+63
| | | | | | are their operands. llvm-svn: 57956
* CMake: Turned some libraries into partially linked objects. CorrectedOscar Fuentes2008-10-223-3/+3
| | | | | | names of LLVMCore and ARMCodeGen. llvm-svn: 57943
* Adjust comments for pedantic satisfaction.Dale Johannesen2008-10-221-9/+9
| | | | llvm-svn: 57940
* Add comments to explain uint64->f64 algorithm,Dale Johannesen2008-10-211-0/+35
| | | | | | well, sort of. (Algorithm by Ian Ollmann.) llvm-svn: 57932
* Add an SSE2 algorithm for uint64->f64 conversion.Dale Johannesen2008-10-212-2/+70
| | | | | | | | | | The same one Apple gcc uses, faster. Also gets the extreme case in gcc.c-torture/execute/ieee/rbug.c correct which we weren't before; this is not sufficient to get the test to pass though, there is another bug. llvm-svn: 57926
* Implement the optimized FCMP_OEQ/FCMP_UNE code for x86 fast-isel.Dan Gohman2008-10-211-0/+12
| | | | llvm-svn: 57915
* use pre-UAL mnemonics for push/pop for compilaton callback functionJim Grosbach2008-10-211-2/+2
| | | | llvm-svn: 57911
* Disable constant-offset folding for PowerPC, as the PowerPC targetDan Gohman2008-10-212-0/+8
| | | | | | isn't yet prepared for it. llvm-svn: 57886
* Don't create TargetGlobalAddress nodes with offsets that don't fitDan Gohman2008-10-211-1/+1
| | | | | | | | | | | | | | in the 32-bit signed offset field of addresses. Even though this may be intended, some linkers refuse to relocate code where the relocated address computation overflows. Also, fix the sign-extension of constant offsets to use the actual pointer size, rather than the size of the GlobalAddress node, which may be different, for example on x86-64 where MVT::i32 is used when the address is being fit into the 32-bit displacement field. llvm-svn: 57885
* Optimized FCMP_OEQ and FCMP_UNE for x86.Dan Gohman2008-10-213-86/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Where previously LLVM might emit code like this: ucomisd %xmm1, %xmm0 setne %al setp %cl orb %al, %cl jne .LBB4_2 it now emits this: ucomisd %xmm1, %xmm0 jne .LBB4_2 jp .LBB4_2 It has fewer instructions and uses fewer registers, but it does have more branches. And in the case that this code is followed by a non-fallthrough edge, it may be followed by a jmp instruction, resulting in three branch instructions in sequence. Some effort is made to avoid this situation. To achieve this, X86ISelLowering.cpp now recognizes FCMP_OEQ and FCMP_UNE in lowered form, and replace them with code that emits two branches, except in the case where it would require converting a fall-through edge to an explicit branch. Also, X86InstrInfo.cpp's branch analysis and transform code now knows now to handle blocks with multiple conditional branches. It uses loops instead of having fixed checks for up to two instructions. It can now analyze and transform code generated from FCMP_OEQ and FCMP_UNE. llvm-svn: 57873
* When the coalescer is doing rematerializing, have it removeDan Gohman2008-10-211-3/+8
| | | | | | | | | | | | | | | | | | | | the copy instruction from the instruction list before asking the target to create the new instruction. This gets the old instruction out of the way so that it doesn't interfere with the target's rematerialization code. In the case of x86, this helps it find more cases where EFLAGS is not live. Also, in the X86InstrInfo.cpp, teach isSafeToClobberEFLAGS to check to see if it reached the end of the block after scanning each instruction, instead of just before. This lets it notice when the end of the block is only two instructions away, without doing any additional scanning. These changes allow rematerialization to clobber EFLAGS in more cases, for example using xor instead of mov to set the return value to zero in the included testcase. llvm-svn: 57872
* Update the stub and callback code to handle lazy compilation. The stubJim Grosbach2008-10-201-62/+90
| | | | | | | | | | is re-written by the callback to branch directly to the compiled code in future invocations. Added back in range-based memory permission functions for the updating of the stub on Darwin. llvm-svn: 57846
* Have X86 custom lowering for LegalizeTypes useDuncan Sands2008-10-201-10/+12
| | | | | | | | | | | | | LowerOperation if it doesn't know what else to do. This methods should probably be factorized some, but this is good enough for the moment. Have LowerATOMIC_BINARY_64 use EXTRACT_ELEMENT rather than assuming the operand is a BUILD_PAIR (if it is then getNode will automagically simplify the EXTRACT_ELEMENT). This way LowerATOMIC_BINARY_64 usable from LegalizeTypes. llvm-svn: 57831
* Teach DAGCombine to fold constant offsets into GlobalAddress nodes,Dan Gohman2008-10-1812-70/+94
| | | | | | | | | | | | | | | | | | | | | | and add a TargetLowering hook for it to use to determine when this is legal (i.e. not in PIC mode, etc.) This allows instruction selection to emit folded constant offsets in more cases, such as the included testcase, eliminating the need for explicit arithmetic instructions. This eliminates the need for the C++ code in X86ISelDAGToDAG.cpp that attempted to achieve the same effect, but wasn't as effective. Also, fix handling of offsets in GlobalAddressSDNodes in several places, including changing GlobalAddressSDNode's offset from int to int64_t. The Mips, Alpha, Sparc, and CellSPU targets appear to be unaware of GlobalAddress offsets currently, so set the hook to false on those targets. llvm-svn: 57748
* This is now partly done.Dan Gohman2008-10-171-1/+1
| | | | llvm-svn: 57734
* This is done.Dan Gohman2008-10-171-10/+0
| | | | llvm-svn: 57733
* Add implicit defs of XMM8 to XMM15 on 32-bit call instructions. While this ↵Evan Cheng2008-10-171-1/+2
| | | | | | is not technically true, it tells tblgen that these instructions "clobber" the entire XMM register file. llvm-svn: 57723
OpenPOWER on IntegriCloud