summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement necessary bits for flt_rounds gcc builtin. Anton Korobeynikov2007-11-151-0/+1
| | | | | | Codegen bits and llvm-gcc support will follow. llvm-svn: 44182
* If a call to getTruncStore is for a normal store,Duncan Sands2007-10-301-3/+5
| | | | | | | | offload to getStore rather than trying to handle both cases at once (the assertions for example assume the store really is truncating). llvm-svn: 43498
* If the value types are equal then this routineDuncan Sands2007-10-191-1/+1
| | | | | | | | | asserts in later checks rather than producing the ordinary load it is supposed to. Avoid all such hassles by directly returning an ordinary load in this case. llvm-svn: 43174
* Add support for byval function whose argument is not 32 bit aligned.Rafael Espindola2007-10-191-0/+24
| | | | | | | | | | To do this it is necessary to add a "always inline" argument to the memcpy node. For completeness I have also added this node to memmove and memset. I have also added getMem* functions, because the extra argument makes it cumbersome to use getNode and because I get confused by it :-) llvm-svn: 43172
* Return Expand from getOperationAction for all extendedDuncan Sands2007-10-171-10/+17
| | | | | | | | | | | | | | | | | | | types. This is needed for SIGN_EXTEND_INREG at least. It is not clear if this is correct for other operations. On the other hand, for the various load/store actions it seems to correct to return the type action, as is currently done. Also, it seems that SelectionDAG::getValueType can be called for extended value types; introduce a map for holding these, since we don't really want to extend the vector to be 2^32 pointers long! Generalize DAGTypeLegalizer::PromoteResult_TRUNCATE and DAGTypeLegalizer::PromoteResult_INT_EXTEND to handle the various funky possibilities that apints introduce, for example that you can promote to a type that needs to be expanded. llvm-svn: 43071
* Disable attempts to constant fold PPC f128.Dale Johannesen2007-10-161-36/+41
| | | | | | | Remove the assumption that this will happen from various places. llvm-svn: 43053
* Initial infrastructure for arbitrary precision integerDuncan Sands2007-10-161-26/+32
| | | | | | | | | | codegen support. This should have no effect on codegen for other types. Debatable bits: (1) the use (abuse?) of a set in SDNode::getValueTypeList; (2) the length of getTypeToTransformTo, which maybe should be refactored with a non-inline part for extended value types. llvm-svn: 43030
* add a new CreateStackTemporary helper method.Chris Lattner2007-10-151-0/+13
| | | | llvm-svn: 42994
* One mundane change: Change ReplaceAllUsesOfValueWith to *optionally* Chris Lattner2007-10-151-35/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | take a deleted nodes vector, instead of requiring it. One more significant change: Implement the start of a legalizer that just works on types. This legalizer is designed to run before the operation legalizer and ensure just that the input dag is transformed into an output dag whose operand and result types are all legal, even if the operations on those types are not. This design/impl has the following advantages: 1. When finished, this will *significantly* reduce the amount of code in LegalizeDAG.cpp. It will remove all the code related to promotion and expansion as well as splitting and scalarizing vectors. 2. The new code is very simple, idiomatic, and modular: unlike LegalizeDAG.cpp, it has no 3000 line long functions. :) 3. The implementation is completely iterative instead of recursive, good for hacking on large dags without blowing out your stack. 4. The implementation updates nodes in place when possible instead of deallocating and reallocating the entire graph that points to some mutated node. 5. The code nicely separates out handling of operations with invalid results from operations with invalid operands, making some cases simpler and easier to understand. 6. The new -debug-only=legalize-types option is very very handy :), allowing you to easily understand what legalize types is doing. This is not yet done. Until the ifdef added to SelectionDAGISel.cpp is enabled, this does nothing. However, this code is sufficient to legalize all of the code in 186.crafty, olden and freebench on an x86 machine. The biggest issues are: 1. Vectors aren't implemented at all yet 2. SoftFP is a mess, I need to talk to Evan about it. 3. No lowering to libcalls is implemented yet. 4. Various operations are missing etc. 5. There are FIXME's for stuff I hax0r'd out, like softfp. Hey, at least it is a step in the right direction :). If you'd like to help, just enable the #ifdef in SelectionDAGISel.cpp and compile code with it. If this explodes it will tell you what needs to be implemented. Help is certainly appreciated. Once this goes in, we can do three things: 1. Add a new pass of dag combine between the "type legalizer" and "operation legalizer" passes. This will let us catch some long-standing isel issues that we miss because operation legalization often obfuscates the dag with target-specific nodes. 2. We can rip out all of the type legalization code from LegalizeDAG.cpp, making it much smaller and simpler. When that happens we can then reimplement the core functionality left in it in a much more efficient and non-recursive way. 3. Once the whole legalizer is non-recursive, we can implement whole-function selectiondags maybe... llvm-svn: 42981
* Disable some compile-time optimizations on PPCDale Johannesen2007-10-141-0/+3
| | | | | | long double. llvm-svn: 42958
* Add an ISD::FPOW node type.Dan Gohman2007-10-111-0/+1
| | | | llvm-svn: 42879
* Next PPC long double bits: ppcf128->i32 conversion.Dale Johannesen2007-10-101-0/+6
| | | | | | | Surprisingly complicated. Adds getTargetNode for 2 outputs, no inputs (missing). llvm-svn: 42822
* Add convenience overloads of SelectionDAG::getNode that take a SDVTListDan Gohman2007-10-081-0/+36
| | | | | | and individual SDOperand operands. llvm-svn: 42753
* convertFromInteger, as originally written, expected sign-extendedNeil Booth2007-10-071-1/+1
| | | | | | | | input. APInt unfortunately zero-extends signed integers, so Dale modified the function to expect zero-extended input. Make this assumption explicit in the function name. llvm-svn: 42732
* Provide names for MUL_LOHI and DIVREM operators.Dan Gohman2007-10-051-0/+4
| | | | llvm-svn: 42634
* Add a variant of getTargetNode() that takes a vector of MVT::ValueType.Evan Cheng2007-10-051-0/+7
| | | | llvm-svn: 42620
* remove dup commentDale Johannesen2007-09-301-1/+0
| | | | llvm-svn: 42486
* Constant fold int-to-long-double conversions;Dale Johannesen2007-09-301-1/+1
| | | | | | | | use APFloat for int-to-float/double; use round-to-nearest for these (implementation-defined, seems to match gcc). llvm-svn: 42484
* Change APFloat::convertFromInteger to take the incomingDale Johannesen2007-09-211-2/+4
| | | | | | | | | | bit width instead of number of words allocated, which makes it actually work for int->APF conversions. Adjust callers. Add const to one of the APInt constructors to prevent surprising match when called with const argument. llvm-svn: 42210
* More long double fixes. x86_64 should build now.Dale Johannesen2007-09-191-3/+13
| | | | llvm-svn: 42155
* Do not hide APInt::dump() inside #ifndef NDEBUG.Devang Patel2007-09-171-2/+0
| | | | llvm-svn: 42068
* This is not ideal but unbreaks build failure.Devang Patel2007-09-171-0/+2
| | | | | | APInt::dump() is inside #ifndef NDEBUG, however SelectionDAG dump() routines are not. llvm-svn: 42047
* Remove the assumption that FP's are either float orDale Johannesen2007-09-141-16/+12
| | | | | | | | | | | | | double from some of the many places in the optimizers it appears, and do something reasonable with x86 long double. Make APInt::dump() public, remove newline, use it to dump ConstantSDNode's. Allow APFloats in FoldingSet. Expand X86 backend handling of long doubles (conversions to/from int, mostly). llvm-svn: 41967
* Fix build problems on Cygwin (PR1652), patch by Patrick Walton.Chris Lattner2007-09-131-10/+10
| | | | llvm-svn: 41923
* Yet another getTargetNode variant.Evan Cheng2007-09-121-0/+12
| | | | llvm-svn: 41898
* Revise previous patch per review comments.Dale Johannesen2007-09-121-6/+6
| | | | | | | Next round of x87 long double stuff. Getting close now, basically works. llvm-svn: 41875
* Add APInt interfaces to APFloat (allows directlyDale Johannesen2007-09-111-7/+6
| | | | | | | | | access to bits). Use them in place of float and double interfaces where appropriate. First bits of x86 long double constants handling (untested, probably does not work). llvm-svn: 41858
* Fold the adjust_trampoline intrinsic intoDuncan Sands2007-09-111-2/+1
| | | | | | | init_trampoline. There is now only one trampoline intrinsic. llvm-svn: 41841
* Add mod, copysign, abs operations to APFloat.Dale Johannesen2007-08-311-30/+58
| | | | | | | | Implement some constant folding in SelectionDAG and DAGCombiner using APFloat. Remove double versions of constructor and getValue from ConstantFPSDNode. llvm-svn: 41664
* Revise per review of previous patch.Dale Johannesen2007-08-311-12/+24
| | | | llvm-svn: 41645
* Enhance APFloat to retain bits of NaNs (fixes oggenc).Dale Johannesen2007-08-311-14/+43
| | | | | | | Use APFloat interfaces for more references, mostly of ConstantFPSDNode. llvm-svn: 41632
* Change LegalFPImmediates to use APFloat.Dale Johannesen2007-08-301-3/+41
| | | | | | | | | Add APFloat interfaces to ConstantFP, SelectionDAG. Fix integer bit in double->APFloat conversion. Convert LegalizeDAG to use APFloat interface in ConstantFPSDNode uses. llvm-svn: 41587
* Revise per review comments.Dale Johannesen2007-08-261-1/+1
| | | | llvm-svn: 41409
* Add APFloat interface to ConstantFPSDNode. ChangeDale Johannesen2007-08-251-3/+2
| | | | | | | over uses in DAGCombiner. Fix interfaces to work with APFloats. llvm-svn: 41407
* Poison APFloat::operator==. Replace existing uses with bitwiseIsEqual.Dale Johannesen2007-08-241-1/+1
| | | | | | This means backing out the preceding change to Constants.cpp, alas. llvm-svn: 41378
* Use APFloat internally for ConstantFPSDNode.Dale Johannesen2007-08-241-1/+1
| | | | llvm-svn: 41372
* Do not emit copies for physical register output if it's not used.Evan Cheng2007-08-021-1/+26
| | | | llvm-svn: 40722
* Support for trampolines, except for X86 codegen which isDuncan Sands2007-07-271-0/+4
| | | | | | still under discussion. llvm-svn: 40549
* Add selection DAG nodes for subreg insert/extract. PR1350Christopher Lamb2007-07-261-1/+4
| | | | llvm-svn: 40516
* Fix some uses of dyn_cast to be uses of cast.Dan Gohman2007-07-231-1/+1
| | | | llvm-svn: 40443
* As pointed out by g++-4.2, the original code didn't doDuncan Sands2007-07-191-2/+2
| | | | | | what it thought it was doing. llvm-svn: 40044
* Long live the exception handling!Anton Korobeynikov2007-07-141-0/+2
| | | | | | | | | | | | | | | This patch fills the last necessary bits to enable exceptions handling in LLVM. Currently only on x86-32/linux. In fact, this patch adds necessary intrinsics (and their lowering) which represent really weird target-specific gcc builtins used inside unwinder. After corresponding llvm-gcc patch will land (easy) exceptions should be more or less workable. However, exceptions handling support should not be thought as 'finished': I expect many small and not so small glitches everywhere. llvm-svn: 39855
* Change the peep for EXTRACT_VECTOR_ELT of BUILD_PAIR to look forDan Gohman2007-07-101-7/+19
| | | | | | | the new CONCAT_VECTORS node type instead, as that's what legalize uses now. And add a peep for EXTRACT_VECTOR_ELT of INSERT_VECTOR_ELT. llvm-svn: 38503
* Make the debug string for ISD::MERGE_VALUES consistent with the others.Dan Gohman2007-07-051-1/+1
| | | | llvm-svn: 37922
* Fix a vector FP constant CSE bug.Evan Cheng2007-06-291-5/+10
| | | | llvm-svn: 37814
* Rename ("shrinkify") MVT::isExtendedValueType to MVT::isExtendedVT.Dan Gohman2007-06-271-1/+1
| | | | llvm-svn: 37758
* Generalize MVT::ValueType and associated functions to be able to representDan Gohman2007-06-251-43/+52
| | | | | | | | | | | | | | | extended vector types. Remove the special SDNode opcodes used for pre-legalize vector operations, and the special MVT::Vector type used with them. Adjust lowering and legalize to work with the normal SDNode kinds instead, and to use the normal MVT functions to work with vector types instead of using the two special operands that the pre-legalize nodes held. This allows pre-legalize and post-legalize DAGs, and the code that operates on them, to be more consistent. Pre-legalize vector operators can be handled more consistently with scalar operators. And, -view-dag-combine1-dags and -view-legalize-dags now look prettier for vector code. llvm-svn: 37719
* Move ComputeMaskedBits, MaskedValueIsZero, and ComputeNumSignBits fromDan Gohman2007-06-221-0/+546
| | | | | | | | | TargetLowering to SelectionDAG so that they have more convenient access to the current DAG, in preparation for the ValueType routines being changed from standalone functions to members of SelectionDAG for the pre-legalize vector type changes. llvm-svn: 37704
* Pass a SelectionDAG into SDNode::dump everywhere it's used, in preprationDan Gohman2007-06-191-1/+1
| | | | | | | for needing the DAG node to print pre-legalize extended value types, and to get better debug messages with target-specific nodes. llvm-svn: 37656
* Rename MVT::getVectorBaseType to MVT::getVectorElementType.Dan Gohman2007-06-141-2/+2
| | | | llvm-svn: 37579
OpenPOWER on IntegriCloud