summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* More DebugLoc propagation in LOAD etc. methods.Bill Wendling2009-01-301-26/+42
| | | | llvm-svn: 63451
* More DebugLoc propagation in floating-point methods.Bill Wendling2009-01-301-27/+40
| | | | llvm-svn: 63446
* Standardize comments about folding xforms.Bill Wendling2009-01-301-10/+10
| | | | llvm-svn: 63443
* Get rid of the non-DebugLoc-ified getNOT() method.Bill Wendling2009-01-301-4/+4
| | | | llvm-svn: 63442
* Propagate debug loc info for some FP arithmetic methods.Bill Wendling2009-01-301-13/+13
| | | | llvm-svn: 63441
* Propagate debug loc info for some FP arithmetic methods.Bill Wendling2009-01-301-22/+30
| | | | llvm-svn: 63440
* Propagate debug loc info for BIT_CONVERT.Bill Wendling2009-01-301-29/+46
| | | | llvm-svn: 63439
* Propagate debug loc info for more *_EXTEND methods.Bill Wendling2009-01-301-15/+24
| | | | llvm-svn: 63437
* Propagate debug loc info for ANY_EXTEND.Bill Wendling2009-01-301-12/+16
| | | | llvm-svn: 63436
* Propagate debug loc info for some of the *_EXTEND functions.Bill Wendling2009-01-301-33/+55
| | | | llvm-svn: 63434
* - Propagate debug loc info for SELECT.Bill Wendling2009-01-301-25/+32
| | | | | | | - Added xform for (select X, 1, Y) and (select X, Y, 0), which was commented on, but missing. llvm-svn: 63428
* Propagate debug loc info for Shifts.Bill Wendling2009-01-301-60/+68
| | | | llvm-svn: 63424
* Propagate debug loc info for XOR and MatchRotate.Bill Wendling2009-01-301-32/+38
| | | | llvm-svn: 63420
* Propagate debug loc info for OR. Also clean up some comments.Bill Wendling2009-01-301-21/+24
| | | | llvm-svn: 63419
* Perform obvious constant arithmetic folding.Bill Wendling2009-01-301-6/+8
| | | | llvm-svn: 63417
* Propagate debug loc info for AND. Also clean up some comments.Bill Wendling2009-01-301-21/+31
| | | | llvm-svn: 63416
* 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 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
* Make x86's BT instruction matching more thorough, and add someDan Gohman2009-01-291-19/+31
| | | | | | | | | 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
* Make isOperationLegal do what its name suggests, and introduce aDan Gohman2009-01-281-15/+17
| | | | | | | | | | | | | | | 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
* Add an assertion to the form of SelectionDAG::getConstant that takesDan Gohman2009-01-271-6/+9
| | | | | | | | 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
* Take the next steps in making SDUse more consistent with LLVM Use, andDan Gohman2009-01-261-1/+1
| | | | | | | | | | | | | | | | | 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
* Fold x-0 to x in unsafe-fp-math mode. This comes up in theDan Gohman2009-01-231-0/+3
| | | | | | | | | | | | | | 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-221-6/+17
| | | | | | | | | | | | | | 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-221-8/+7
| | | | | | | corresponding to the "not" and "vnot" PatFrags. Use the new method in some places where it seems appropriate. llvm-svn: 62768
* 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
* Fix a dagcombine to not generate loads of non-round integer types,Dan Gohman2009-01-201-1/+1
| | | | | | | as its comment says, even in the case where it will be generating extending loads. This fixes PR3216. llvm-svn: 62557
* Fix SelectionDAG::ReplaceAllUsesWith to behave correctly whenDan Gohman2009-01-191-10/+20
| | | | | | | | | | | | | uses are added to the From node while it is processing From's use list, because of automatic local CSE. The fix is to avoid visiting any new uses. Fix a few places in the DAGCombiner that assumed that after a RAUW call, the From node has no users and may be deleted. This fixes PR3018. llvm-svn: 62533
* Simplify extract element based on comments from Duncan Sands.Mon P Wang2009-01-181-7/+3
| | | | llvm-svn: 62459
* Simplify extract element of a scalar to vector.Mon P Wang2009-01-171-5/+13
| | | | llvm-svn: 62383
* Use the getNode() accessor instead of accessing the NodeDan Gohman2009-01-161-1/+1
| | | | | | member directly, which is private as of r55504. llvm-svn: 62364
* new nodes should be added to the worklist, not old nodes.Chris Lattner2009-01-161-1/+2
| | | | llvm-svn: 62359
* Move a few containers out of ScheduleDAGInstrs::BuildSchedGraphDan Gohman2009-01-151-2/+2
| | | | | | | | | | | and into the ScheduleDAGInstrs class, so that they don't get destructed and re-constructed for each block. This fixes a compile-time hot spot in the post-pass scheduler. To help facilitate this, tidy and do some minor reorganization in the scheduler constructor functions. llvm-svn: 62275
* Fix a DAGCombiner abort on an invalid shift count constant. This fixes PR3250.Dan Gohman2009-01-031-0/+2
| | | | llvm-svn: 61613
* Fix PR3274: when promoting the condition of a BRCOND node,Duncan Sands2009-01-011-6/+9
| | | | | | | | | | promote from i1 all the way up to the canonical SetCC type. In order to discover an appropriate type to use, pass MVT::Other to getSetCCResultType. In order to be able to do this, change getSetCCResultType to take a type as an argument, not a value (this is also more logical). llvm-svn: 61542
* Change comments so everybody can understand them, hopefully.Dale Johannesen2008-12-231-2/+2
| | | | llvm-svn: 61405
* Add another permutation where we should get rid of a-a.Dale Johannesen2008-12-231-4/+11
| | | | llvm-svn: 61401
OpenPOWER on IntegriCloud