summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86FloatingPoint.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add WIN_FTOL_* psudo-instructions to model the unique calling conventionMichael J. Spencer2012-02-241-0/+26
| | | | | | used by the Win32 _ftol2 runtime function. Patch by Joe Groff! llvm-svn: 151382
* Silence a bunch (but not all) "variable written but not read" warningsDuncan Sands2011-08-121-0/+1
| | | | | | when building with assertions disabled. llvm-svn: 137460
* Don't clobber pending ST regs when FP regs are killed.Jakob Stoklund Olesen2011-08-081-0/+20
| | | | | | | | | | | | | | | | | | | X86FloatingPoint keeps track of pending ST registers for an upcoming inline asm instruction with fixed stack register constraints. It does this by remembering which FP register holds the value that should appear at a fixed stack position for the inline asm. When that FP register is killed before the inline asm, make sure to duplicate it to a scratch register, so the ST register still has a live FP reference. This could happen when the same FP register was copied to two ST registers, or when a spill instruction is inserted between the ST copy and the inline asm. This fixes PR10602. llvm-svn: 137050
* Handle IMPLICIT_DEF instructions in X86FloatingPoint.Jakob Stoklund Olesen2011-08-031-0/+13
| | | | | | This fixes PR10575. llvm-svn: 136787
* Consistent diagnostic capitalization and redundant context elimination.Jakob Stoklund Olesen2011-07-021-8/+5
| | | | llvm-svn: 134311
* Include a source location when complaining about bad inline assembly.Jakob Stoklund Olesen2011-07-021-10/+12
| | | | | | | | | | | | | | | | Add a MI->emitError() method that the backend can use to report errors related to inline assembly. Call it from X86FloatingPoint.cpp when the constraints are wrong. This enables proper clang diagnostics from the backend: $ clang -c pr30848.c pr30848.c:5:12: error: Inline asm output regs must be last on the x87 stack __asm__ ("" : "=u" (d)); /* { dg-error "output regs" } */ ^ 1 error generated. llvm-svn: 134307
* Tweak error messages to match GCC. Should fix gcc.target/i386/pr30848.cJakob Stoklund Olesen2011-06-301-3/+3
| | | | llvm-svn: 134193
* Clean up the handling of the x87 fp stack to make it more robust.Jakob Stoklund Olesen2011-06-281-153/+332
| | | | | | | | | | | | | | | | | | | | Drop the FpMov instructions, use plain COPY instead. Drop the FpSET/GET instruction for accessing fixed stack positions. Instead use normal COPY to/from ST registers around inline assembly, and provide a single new FpPOP_RETVAL instruction that can access the return value(s) from a call. This is still necessary since you cannot tell from the CALL instruction alone if it returns anything on the FP stack. Teach fast isel to use this. This provides a much more robust way of handling fixed stack registers - we can tolerate arbitrary FP stack instructions inserted around calls and inline assembly. Live range splitting could sometimes break x87 code by inserting spill code in unfortunate places. As a bonus we handle floating point inline assembly correctly now. llvm-svn: 134018
* Grow the X86FloatingPoint register map to hold 16 registers.Jakob Stoklund Olesen2011-06-271-5/+15
| | | | | | | This allows for more live scratch registers which is needed to handle live ST registers before return and inline asm instructions. llvm-svn: 133903
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129558
* Use the EdgeBundles analysis in X86FloatingPoint instead of recomputing CFGJakob Stoklund Olesen2011-01-041-87/+14
| | | | | | bundles in the pass. llvm-svn: 122833
* Turn the EdgeBundles class into a stand-alone machine CFG analysis pass.Jakob Stoklund Olesen2011-01-041-0/+3
| | | | | | | | | | The analysis will be needed by both the greedy register allocator and the X86FloatingPoint pass. It only needs to be computed once when the CFG doesn't change. This pass is very fast, usually showing up as 0.0% wall time. llvm-svn: 122832
* Switch attribute macros to use 'LLVM_' as a prefix. We retain the old namesChandler Carruth2010-10-231-1/+2
| | | | | | until other LLVM projects using these are cleaned up. llvm-svn: 117200
* Remove some variables that are never really usedDuncan Sands2010-10-211-1/+0
| | | | | | (gcc-4.6 warns about these). llvm-svn: 117021
* Turn some fp stackifier assertion into errors to avoid silently generating ↵Evan Cheng2010-10-121-7/+14
| | | | | | bad code when assertions are off. rdar://8540457. llvm-svn: 116368
* Marked with ATTRIBUTE_USED so that clang doesn't complain.Bill Wendling2010-08-181-1/+1
| | | | llvm-svn: 111383
* Partially revert r111155. It looks like MSVC is calling an operator<() thatJakob Stoklund Olesen2010-08-161-0/+3
| | | | | | clang says is unused. llvm-svn: 111167
* Remove unused functions.Jakob Stoklund Olesen2010-08-161-8/+0
| | | | llvm-svn: 111155
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110460
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110410
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-1/+1
| | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
* doxygenify some comments.Chris Lattner2010-07-171-19/+19
| | | | llvm-svn: 108625
* Keep valgrind quiet.Jakob Stoklund Olesen2010-07-161-1/+6
| | | | | | | The isLive() method can read uninitialized memory, but it still gives correct results. llvm-svn: 108561
* Search for a free FP register instead of just assuming FP7 is not in use.Jakob Stoklund Olesen2010-07-161-6/+12
| | | | llvm-svn: 108535
* Allow x87 FP registers to be alive globally in a function.Jakob Stoklund Olesen2010-07-161-36/+383
| | | | | | | | | | | | | | | | FP_REG_KILL instructions are still inserted, but can be disabled by passing -live-x87 to llc. The X87FPRegKillInserterPass is going to be removed shortly. CFG edges are partioned into bundles where the x87 stack must be allocated identically. Code is insertad at the end of each basic block that shuffles the live FP registers to match the outgoing bundles expectations. This fix is in preparation for some upcoming register allocator improvements that may extend the live range of registers beyond a basic block, similar to LICM. It also provides a nice runtime speedup if you are building with -mfpmath=387. llvm-svn: 108529
* Don't emit st(0)/st(1) copies as FpMOV instructions. Use FpSET_ST? instead.Jakob Stoklund Olesen2010-07-101-40/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on a patch by Rafael Espíndola. Attempt to make the FpSET_ST1 hack more robust, but we are still relying on FpSET_ST0 preceeding it. This is only for supporting really weird x87 inline asm. We support: FpSET_ST0 INLINEASM FpSET_ST0 FpSET_ST1 INLINEASM with and without kills on the arguments. We don't support: FpSET_ST1 FpSET_ST0 INLINEASM nor FpSET_ST1 INLINEASM Just Don't Do It! llvm-svn: 108047
* add some long-overdue enums to refer to the parts of the 5-operandChris Lattner2010-07-081-1/+1
| | | | | | X86 memory operand. llvm-svn: 107925
* Teach the x86 floating point stackifier to handle COPY instructions.Jakob Stoklund Olesen2010-07-081-1/+36
| | | | | | | | | | | This pass runs before COPY instructions are passed to copyPhysReg, so we simply translate COPY to the proper pseudo instruction. Note that copyPhysReg does not handle floating point stack copies. Once COPY is used everywhere, this can be cleaned up a bit, and most of the pseudo instructions can be removed. llvm-svn: 107899
* Use pre-increment instead of post-increment when the result is not used.Dan Gohman2010-06-221-3/+3
| | | | llvm-svn: 106542
* Reapply r105521, this time appending "LLU" to 64 bitBruno Cardoso Lopes2010-06-081-1/+1
| | | | | | immediates to avoid breaking the build. llvm-svn: 105652
* revert r105521, which is breaking the buildbots with stuff like this:Chris Lattner2010-06-051-1/+1
| | | | | | | | | | | | | | In file included from X86InstrInfo.cpp:16: X86GenInstrInfo.inc:2789: error: integer constant is too large for 'long' type X86GenInstrInfo.inc:2790: error: integer constant is too large for 'long' type X86GenInstrInfo.inc:2792: error: integer constant is too large for 'long' type X86GenInstrInfo.inc:2793: error: integer constant is too large for 'long' type X86GenInstrInfo.inc:2808: error: integer constant is too large for 'long' type X86GenInstrInfo.inc:2809: error: integer constant is too large for 'long' type X86GenInstrInfo.inc:2816: error: integer constant is too large for 'long' type X86GenInstrInfo.inc:2817: error: integer constant is too large for 'long' type llvm-svn: 105524
* Initial AVX support for some instructions. No patterns matchedBruno Cardoso Lopes2010-06-051-1/+1
| | | | | | yet, only assembly encoding support. llvm-svn: 105521
* Teach X86FloatingPoint that a register can be killed multiple times by the sameJakob Stoklund Olesen2010-04-281-6/+7
| | | | | | | | | | | | instruction. This instruction would crash the pass: INLINEASM <es:foo $0 $1>, 9, %FP0<kill>, 9, %FP0<kill>, 14, %EFLAGS<earlyclobber,def,dead> Now it doesn't. llvm-svn: 102509
* move target-independent opcodes out of TargetInstrInfoChris Lattner2010-02-091-2/+2
| | | | | | | | | into TargetOpcodes.h. #include the new TargetOpcodes.h into MachineInstr. Add new inline accessors (like isPHI()) to MachineInstr, and start using them throughout the codebase. llvm-svn: 95687
* Change errs() to dbgs().David Greene2010-01-051-8/+8
| | | | llvm-svn: 92654
* improve portability to avoid conflicting with std::next in c++'0x.Chris Lattner2009-12-031-1/+1
| | | | | | Patch by Howard Hinnant! llvm-svn: 90365
* Remove includes of Support/Compiler.h that are no longer needed after theNick Lewycky2009-10-251-1/+0
| | | | | | VISIBILITY_HIDDEN removal. llvm-svn: 85043
* Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky2009-10-251-1/+1
| | | | | | | Chris claims we should never have visibility_hidden inside any .cpp file but that's still not true even after this commit. llvm-svn: 85042
* fix PR4767, a crash because fp stackifier visited blocks inChris Lattner2009-09-081-0/+8
| | | | | | | | depth first order, so it wouldn't process unreachable blocks. When compiling at -O0, late dead block elimination isn't done and the bad instructions got to isel. llvm-svn: 81187
* eliminate uses of cerr()Chris Lattner2009-08-231-3/+3
| | | | llvm-svn: 79834
* remove various std::ostream version of printing methods fromChris Lattner2009-08-231-3/+3
| | | | | | | | MachineInstr and MachineOperand. This required eliminating a bunch of stuff that was using DOUT, I hope that bill doesn't mind me stealing his fun. ;-) llvm-svn: 79813
* - s/DOUT/DEBUG(errs()/gBill Wendling2009-08-031-10/+11
| | | | | | - Tidy up some headers. llvm-svn: 77929
* X86 floating-point passes don't modify the CFG.Dan Gohman2009-08-011-0/+1
| | | | llvm-svn: 77757
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-2/+2
| | | | | | | | | This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). llvm-svn: 75640
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-111-2/+3
| | | | | | | | | Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. llvm-svn: 75379
* Fix PR4485.Rafael Espindola2009-06-301-3/+6
| | | | | | | Avoid unnecessary duplication of operand 0 of X86::FpSET_ST0_80. This duplication would cause one register to remain on the stack at the function return. llvm-svn: 74534
* Fix PR4484.Rafael Espindola2009-06-301-3/+5
| | | | | | This was caused by me confounding FP0 and ST(0). llvm-svn: 74523
* FIX PR 4459.Rafael Espindola2009-06-291-1/+1
| | | | | | | Not sure I understand how the temp register gets used, but this fixes a bug and introduces no regressions. llvm-svn: 74446
* Fix PR4185.Rafael Espindola2009-06-211-2/+7
| | | | | | Handle FpSET_ST0_80 being used when ST0 is still alive. llvm-svn: 73850
* Have only one definition of X86AddrNumOperands.Rafael Espindola2009-03-281-1/+0
| | | | llvm-svn: 67949
OpenPOWER on IntegriCloud