aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Added raw_fd_ostream::close().Ted Kremenek2008-10-231-3/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58052 91177308-0d34-0410-b5e6-96231b3b80d8
* Committing a good chunk of the pre-register allocation live interval ↵Evan Cheng2008-10-232-12/+578
| | | | | | splitting pass. It's handling simple cases and appear to do good things. Next: avoid splitting an interval multiple times; renumber registers when possible; record stack slot live intervals for coloring; rematerialize defs when possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58044 91177308-0d34-0410-b5e6-96231b3b80d8
* 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58043 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure to set stdout to binary when writing bitcode files viaDaniel Dunbar2008-10-231-0/+3
| | | | | | | std::ostream API. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58042 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix thinko - the operand number has nothing to doDuncan Sands2008-10-232-3/+3
| | | | | | | with the result number. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58041 91177308-0d34-0410-b5e6-96231b3b80d8
* Change create*Pass factory functions to return Pass* instead ofDaniel Dunbar2008-10-229-9/+9
| | | | | | | | | | | | LoopPass*. - Although less precise, this means they can be used in clients without RTTI (who would otherwise need to include LoopPass.h, which eventually includes things using dynamic_cast). This was the simplest solution that presented itself, but I am happy to use a better one if available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58010 91177308-0d34-0410-b5e6-96231b3b80d8
* remove extraneous #ifdef'sJim Grosbach2008-10-221-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58006 91177308-0d34-0410-b5e6-96231b3b80d8
* Add raw_ostream versions of WriteBitcodeToFile and BitcodeWriterPass.Daniel Dunbar2008-10-222-5/+26
| | | | | | | | - The old versions are still hanging around, but should be migrated away from. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57989 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove allocation of unused stack slot.Dale Johannesen2008-10-221-6/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57987 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for PR2881: fix a small leak exposed by valgrind, using a ManagedStatic.Julien Lerouge2008-10-221-6/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57984 91177308-0d34-0410-b5e6-96231b3b80d8
* LegalizeTypes soft-float support for fpow.Duncan Sands2008-10-222-1/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57973 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57972 91177308-0d34-0410-b5e6-96231b3b80d8
* Be nice to CellSPU: for this target getSetCCResultTypeDuncan Sands2008-10-221-2/+8
| | | | | | | | | | | | | may return i8, which can result in SELECT nodes for which the type of the condition is i8, but there are no patterns for select with i8 condition. Tweak the LegalizeTypes logic to avoid this as much as possible. This isn't a real fix because it is still perfectly possible to end up with such select nodes - CellSPU needs to be fixed IMHO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57968 91177308-0d34-0410-b5e6-96231b3b80d8
* Port from LegalizeDAG the logic to only generateDuncan Sands2008-10-221-8/+44
| | | | | | | ADDC/ADDE/SUBC/SUBE if the target supports it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57967 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some comments explaining the meaning of a booleanDuncan Sands2008-10-221-4/+2
| | | | | | | | | that is not of type MVT::i1 in SELECT and SETCC nodes. Relax the LegalizeTypes SELECT condition promotion sanity checks to allow other condition types than i1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57966 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily allow the operands of a BUILD_VECTORDuncan Sands2008-10-221-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | to have a different type to the vector element type. This should be fairly harmless because in the past guys like this were being built all over the place (and were cleaned up when I added this check). The reason for relaxing this check is that it helps LegalizeTypes legalize vector shuffles: the mask is a BUILD_VECTOR that it is *not always possible* to legalize while keeping it a BUILD_VECTOR (vector_shuffle requires the mask to be a BUILD_VECTOR, as opposed to a vector with the right vector type). With this check it is even harder to legalize the mask - turning the check off means that LegalizeTypes manages to legalize almost all vector shuffles encountered in practice. The correct solution is to change vector_shuffle to be a variadic node with the mask built into it as operands. While waiting for that change, this hack stops the problem with vector_shuffle from blocking the turning on of LegalizeTypes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57965 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2907 by digging through constant expressions to find FP constants thatChris Lattner2008-10-221-42/+63
| | | | | | | are their operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57956 91177308-0d34-0410-b5e6-96231b3b80d8
* Move Print*Pass to use raw_ostream.Daniel Dunbar2008-10-222-13/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57946 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Turned some libraries into partially linked objects. CorrectedOscar Fuentes2008-10-225-5/+5
| | | | | | | names of LLVMCore and ARMCodeGen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57943 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust comments for pedantic satisfaction.Dale Johannesen2008-10-221-9/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57940 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: updated lib/VMCore/CMakeLists.txtOscar Fuentes2008-10-211-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57937 91177308-0d34-0410-b5e6-96231b3b80d8
* Privatize PrintModulePass and PrintFunctionPass and addDaniel Dunbar2008-10-213-11/+100
| | | | | | | | createPrintModulePass and createPrintFunctionPass. - So clients who compile w/o RTTI can use them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57933 91177308-0d34-0410-b5e6-96231b3b80d8
* Add comments to explain uint64->f64 algorithm,Dale Johannesen2008-10-211-0/+35
| | | | | | | | well, sort of. (Algorithm by Ian Ollmann.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57932 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an SSE2 algorithm for uint64->f64 conversion.Dale Johannesen2008-10-213-2/+86
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57926 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix SelectionDAGBuild lowering of Select instructions toDan Gohman2008-10-211-8/+22
| | | | | | | | handle first-class aggregate values. Also, fix a bug in the Ret handling for empty aggregates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57925 91177308-0d34-0410-b5e6-96231b3b80d8
* Clear raw_fd_ostream error string on success and explain behavior inDaniel Dunbar2008-10-211-3/+6
| | | | | | | | | documentation. Add C++ header marker. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57923 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the optimized FCMP_OEQ/FCMP_UNE code for x86 fast-isel.Dan Gohman2008-10-211-0/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57915 91177308-0d34-0410-b5e6-96231b3b80d8
* use pre-UAL mnemonics for push/pop for compilaton callback functionJim Grosbach2008-10-211-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57911 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a tricky bug in the JIT global variable emitter, that was triggered when ↵Nuno Lopes2008-10-212-6/+40
| | | | | | JITing a variable independently of a function. This lead to sharing memory memory between functions and GVs thus changing the value of a GV could change the code in execution. more details on the ML. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57900 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable constant-offset folding for PowerPC, as the PowerPC targetDan Gohman2008-10-212-0/+8
| | | | | | | isn't yet prepared for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57886 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't create TargetGlobalAddress nodes with offsets that don't fitDan Gohman2008-10-212-2/+2
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57885 91177308-0d34-0410-b5e6-96231b3b80d8
* Optimized FCMP_OEQ and FCMP_UNE for x86.Dan Gohman2008-10-214-101/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57873 91177308-0d34-0410-b5e6-96231b3b80d8
* When the coalescer is doing rematerializing, have it removeDan Gohman2008-10-212-5/+11
| | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57872 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the NaN test come second, heuristically assumingDan Gohman2008-10-211-12/+12
| | | | | | | that NaNs are less common. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57871 91177308-0d34-0410-b5e6-96231b3b80d8
* Use Function::getEntryBlock() instead of Function::front(), for clarity.Dan Gohman2008-10-211-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57870 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: updated lib/CodeGen/CMakeLists.txtOscar Fuentes2008-10-211-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57869 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug that prevented llvm-extract -delete from working.Dan Gohman2008-10-211-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57864 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix gcc.c-torture/compile/920520-1.c by inserting bitconvertsChris Lattner2008-10-211-7/+30
| | | | | | | | | | for strange asm conditions earlier. In this case, we have a double being passed in an integer reg class. Convert to like sized integer register so that we allocate the right number for the class (two i32's for the f64 in this case). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57862 91177308-0d34-0410-b5e6-96231b3b80d8
* Add skeleton for the pre-register allocation live interval splitting pass.Evan Cheng2008-10-201-0/+81
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57847 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the stub and callback code to handle lazy compilation. The stubJim Grosbach2008-10-203-64/+120
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57846 91177308-0d34-0410-b5e6-96231b3b80d8
* Fast-isel no longer an experiment.Dan Gohman2008-10-201-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57845 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a register class -> virtual registers map.Evan Cheng2008-10-201-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57844 91177308-0d34-0410-b5e6-96231b3b80d8
* Support operations like fp_to_uint with a vectorDuncan Sands2008-10-202-1/+53
| | | | | | | | | | result type when the result type is legal but not the operand type. Add additional support for EXTRACT_SUBVECTOR and CONCAT_VECTORS, needed to handle such cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57840 91177308-0d34-0410-b5e6-96231b3b80d8
* LegalizeTypes support for atomic operation promotion.Duncan Sands2008-10-202-3/+78
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57838 91177308-0d34-0410-b5e6-96231b3b80d8
* Use DAG.getIntPtrConstant rather than DAG.getConstantDuncan Sands2008-10-202-6/+4
| | | | | | | with TLI.getPointerTy for a small simplification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57837 91177308-0d34-0410-b5e6-96231b3b80d8
* Always use either MVT::i1 or getSetCCResultType forDuncan Sands2008-10-201-15/+51
| | | | | | | | | the condition of a SELECT node. Make sure that the correct extension type (any-, sign- or zero-extend) is used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57836 91177308-0d34-0410-b5e6-96231b3b80d8
* Formatting - no functional change.Duncan Sands2008-10-202-7/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57834 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use a random type for the select condition,Duncan Sands2008-10-201-2/+1
| | | | | | | use an MVT::i1 and simplify the code while there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57833 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57831 91177308-0d34-0410-b5e6-96231b3b80d8
* Set N->OperandList to 0 after deletion. Otherwise, it's possible that it willBill Wendling2008-10-191-15/+26
| | | | | | | be either deleted or referenced afterwards. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57786 91177308-0d34-0410-b5e6-96231b3b80d8