summaryrefslogtreecommitdiffstats
path: root/test/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* - More pre-split fixes: spill slot live interval computation bug; restore ↵Evan Cheng2008-10-292-1/+52
| | | | | | | | | point bug. - If a def is spilt, remember its spill index to allow its reuse. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58375 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix darwin ppc llvm-gcc build breakage: interceptDuncan Sands2008-10-281-0/+33
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58329 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn off LegalizeTypes for this test for theDuncan Sands2008-10-281-1/+1
| | | | | | | moment, while waiting for a proper solution. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58324 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a testcase provided by Bill in which the nodeDuncan Sands2008-10-281-0/+11
| | | | | | | | | id could end up being wrong mostly because of forgetting to remap new nodes that morphed into processed nodes through CSE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58323 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a nasty miscompilation of 176.gcc on linux/x86 where we synthesizedChris Lattner2008-10-281-0/+22
| | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58317 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid putting a split past the end of the live range; always shrink wrap ↵Evan Cheng2008-10-282-0/+73
| | | | | | live interval in the barrier mbb. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58309 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove val# defined by a remat'ed def that is now dead.Evan Cheng2008-10-271-0/+44
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58294 91177308-0d34-0410-b5e6-96231b3b80d8
* rename vec_spat -> vec_splat, pointed out by duncanChris Lattner2008-10-271-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58260 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn on LegalizeTypes, the new type legalizationDuncan Sands2008-10-2725-33/+25
| | | | | | | | codegen infrastructure, by default. Please report any breakage to the mailing lists. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58232 91177308-0d34-0410-b5e6-96231b3b80d8
* For now, don't split live intervals around x87 stack register barriers. ↵Evan Cheng2008-10-271-0/+34
| | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58230 91177308-0d34-0410-b5e6-96231b3b80d8
* remove eh output from this test.Chris Lattner2008-10-261-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58196 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not shrink wrap live interval in a mbb if it's livein any of its ↵Evan Cheng2008-10-261-0/+36
| | | | | | successor blocks. The mbb can be revisited again after all of the successors are processed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58184 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle cases where there aren't uses in the barrier mbb.Evan Cheng2008-10-251-0/+56
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58174 91177308-0d34-0410-b5e6-96231b3b80d8
* Related to PR2911, reject as invalid non-pointer GC roots.Gordon Henriksen2008-10-251-0/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58143 91177308-0d34-0410-b5e6-96231b3b80d8
* If val# def is ~0U, meaning it's defined by a PHI, and it's previously ↵Evan Cheng2008-10-251-0/+24
| | | | | | split, spill before the barrier because it's impossible to determine if all the defs are spilled in the same spill slot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58129 91177308-0d34-0410-b5e6-96231b3b80d8
* Be kind to non-x86 hosts.Dale Johannesen2008-10-242-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58113 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix translateX86CC: if SetCCOpcode is SETULE andDuncan Sands2008-10-241-0/+17
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58092 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid splitting an interval multiple times; avoid splitting ↵Evan Cheng2008-10-243-0/+75
| | | | | | re-materializable val# (for now). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58068 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2907 by digging through constant expressions to find FP constants thatChris Lattner2008-10-221-0/+29
| | | | | | | are their operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57956 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix SelectionDAGBuild lowering of Select instructions toDan Gohman2008-10-211-0/+24
| | | | | | | | 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
* really fix run lineChris Lattner2008-10-211-8/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57889 91177308-0d34-0410-b5e6-96231b3b80d8
* fix run lineChris Lattner2008-10-211-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57888 91177308-0d34-0410-b5e6-96231b3b80d8
* remove some unneeded eh generationChris Lattner2008-10-211-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57887 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't create TargetGlobalAddress nodes with offsets that don't fitDan Gohman2008-10-211-0/+14
| | | | | | | | | | | | | | | 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-211-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-211-0/+5
| | | | | | | | | | | | | | | | | | | | | 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
* Fix gcc.c-torture/compile/920520-1.c by inserting bitconvertsChris Lattner2008-10-211-0/+11
| | | | | | | | | | 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
* Reapply r57699 with a fix to not crash on asms with multiple results. UnlikeChris Lattner2008-10-181-0/+10
| | | | | | | | | | | | the previous patch this one actually passes make check. "Fix PR2356 on PowerPC: if we have an input and output that are tied together that have different sizes (e.g. i32 and i64) make sure to reserve registers for the bigger operand." git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57771 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach DAGCombine to fold constant offsets into GlobalAddress nodes,Dan Gohman2008-10-181-0/+18
| | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57748 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r57699. It's causing regressions inDan Gohman2008-10-181-11/+0
| | | | | | | | test/CodeGen/X86/2008-09-17-inline-asm-1.ll and a few others, and it breaks the llvm-gcc build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57747 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2898. Spiller delete a store for reuse before it knows for sure the ↵Evan Cheng2008-10-171-0/+129
| | | | | | | | | reuse happened. Patch by Lang Hames! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57720 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug where the x86 backend would reject 64-bit r constraints whenChris Lattner2008-10-171-0/+9
| | | | | | | | in 32-bit mode instead of assigning a register pair. This has nothing to do with PR2356, but I happened to notice it while working on it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57704 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2356 on PowerPC: if we have an input and output that are tied togetherChris Lattner2008-10-171-0/+11
| | | | | | | | that have different sizes (e.g. i32 and i64) make sure to reserve registers for the bigger operand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57699 91177308-0d34-0410-b5e6-96231b3b80d8
* remove an xfailed test.Chris Lattner2008-10-171-26/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57695 91177308-0d34-0410-b5e6-96231b3b80d8
* remove this test: it is xfailed anyway, and is failing for a reasonChris Lattner2008-10-171-18/+0
| | | | | | | other than why it was xfailed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57694 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a very subtle spiller bug: UpdateKills should not forget to track defs ↵Evan Cheng2008-10-171-0/+155
| | | | | | of aliases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57673 91177308-0d34-0410-b5e6-96231b3b80d8
* Fun x86 encoding tricks: when adding an immediate value of 128,Dan Gohman2008-10-172-0/+26
| | | | | | | | | | | | | | use a SUB instruction instead of an ADD, because -128 can be encoded in an 8-bit signed immediate field, while +128 can't be. This avoids the need for a 32-bit immediate field in this case. A similar optimization applies to 64-bit adds with 0x80000000, with the 32-bit signed immediate field. To support this, teach tablegen how to handle 64-bit constants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57663 91177308-0d34-0410-b5e6-96231b3b80d8
* Define patterns for shld and shrd that match immediateDan Gohman2008-10-173-0/+219
| | | | | | | | | | | | | | | | | | | shift counts, and patterns that match dynamic shift counts when the subtract is obscured by a truncate node. Add DAGCombiner support for recognizing rotate patterns when the shift counts are defined by truncate nodes. Fix and simplify the code for commuting shld and shrd instructions to work even when the given instruction doesn't have a parent, and when the caller needs a new instruction. These changes allow LLVM to use the shld, shrd, rol, and ror instructions on x86 to replace equivalent code using two shifts and an or in many more cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57662 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix this test so it actually runs the grep lines.Dan Gohman2008-10-161-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57653 91177308-0d34-0410-b5e6-96231b3b80d8
* Testcase for PR2762.Duncan Sands2008-10-161-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57633 91177308-0d34-0410-b5e6-96231b3b80d8
* Testcase for PR1638.Bill Wendling2008-10-151-0/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57590 91177308-0d34-0410-b5e6-96231b3b80d8
* - Add target lowering hooks that specify which setcc conditions are illegal,Evan Cheng2008-10-151-0/+11
| | | | | | | | | | | | i.e. conditions that cannot be checked with a single instruction. For example, SETONE and SETUEQ on x86. - Teach legalizer to implement *illegal* setcc as a and / or of a number of legal setcc nodes. For now, only implement FP conditions. e.g. SETONE is implemented as SETO & SETNE, SETUEQ is SETUO | SETEQ. - Move x86 target over. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57542 91177308-0d34-0410-b5e6-96231b3b80d8
* When doing the very-late shift-and address-mode optimization,Dan Gohman2008-10-131-0/+38
| | | | | | | | | | | | | | | create a new DAG node to represent the new shift to keep the DAG consistent, even though it'll almost always be folded into the address. If a user of the resulting address has multiple uses, the nodes may get revisited by a later MatchAddress call, in which case DAG inconsistencies do matter. This fixes PR2849. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57465 91177308-0d34-0410-b5e6-96231b3b80d8
* FIX PR2794. Make sure SIGN_EXTEND_INREG nodes introduced by ↵Evan Cheng2008-10-131-0/+29
| | | | | | LegalizeSetCCOperands are leglized. Patch by Richard Pennington. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57460 91177308-0d34-0410-b5e6-96231b3b80d8
* Also update sub-register intervals after a trivial computation is rematt'ed ↵Evan Cheng2008-10-131-0/+42
| | | | | | for a copy instruction. PR2775. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57458 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a test case for _Complex passed as a FCA.Evan Cheng2008-10-131-0/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57456 91177308-0d34-0410-b5e6-96231b3b80d8
* Change CALLSEQ_BEGIN and CALLSEQ_END to take TargetConstant's asChris Lattner2008-10-111-0/+21
| | | | | | | | | parameters instead of raw Constants. This prevents the constants from being selected by the isel pass, fixing PR2735. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57385 91177308-0d34-0410-b5e6-96231b3b80d8
* Add testcase for 'r' inline asm operandAnton Korobeynikov2008-10-101-0/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57361 91177308-0d34-0410-b5e6-96231b3b80d8
* This does not fail anymoreAnton Korobeynikov2008-10-101-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57360 91177308-0d34-0410-b5e6-96231b3b80d8
* Add sparc test for memory operand used in inline asmAnton Korobeynikov2008-10-101-0/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57348 91177308-0d34-0410-b5e6-96231b3b80d8