summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
Commit message (Collapse)AuthorAgeFilesLines
* Propagate debug loc info in SimplifyBinOpWithSameOpcodeHands.Bill Wendling2009-01-301-8/+9
| | | | llvm-svn: 63411
* Propagate debug loc info in SimplifyNodeWithTwoResults.Bill Wendling2009-01-301-7/+8
| | | | llvm-svn: 63376
* Propagate debug loc info for MULHS.Bill Wendling2009-01-301-2/+2
| | | | llvm-svn: 63375
* Propagate debug loc info for SREM and UREM.Bill Wendling2009-01-301-10/+12
| | | | llvm-svn: 63374
* Propagate debug loc info for UDIV.Bill Wendling2009-01-301-6/+7
| | | | llvm-svn: 63373
* Propagate debug loc info for SDIV.Bill Wendling2009-01-301-12/+21
| | | | llvm-svn: 63372
* Forgot to propagate debug loc info here.Bill Wendling2009-01-301-2/+4
| | | | llvm-svn: 63371
* Propagate debug loc info for MUL.Bill Wendling2009-01-301-16/+21
| | | | llvm-svn: 63369
* Propagate debug loc info in SUB.Bill Wendling2009-01-301-7/+8
| | | | llvm-svn: 63368
* Propagate debug loc info in ADDC and ADDE.Bill Wendling2009-01-301-11/+13
| | | | llvm-svn: 63367
* Propagate debug loc info in DAG combine's "ADD".Bill Wendling2009-01-301-20/+18
| | | | llvm-svn: 63366
* - Propagate debug loc info in combineSelectAndUse().Bill Wendling2009-01-301-16/+23
| | | | | | | - Modify ReassociateOps so that the resulting SDValue is what the comment claims it is. llvm-svn: 63365
* Propagate debug info when building SelectionDAG.Dale Johannesen2009-01-301-399/+519
| | | | llvm-svn: 63359
* Propagate debug location info for the token factor.Bill Wendling2009-01-301-5/+5
| | | | llvm-svn: 63355
* Add DebugLoc propagation to some of the methods in DAG combiner.Bill Wendling2009-01-301-27/+34
| | | | llvm-svn: 63350
* Explicitly add PseudoSourceValue information when loweringDan Gohman2009-01-291-10/+11
| | | | | | BUILD_VECTOR and conversions to stack operations. llvm-svn: 63333
* Make a few things const, fix some comments, and simplifyDan Gohman2009-01-291-16/+8
| | | | | | some assertions. llvm-svn: 63328
* Fix two typos that Duncan spotted in a comment.Dan Gohman2009-01-291-1/+1
| | | | llvm-svn: 63312
* In the case of an extractelement on an insertelement value,Dan Gohman2009-01-291-1/+5
| | | | | | | the element indices may be equal if either one is not a constant. llvm-svn: 63311
* Revert r63273. This was already implemented by Dale. There's no need for myBill Wendling2009-01-291-72/+101
| | | | | | change. llvm-svn: 63301
* - Add DebugLoc to getTargetNode(). Bill Wendling2009-01-291-101/+72
| | | | | | | | | - Modify TableGen to add the DebugLoc when calling getTargetNode. (The light-weight wrappers are only temporary. The non-DebugLoc version will be removed once the whole debug info stuff is finished with.) llvm-svn: 63273
* Make x86's BT instruction matching more thorough, and add someDan Gohman2009-01-292-20/+73
| | | | | | | | | dagcombines that help it match in several more cases. Add several more cases to test/CodeGen/X86/bt.ll. This doesn't yet include matching for BT with an immediate operand, it just covers more register+register cases. llvm-svn: 63266
* Add DebugLoc-sensitive versions of many node creationDale Johannesen2009-01-291-0/+458
| | | | | | functions. Currently omitted: memcpy, memmove, memset. llvm-svn: 63259
* Add DebugLoc to the getNode() methods.Bill Wendling2009-01-281-41/+134
| | | | llvm-svn: 63245
* Add DebugLoc-aware constructors for SDNode derivedDale Johannesen2009-01-281-0/+23
| | | | | | | classes (those that reasonably have a DebugLoc associated with them). llvm-svn: 63236
* Fixed extract element when the result needs to be promoted and the input ↵Mon P Wang2009-01-281-0/+2
| | | | | | widened. llvm-svn: 63217
* Make isOperationLegal do what its name suggests, and introduce aDan Gohman2009-01-285-55/+62
| | | | | | | | | | | | | | | new isOperationLegalOrCustom, which does what isOperationLegal previously did. Update a bunch of callers to use isOperationLegalOrCustom instead of isOperationLegal. In some case it wasn't obvious which behavior is desired; when in doubt I changed then to isOperationLegalOrCustom as that preserves their previous behavior. This is for the second half of PR3376. llvm-svn: 63212
* Formatting.Duncan Sands2009-01-281-8/+5
| | | | llvm-svn: 63199
* Rename getAnalysisToUpdate to getAnalysisIfAvailable.Duncan Sands2009-01-281-2/+2
| | | | llvm-svn: 63198
* Use ValueType::bitsLT to simplify some code.Dan Gohman2009-01-282-2/+2
| | | | llvm-svn: 63170
* Use ZERO_EXTEND instead of ANY_EXTEND when promotingDan Gohman2009-01-282-2/+2
| | | | | | | shift amounts, to avoid implicitly assuming that target architectures will ignore the high bits. llvm-svn: 63169
* Add an assertion to the form of SelectionDAG::getConstant that takesDan Gohman2009-01-273-7/+13
| | | | | | | | a uint64_t to verify that the value is in range for the given type, to help catch accidental overflow. Fix a few places that relied on getConstant implicitly truncating the value. llvm-svn: 63128
* Delete redundant return statements.Dan Gohman2009-01-271-7/+0
| | | | llvm-svn: 63120
* Fix PR3393, which amounts to a bug in the expensiveDuncan Sands2009-01-262-16/+37
| | | | | | | | | checking logic. Rather than make the checking more complicated, I've tweaked some logic to make things conform to how the checking thought things ought to be, since this results in a simpler "mental model". llvm-svn: 63048
* During bittest switch lowering emit shift in the test block, which should ↵Anton Korobeynikov2009-01-261-11/+9
| | | | | | | | (theoretically) allow us to generate more efficient code. We don't do this now though :) llvm-svn: 63027
* Take the next steps in making SDUse more consistent with LLVM Use, andDan Gohman2009-01-263-82/+65
| | | | | | | | | | | | | | | | | tidy up SDUse and related code. - Replace the operator= member functions with a set method, like LLVM Use has, and variants setInitial and setNode, which take care up updating use lists, like LLVM Use's does. This simplifies code that calls these functions. - getSDValue() is renamed to get(), as in LLVM Use, though most places can either use the implicit conversion to SDValue or the convenience functions instead. - Fix some more node vs. value terminology issues. Also, eliminate the one remaining use of SDOperandPtr, and SDOperandPtr itself. llvm-svn: 62995
* Eliminate the loop that searches through each of the operandsDan Gohman2009-01-251-195/+178
| | | | | | | | | | | of each use in the SelectionDAG ReplaceAllUses* functions. Thanks to Chris for spotting this opportunity. Also, factor out code from all 5 of the ReplaceAllUses* functions into AddNonLeafNodeToCSEMaps, which is now renamed AddModifiedNodeToCSEMaps to more accurately reflect its purpose. llvm-svn: 62964
* Whitespace tidiments.Dan Gohman2009-01-251-2/+1
| | | | llvm-svn: 62963
* Move the N->use_empty() assert from DeleteNode toDan Gohman2009-01-251-3/+2
| | | | | | | DeleteNodeNotInCSEMaps, since DeleteNode just calls DeleteNodeNotInCSEMaps. llvm-svn: 62962
* Fix an indent and a typo.Nate Begeman2009-01-241-1/+1
| | | | llvm-svn: 62940
* Fold x-0 to x in unsafe-fp-math mode. This comes up in theDan Gohman2009-01-232-9/+19
| | | | | | | | | | | | | | testcase from PR3376, and in fact is sufficient to completely avoid the problem in that testcase. There's an underlying problem though; TLI.isOperationLegal considers Custom to be Legal, which might be ok in some cases, but that's what DAGCombiner is using in many places to test if something is legal when LegalOperations is true. When DAGCombiner is running after legalize, this isn't sufficient. I'll address this in a separate commit. llvm-svn: 62860
* Fix a minor bug in DAGCombiner's folding of SELECT. Folding "select C, 0, 1"Bob Wilson2009-01-221-3/+5
| | | | | | | | | | | | | | | | | | | | | | to "C ^ 1" is only valid when C is known to be either 0 or 1. Most of the similar foldings in this function only handle "i1" types, but this one appears intentionally written to handle larger integer types. If C has an integer type larger than "i1", this needs to check if the high bits of a boolean are known to be zero. I also changed the comment to describe this folding as "C ^ 1" instead of "~C", since that is what the code does and since the latter would only be valid for "i1" types. The good news is that most LLVM targets use TargetLowering::ZeroOrOneBooleanContent so this change will not disable the optimization; the bad news is that I've been unable to come up with a testcase to demonstrate the problem. I have also removed a "FIXME" comment for folding "select C, X, 0" to "C & X", since the code looks correct to me. It could be made more aggressive by not limiting the type to "i1", but that would then require checking for TargetLowering::ZeroOrNegativeOneBooleanContent. Similar changes could be done for the other SELECT foldings, but it was decided to be not worth the trouble and complexity (see e.g., r44663). llvm-svn: 62790
* Don't create ISD::FNEG nodes after legalize if they aren't legal.Dan Gohman2009-01-222-8/+30
| | | | | | | | | | | | | | Simplify x+0 to x in unsafe-fp-math mode. This avoids a bunch of redundant work in many cases, because in unsafe-fp-math mode, ISD::FADD with a constant is considered free to negate, so the DAGCombiner often negates x+0 to -0-x thinking it's free, when in reality the end result is -x, which is more expensive than x. Also, combine x*0 to 0. This fixes PR3374. llvm-svn: 62789
* Add SelectionDAG::getNOT method to construct bitwise NOT operations,Bob Wilson2009-01-224-26/+38
| | | | | | | corresponding to the "not" and "vnot" PatFrags. Use the new method in some places where it seems appropriate. llvm-svn: 62768
* Eliminate a couple of fields from TargetRegisterClass: SubRegClasses and ↵Evan Cheng2009-01-222-36/+5
| | | | | | SuperRegClasses. These are not necessary. Also eliminate getSubRegisterRegClass and getSuperRegisterRegClass. These are slow and their results can change if register file names change. Just use TargetLowering::getRegClassFor() to get the right TargetRegisterClass instead. llvm-svn: 62762
* fix a typoChris Lattner2009-01-221-1/+1
| | | | llvm-svn: 62761
* Simplify ReduceLoadWidth's logic: it doesn't need several differentDan Gohman2009-01-211-19/+10
| | | | | | | | special cases after producing the new reduced-width load, because the new load already has the needed adjustments built into it. This fixes several bugs due to the special cases, including PR3317. llvm-svn: 62692
* Cleanup whitespace and comments, and tweak someDuncan Sands2009-01-215-58/+53
| | | | | | | prototypes, in operand type legalization. No functionality change. llvm-svn: 62680
* CellSPU:Scott Michel2009-01-211-0/+4
| | | | | | | | | | | | | - Ensure that (operation) legalization emits proper FDIV libcall when needed. - Fix various bugs encountered during llvm-spu-gcc build, along with various cleanups. - Start supporting double precision comparisons for remaining libgcc2 build. Discovered interesting DAGCombiner feature, which is currently solved via custom lowering (64-bit constants are not legal on CellSPU, but DAGCombiner insists on inserting one anyway.) - Update README. llvm-svn: 62664
* Allow targets to legalize operations (with illegal operands) that produces ↵Sanjiv Gupta2009-01-215-68/+85
| | | | | | multiple values. For example, a load with an illegal operand (a load produces two values, a value and chain). llvm-svn: 62663
OpenPOWER on IntegriCloud