summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fold the ShrinkDemandedOps pass into the regular DAGCombiner pass,Dan Gohman2010-06-181-4/+4
| | | | | | which is faster, simpler, and less surprising. llvm-svn: 106263
* Fix SimplifyDemandedBits' AssertZext logic to demand all the bits. ItDan Gohman2010-06-031-4/+8
| | | | | | needs to demand the high bits because it's asserting that they're zero. llvm-svn: 105406
* Code refactoring: pull SchedPreference enum from TargetLowering.h to ↵Evan Cheng2010-05-191-1/+1
| | | | | | TargetMachine.h and put it in its own namespace. llvm-svn: 104147
* Trim #includes and forward declarations.Dan Gohman2010-05-111-1/+0
| | | | llvm-svn: 103489
* Fixes for Microsoft Visual Studio 2010, from Steven Watanabe!Douglas Gregor2010-05-111-2/+2
| | | | llvm-svn: 103457
* Insert ANY_EXTEND node instead of invalid truncate during DAG Combining (X & 1),Anton Korobeynikov2010-05-011-1/+6
| | | | | | when needed. This fixes PR7001 llvm-svn: 102838
* Add more const qualifiers on TargetMachine and friends.Dan Gohman2010-04-211-1/+2
| | | | llvm-svn: 101977
* Because of the EMMS problem, right now we have to supportDale Johannesen2010-04-201-1/+1
| | | | | | | | | | | user-defined operations that use MMX register types, but the compiler shouldn't generate them on its own. This adds a Synthesizable abstraction to represent this, and changes the vector widening computation so it won't produce MMX types. (The motivation is to remove noise from the ABI compatibility part of the gcc test suite, which has some breakage right now.) llvm-svn: 101951
* More work to allow dag combiner to promote 16-bit ops to 32-bit.Evan Cheng2010-04-171-19/+26
| | | | llvm-svn: 101621
* Add const qualifiers to CodeGen's use of LLVM IR constructs.Dan Gohman2010-04-151-1/+1
| | | | llvm-svn: 101334
* Add few missed libcalls and correct names for others.Anton Korobeynikov2010-03-261-4/+16
| | | | llvm-svn: 99656
* Remove the ConvertActions table and associated code, which is unused.Dan Gohman2010-03-241-1/+0
| | | | llvm-svn: 99372
* Turn calls to copysignl into an FCOPYSIGN node. Handle FCOPYSIGN nodesDuncan Sands2010-03-141-0/+4
| | | | | | | with ppc_f128 type by having the type legalizer turn these back into a call to copysignl. llvm-svn: 98514
* Make default expansion for FP16 <-> FP32 nodes into libcallsAnton Korobeynikov2010-03-141-0/+4
| | | | llvm-svn: 98501
* Remove getWidenVectorType, which is no longer used.Dan Gohman2010-03-111-14/+0
| | | | llvm-svn: 98289
* Fix several places to handle vector operands properly.Dan Gohman2010-03-021-1/+1
| | | | | | Based on a patch by Micah Villmow for PR6438. llvm-svn: 97538
* Fix optimization of ISD::TRUNCATE on vector operands. Based on a patchDan Gohman2010-03-011-4/+5
| | | | | | by Micah Villmow for PR6335. llvm-svn: 97461
* Re-apply 97040 with fix. This survives a ppc self-host llvm-gcc bootstrap.Evan Cheng2010-02-271-7/+33
| | | | llvm-svn: 97310
* Speculatively revert r97011, "Re-apply 96540 and 96556 with fixes.", again inDaniel Dunbar2010-02-241-33/+7
| | | | | | the hopes of fixing PPC bootstrap. llvm-svn: 97040
* Re-apply 96540 and 96556 with fixes.Evan Cheng2010-02-241-7/+33
| | | | llvm-svn: 97011
* Revert commits 96556 and 96640, because commit 96556 breaks theDuncan Sands2010-02-191-30/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dragonegg self-host build. I reverted 96640 in order to revert 96556 (96640 goes on top of 96556), but it also looks like with both of them applied the breakage happens even earlier. The symptom of the 96556 miscompile is the following crash: llvm[3]: Compiling AlphaISelLowering.cpp for Release build cc1plus: /home/duncan/tmp/tmp/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:4982: void llvm::SelectionDAG::ReplaceAllUsesWith(llvm::SDNode*, llvm::SDNode*, llvm::SelectionDAG::DAGUpdateListener*): Assertion `(!From->hasAnyUseOfValue(i) || From->getValueType(i) == To->getValueType(i)) && "Cannot use this version of ReplaceAllUsesWith!"' failed. Stack dump: 0. Running pass 'X86 DAG->DAG Instruction Selection' on function '@_ZN4llvm19AlphaTargetLowering14LowerOperationENS_7SDValueERNS_12SelectionDAGE' g++: Internal error: Aborted (program cc1plus) This occurs when building LLVM using LLVM built by LLVM (via dragonegg). Probably LLVM has miscompiled itself, though it may have miscompiled GCC and/or dragonegg itself: at this point of the self-host build, all of GCC, LLVM and dragonegg were built using LLVM. Unfortunately this kind of thing is extremely hard to debug, and while I did rummage around a bit I didn't find any smoking guns, aka obviously miscompiled code. Found by bisection. r96556 | evancheng | 2010-02-18 03:13:50 +0100 (Thu, 18 Feb 2010) | 5 lines Some dag combiner goodness: Transform br (xor (x, y)) -> br (x != y) Transform br (xor (xor (x,y), 1)) -> br (x == y) Also normalize (and (X, 1) == / != 1 -> (and (X, 1)) != / == 0 to match to "test on x86" and "tst on arm" r96640 | evancheng | 2010-02-19 01:34:39 +0100 (Fri, 19 Feb 2010) | 16 lines Transform (xor (setcc), (setcc)) == / != 1 to (xor (setcc), (setcc)) != / == 1. e.g. On x86_64 %0 = icmp eq i32 %x, 0 %1 = icmp eq i32 %y, 0 %2 = xor i1 %1, %0 br i1 %2, label %bb, label %return => testl %edi, %edi sete %al testl %esi, %esi sete %cl cmpb %al, %cl je LBB1_2 llvm-svn: 96672
* Transform (xor (setcc), (setcc)) == / != 1 toEvan Cheng2010-02-191-3/+13
| | | | | | | | | | | | | | | | | | | (xor (setcc), (setcc)) != / == 1. e.g. On x86_64 %0 = icmp eq i32 %x, 0 %1 = icmp eq i32 %y, 0 %2 = xor i1 %1, %0 br i1 %2, label %bb, label %return => testl %edi, %edi sete %al testl %esi, %esi sete %cl cmpb %al, %cl je LBB1_2 llvm-svn: 96640
* Some dag combiner goodness:Evan Cheng2010-02-181-4/+20
| | | | | | | | Transform br (xor (x, y)) -> br (x != y) Transform br (xor (xor (x,y), 1)) -> br (x == y) Also normalize (and (X, 1) == / != 1 -> (and (X, 1)) != / == 0 to match to "test on x86" and "tst on arm" llvm-svn: 96556
* Add non-temporal flags and remove an assumption of default arguments.David Greene2010-02-151-1/+1
| | | | llvm-svn: 96240
* The previous fix of widening divides that trap was too fragile as it depends ↵Mon P Wang2010-02-101-0/+18
| | | | | | | | | | | on custom lowering and requires that certain types exist in ValueTypes.h. Modified widening to check if an op can trap and if so, the widening algorithm will apply only the op on the defined elements. It is safer to do this in widening because the optimizer can't guarantee removing unused ops in some cases. llvm-svn: 95823
* Fix "the the" and similar typos.Dan Gohman2010-02-101-1/+1
| | | | llvm-svn: 95781
* eliminate the TargetLowering::UsesGlobalOffsetTable bool, which isChris Lattner2010-01-261-3/+2
| | | | | | | subsumed by TargetLowering::getJumpTableEncoding(). Change uses of it to be more specific. llvm-svn: 94529
* Move getJTISymbol from MachineJumpTableInfo to MachineFunction,Chris Lattner2010-01-261-4/+4
| | | | | | | | | | | | | | | | | | which is more convenient, and change getPICJumpTableRelocBaseExpr to take a MachineFunction to match. Next, move the X86 code that create a PICBase symbol to X86TargetLowering::getPICBaseSymbol from X86MCInstLower::GetPICBaseSymbol, which was an asmprinter specific library. This eliminates a 'gross hack', and allows us to implement X86ISelLowering::getPICJumpTableRelocBaseExpr which now calls it. This in turn allows us to eliminate the X86AsmPrinter::printPICJumpTableSetLabel method, which was the only overload of printPICJumpTableSetLabel. llvm-svn: 94526
* add a new MachineJumpTableInfo::getJTISymbol method,Chris Lattner2010-01-261-2/+4
| | | | | | use it to implement the default TargetLowering::getPICJumpTableRelocBaseExpr llvm-svn: 94523
* stub out a new target hook, need some refactoring before I canChris Lattner2010-01-261-0/+11
| | | | | | implement it. llvm-svn: 94521
* Rearrange handling of jump tables. Highlights:Chris Lattner2010-01-251-0/+17
| | | | | | | | | | | | | | | | | | 1. MachineJumpTableInfo is now created lazily for a function the first time it actually makes a jump table instead of for every function. 2. The encoding of jump table entries is now described by the MachineJumpTableInfo::JTEntryKind enum. This enum is determined by the TLI::getJumpTableEncoding() hook, instead of by lots of code scattered throughout the compiler that "knows" that jump table entries are always 32-bits in pic mode (for example). 3. The size and alignment of jump table entries is now calculated based on their kind, instead of at machinefunction creation time. Future work includes using the EntryKind in more places in the compiler, eliminating other logic that "knows" the layout of jump tables in various situations. llvm-svn: 94470
* It seems better to scalarize vectors of size 1 instead of widening them.Mon P Wang2010-01-241-1/+1
| | | | | | Add support to widen SETCC. llvm-svn: 94342
* Revert an earlier change to SIGN_EXTEND_INREG for vectors. The VTSDNodeDan Gohman2010-01-091-10/+14
| | | | | | | | | | really does need to be a vector type, because TargetLowering::getOperationAction for SIGN_EXTEND_INREG uses that type, and it needs to be able to distinguish between vectors and scalars. Also, fix some more issues with legalization of vector casts. llvm-svn: 93043
* APInt'fy TargetLowering::SimplifySetCC to fix PR5963.Evan Cheng2010-01-071-15/+15
| | | | llvm-svn: 92943
* Teach dag combine to fold the following transformation more aggressively:Evan Cheng2010-01-061-9/+13
| | | | | | | | | | (OP (trunc x), (trunc y)) -> (trunc (OP x, y)) Unfortunately this simple change causes dag combine to infinite looping. The problem is the shrink demanded ops optimization tend to canonicalize expressions in the opposite manner. That is badness. This patch disable those optimizations in dag combine but instead it is done as a late pass in sdisel. This also exposes some deficiencies in dag combine and x86 setcc / brcond lowering. Teach them to look pass ISD::TRUNCATE in various places. llvm-svn: 92849
* Allow targets to specify the return type of libcalls that are generated for ↵Sanjiv Gupta2009-12-281-0/+4
| | | | | | floating point comparisons, rather than hard-coding them as i32. llvm-svn: 92199
* Implement vector widening, splitting, and scalarizing for SIGN_EXTEND_INREG.Dan Gohman2009-12-111-2/+2
| | | | llvm-svn: 91158
* Move isConsecutiveLoad to SelectionDAG. It's not target dependent and it's ↵Evan Cheng2009-12-091-42/+0
| | | | | | primary used by selectdag passes. llvm-svn: 90922
* Remove ISD::DEBUG_LOC and ISD::DBG_LABEL, which are no longer used.Dan Gohman2009-11-231-5/+0
| | | | | | | | Note that "hasDotLocAndDotFile"-style debug info was already broken; people wanting this functionality should implement it in the AsmPrinter/DwarfWriter code. llvm-svn: 89711
* Add compare_lower and equals_lower methods to StringRef. Switch all users ofBenjamin Kramer2009-11-121-3/+2
| | | | | | StringsEqualNoCase (from StringExtras.h) to it. llvm-svn: 87020
* Add 8 bit libcalls and make use of them for msp430Anton Korobeynikov2009-11-071-0/+5
| | | | llvm-svn: 86384
* Do away with addLegalFPImmediate. Add a target hook isFPImmLegal which ↵Evan Cheng2009-10-271-1/+1
| | | | | | returns true if the fp immediate can be natively codegened by target. llvm-svn: 85281
* Convert comparisons like (x == infinity) to (x >= infinity) on targetsDan Gohman2009-09-261-0/+37
| | | | | | where FCMP_OEQ is not legal and FCMP_OGE is, such as x86. llvm-svn: 82861
* Rename several variables from EVT to more descriptive names, now that EVTDan Gohman2009-09-231-3/+3
| | | | | | | is also the name of their type, as declarations like "EVT EVT" look really odd. llvm-svn: 82654
* kill off the last use of TRI::AsmName.Chris Lattner2009-09-131-1/+1
| | | | llvm-svn: 81727
* Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.Chris Lattner2009-08-221-2/+2
| | | | llvm-svn: 79763
* Unbreak build. Evan, please make sure my changes are correct.Benjamin Kramer2009-08-151-1/+0
| | | | llvm-svn: 79133
* Allow targets to specify their choice of calling conventions perAnton Korobeynikov2009-08-141-0/+9
| | | | | | | | | | libcall. Take advantage of this in the ARM backend to rectify broken choice of CC when hard float is in effect. PIC16 may want to see if it could be of use in MakePIC16Libcall, which works unchanged. Patch by Sandeep! llvm-svn: 79033
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-3/+2
| | | | llvm-svn: 78948
* Add contexts to some of the MVT APIs. No functionality change yet, just the ↵Owen Anderson2009-08-121-13/+59
| | | | | | infrastructure work needed to get the contexts to where they need to be first. llvm-svn: 78759
OpenPOWER on IntegriCloud