summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement x86 support for @llvm.prefetch. It corresponds to prefetcht{0|1|2} ↵Evan Cheng2008-03-081-0/+18
| | | | | | and prefetchnta instructions. llvm-svn: 48042
* Clarify that CALLSEQ_START..END may not be nested,Dale Johannesen2008-03-051-0/+7
| | | | | | and add some protection against creating such. llvm-svn: 47957
* Improve comment, pass in the original VT so that we can shrink a long double ↵Chris Lattner2008-03-051-2/+4
| | | | | | | | constant all the way to float, not stopping at double. llvm-svn: 47937
* Codegen support for i128 UINT_TO_FP. This just fixes aDan Gohman2008-03-051-5/+2
| | | | | | | | bug in r47928 (Int64Ty is the correct type for the constant pool entry here) and removes the asserts, now that the code is capable of handling i128. llvm-svn: 47932
* Add a target lowering hook to control whether it's worthwhile to compress fp ↵Evan Cheng2008-03-051-1/+2
| | | | | | | | constant. For x86, if sse2 is available, it's not a good idea since cvtss2sd is slower than a movsd load and it prevents load folding. On x87, it's important to shrink fp constant since fldt is very expensive. llvm-svn: 47931
* 64bit CAS on 32bit x86.Andrew Lenharth2008-03-051-0/+11
| | | | llvm-svn: 47929
* Codegen support for i128 SINT_TO_FP.Dan Gohman2008-03-051-14/+30
| | | | llvm-svn: 47928
* Refactor ExpandConstantFP so it can optimize load from constpool of types ↵Evan Cheng2008-03-041-16/+19
| | | | | | larger than f64 into extload from smaller types. llvm-svn: 47883
* More APInt-ification.Dan Gohman2008-03-031-3/+4
| | | | llvm-svn: 47864
* all but CAS working on x86Andrew Lenharth2008-03-011-13/+14
| | | | llvm-svn: 47798
* Add MVT::is128BitVector and is64BitVector. ShrinkDale Johannesen2008-03-011-16/+5
| | | | | | | unaligned load/store code using them. Per review of unaligned load/store vector patch. llvm-svn: 47782
* Use the new convertFromAPInt instead of convertFromZeroExtendedInteger,Dan Gohman2008-02-291-5/+3
| | | | | | | which allows more of the surrounding arithmetic to be done with APInt instead of uint64_t. llvm-svn: 47745
* Fix an assertion message.Dale Johannesen2008-02-281-1/+1
| | | | llvm-svn: 47722
* implement expand for ISD::DECLARE by just deleting it.Chris Lattner2008-02-281-0/+3
| | | | llvm-svn: 47708
* Handle load/store of misaligned vectors that are the Dale Johannesen2008-02-271-19/+30
| | | | | | | | | | | | same size as an int type by doing a bitconvert of load/store of the int type (same algorithm as floating point). This makes them work for ppc Altivec. There was some code that purported to handle loads of (some) vectors by splitting them into two smaller vectors, but getExtLoad rejects subvector loads, so this could never have worked; the patch removes it. llvm-svn: 47696
* Remove the `else', at Evan's insistence.Dan Gohman2008-02-271-2/+1
| | | | llvm-svn: 47686
* Support for legalizing MEMBARRIER.Duncan Sands2008-02-271-2/+5
| | | | llvm-svn: 47667
* Teach Legalize how to expand an EXTRACT_ELEMENT.Dan Gohman2008-02-271-0/+6
| | | | llvm-svn: 47656
* Make some static variables const.Dan Gohman2008-02-251-3/+3
| | | | llvm-svn: 47566
* Convert MaskedValueIsZero and all its users to use APInt. Also addDan Gohman2008-02-251-10/+15
| | | | | | a SignBitIsZero function to simplify a common use case. llvm-svn: 47561
* Fix a regression in 403.gcc and 186.crafty introduced in 47383. To testDan Gohman2008-02-221-5/+5
| | | | | | | that a value is >= 32, check that all of the high bits are zero, not just one or more. llvm-svn: 47467
* Atomic op support. If any gcc test uses __sync builtins, it might start ↵Andrew Lenharth2008-02-211-0/+46
| | | | | | failing on archs that haven't implemented them yet llvm-svn: 47430
* Convert Legalize to use the APInt form of ComputeMaskedBits.Dan Gohman2008-02-201-4/+6
| | | | llvm-svn: 47383
* I cannot find a libgcc function for this builtin. Therefor expanding it to ↵Andrew Lenharth2008-02-161-5/+15
| | | | | | a noop (which is how it use to be treated). If someone who knows the x86 backend better than me could tell me how to get a lock prefix on an instruction, that would be nice to complete x86 support. llvm-svn: 47213
* llvm.memory.barrier, and impl for x86 and alphaAndrew Lenharth2008-02-161-0/+10
| | | | llvm-svn: 47204
* Make tblgen a little smarter about constants smaller than i32. Currently,Scott Michel2008-02-151-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | tblgen will complain if a sign-extended constant does not fit into a data type smaller than i32, e.g., i16. This causes a problem when certain hex constants are used, such as 0xff for byte masks or immediate xor values. tblgen will try the sign-extended value first and, if the sign extended value would overflow, it tries to see if the unsigned value will fit. Consequently, a software developer can now safely incant: (XORHIr16 R16C:$rA, 0xffff) which is somewhat clearer and more informative than incanting: (XORHIr16 R16C:$rA, (i16 -1)) even if the two are bitwise equivalent. Tblgen also outputs the 64-bit unsigned constant in the generated ISel code when getTargetConstant() is invoked. llvm-svn: 47188
* Use StoreSDNode::getValue instead of calling getOperand directlyDan Gohman2008-02-151-4/+4
| | | | | | with a hard-coded operand number. llvm-svn: 47163
* In TargetLowering::LowerCallTo, don't assert thatDuncan Sands2008-02-141-4/+7
| | | | | | | | | | | | | | | | | the return value is zero-extended if it isn't sign-extended. It may also be any-extended. Also, if a floating point value was returned in a larger floating point type, pass 1 as the second operand to FP_ROUND, which tells it that all the precision is in the original type. I think this is right but I could be wrong. Finally, when doing libcalls, set isZExt on a parameter if it is "unsigned". Currently isSExt is set when signed, and nothing is set otherwise. This should be right for all calls to standard library routines. llvm-svn: 47122
* Change how FP immediates are handled. Nate Begeman2008-02-141-17/+16
| | | | | | | | | | | | | | 1) ConstantFP is now expand by default 2) ConstantFP is not turned into TargetConstantFP during Legalize if it is legal. This allows ConstantFP to be handled like Constant, allowing for targets that can encode FP immediates as MachineOperands. As a bonus, fix up Itanium FP constants, which now correctly match, and match more constants! Hooray. llvm-svn: 47121
* Support legalizing insert_vector_elt on targets where the elementNate Begeman2008-02-131-27/+40
| | | | | | type is not legal. llvm-svn: 47048
* From Chris' review: use cast instead of dyn_cast with an assert.Dan Gohman2008-02-111-8/+4
| | | | llvm-svn: 46962
* Add a isBigEndian method to complement isLittleEndian.Duncan Sands2008-02-111-5/+5
| | | | llvm-svn: 46954
* Follow Chris' suggestion; change the PseudoSourceValue accessorsDan Gohman2008-02-071-18/+18
| | | | | | | to return pointers instead of references, since this is always what is needed. llvm-svn: 46857
* Re-apply the memory operand changes, with a fix for the staticDan Gohman2008-02-061-36/+72
| | | | | | | | initializer problem, a minor tweak to the way the DAGISelEmitter finds load/store nodes, and a renaming of the new PseudoSourceValue objects. llvm-svn: 46827
* SDIsel processes llvm.dbg.declare by recording the variable debug ↵Evan Cheng2008-02-021-0/+13
| | | | | | | | | information descriptor and its corresponding stack frame index in MachineModuleInfo. This only works if the local variable is "homed" in the stack frame. It does not work for byval parameter, etc. Added ISD::DECLARE node type to represent llvm.dbg.declare intrinsic. Now the intrinsic calls are lowered into a SDNode and lives on through out the codegen passes. For now, since all the debugging information recording is done at isel time, when a ISD::DECLARE node is selected, it has the side effect of also recording the variable. This is a short term solution that should be fixed in time. llvm-svn: 46659
* Rename RecordLabel to RecordSourceLine because that's what it is doing.Evan Cheng2008-02-011-1/+1
| | | | llvm-svn: 46628
* Revert 46556 and 46585. Dan please fix the PseudoSourceValue problem and ↵Evan Cheng2008-01-311-60/+34
| | | | | | re-commit. llvm-svn: 46623
* Add an extra operand to LABEL nodes which distinguishes between debug, EH, ↵Evan Cheng2008-01-311-3/+5
| | | | | | or misc labels. This fixes the EH breakage. However I am not convinced this is *the* solution. llvm-svn: 46609
* Rename ISD::FLT_ROUNDS to ISD::FLT_ROUNDS_ to avoid conflictingDan Gohman2008-01-311-1/+1
| | | | | | with the real FLT_ROUNDS (defined in <float.h>). llvm-svn: 46587
* Create a new class, MemOperand, for describing memory referencesDan Gohman2008-01-311-34/+60
| | | | | | | | | | | | | | | | in the backend. Introduce a new SDNode type, MemOperandSDNode, for holding a MemOperand in the SelectionDAG IR, and add a MemOperand list to MachineInstr, and code to manage them. Remove the offset field from SrcValueSDNode; uses of SrcValueSDNode that were using it are all all using MemOperandSDNode now. Also, begin updating some getLoad and getStore calls to use the PseudoSourceValue objects. Most of this was written by Florian Brander, some reorganization and updating to TOT by me. llvm-svn: 46585
* Factor the addressing mode and the load/store VT out of LoadSDNodeDan Gohman2008-01-301-14/+14
| | | | | | | | and StoreSDNode into their common base class LSBaseSDNode. Member functions getLoadedVT and getStoredVT are replaced with the common getMemoryVT to simplify code that will handle both loads and stores. llvm-svn: 46538
* Properly expand extract-element for non-power-of-2 codegenNate Begeman2008-01-291-2/+3
| | | | llvm-svn: 46486
* The last pieces needed for loading arbitraryDuncan Sands2008-01-231-64/+176
| | | | | | | | | | | | | | | 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
* The final piece needed for storing arbitrary precisionDuncan Sands2008-01-221-29/+90
| | | | | | | | integers. Handle truncstore of a legal type to an unusual number of bits. Most of this code is not reachable unless the new legalize infrastructure is turned on. llvm-svn: 46249
* Do not generate a FP_ROUND of f64 to f64.Dale Johannesen2008-01-201-3/+4
| | | | llvm-svn: 46195
* This commit changes:Chris Lattner2008-01-171-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-171-65/+63
| | | | | | | | | | | | | 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
* merge a few pieces of code that do the store/load to stack Chris Lattner2008-01-161-30/+12
| | | | | | pattern to use EmitStackConvert now. llvm-svn: 46066
* rename ExpandBIT_CONVERT to EmitStackConvert, generalizing Chris Lattner2008-01-161-15/+37
| | | | | | it to allow it to emit different load and store kinds. llvm-svn: 46065
* simplify a bunch of code by using SelectionDAG::CreateStackTemporary Chris Lattner2008-01-161-28/+6
| | | | | | instead of inlining its body. llvm-svn: 46062
OpenPOWER on IntegriCloud