summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Fix typos.Bill Wendling2008-02-161-2/+2
| | | | llvm-svn: 47200
* Rename CountMemOperands to ComputeMemOperandsEnd to reflect whatDan Gohman2008-02-161-12/+9
| | | | | | | it actually does. Simplify CountOperands a little by reusing ComputeMemOperandsEnd. And reword some comments for both. llvm-svn: 47198
* Revert 47177, which was incorrect.Dan Gohman2008-02-161-1/+1
| | | | llvm-svn: 47196
* 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
* The copy instruction being coalesced will be removed, it is not a kill.Evan Cheng2008-02-151-2/+2
| | | | llvm-svn: 47179
* Skip over the defs and start at the uses when looking for operandsDan Gohman2008-02-151-1/+1
| | | | | | with the TIED_TO attribute. llvm-svn: 47177
* Use the TargetInstrDescr to determine the number of operandsDan Gohman2008-02-151-3/+3
| | | | | | | that should be checked for the TIED_TO attribute instead of using CountOperands. llvm-svn: 47176
* Teach LegalizeTypes how to promote the flagsDuncan Sands2008-02-152-7/+34
| | | | | | | | | in a ret node. These are created as i32 constants but on some platforms i32 is not legal. This fixes 26 "make check" failures, for example Alpha/2005-07-12-TwoMallocCalls.ll. llvm-svn: 47172
* - Removing the infamous r2rMap_ and rep() method. Now the coalescer will updateEvan Cheng2008-02-154-390/+298
| | | | | | | register defs and uses after each successful coalescing. - Also removed a number of hacks and fixed some subtle kill information bugs. llvm-svn: 47167
* Added CommuteChangesDestination(). This returns true if commuting the specifiedEvan Cheng2008-02-151-1/+21
| | | | | | machine instr will change its definition register. llvm-svn: 47166
* Remove unnecessary #include.Evan Cheng2008-02-151-1/+0
| | | | llvm-svn: 47164
* Use StoreSDNode::getValue instead of calling getOperand directlyDan Gohman2008-02-151-4/+4
| | | | | | with a hard-coded operand number. llvm-svn: 47163
* Fix a miscompilation from Dan's recent apintification.Chris Lattner2008-02-141-3/+1
| | | | llvm-svn: 47128
* In TargetLowering::LowerCallTo, don't assert thatDuncan Sands2008-02-143-16/+25
| | | | | | | | | | | | | | | | | 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-143-17/+28
| | | | | | | | | | | | | | 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 a new type of MachineOperand, MO_FPImmediate, used for holdingNate Begeman2008-02-141-0/+10
| | | | | | FP Immediates, crazily enough llvm-svn: 47117
* Allow the APInt form of ComputeMaskedBits to operate on i128 types.Dan Gohman2008-02-131-4/+7
| | | | llvm-svn: 47101
* Avoid setting bits that aren't demanded.Dan Gohman2008-02-131-3/+3
| | | | llvm-svn: 47098
* Simplify some logic in ComputeMaskedBits. And change ComputeMaskedBitsDan Gohman2008-02-132-44/+52
| | | | | | to pass the mask APInt by value, not by reference. llvm-svn: 47096
* Enable exception handling int JITNicolas Geoffray2008-02-133-2/+31
| | | | llvm-svn: 47079
* Teach LegalizeTypes how to expand and promote CTLZ,Duncan Sands2008-02-133-18/+108
| | | | | | | | | | | | | | | | | | CTTZ and CTPOP. The expansion code differs from that in LegalizeDAG in that it chooses to take the CTLZ/CTTZ count from the Hi/Lo part depending on whether the Hi/Lo value is zero, not on whether CTLZ/CTTZ of Hi/Lo returned 32 (or whatever the width of the type is) for it. I made this change because the optimizers may well know that Hi/Lo is zero and exploit it. The promotion code for CTTZ also differs from that in LegalizeDAG: it uses an "or" to get the right result when the original value is zero, rather than using a compare and select. This also means the value doesn't need to be zero extended. llvm-svn: 47075
* Some code clean up.Evan Cheng2008-02-131-33/+34
| | | | llvm-svn: 47060
* Simplify.Evan Cheng2008-02-131-3/+1
| | | | llvm-svn: 47058
* Fix a potential serious problem where kills belonging to the val# defined by ↵Evan Cheng2008-02-131-3/+2
| | | | | | a two-address instruction is also on the val# that defines the input. llvm-svn: 47057
* * Cannot safely commute an instruction there are other defs which can reach ↵Evan Cheng2008-02-131-1/+5
| | | | | | | | its uses. * Ignore copy instructions which have already been coalesced. llvm-svn: 47056
* In SDISel, for targets that support FORMAL_ARGUMENTS nodes, lower thisChris Lattner2008-02-131-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | node as soon as we create it in SDISel. Previously we would lower it in legalize. The problem with this is that it only exposes the argument loads implied by FORMAL_ARGUMENTs after legalize, so that only dag combine 2 can hack on them. This causes us to miss some optimizations because datatype expansion also happens here. Exposing the loads early allows us to do optimizations on them. For example we now compile arg-cast.ll to: _foo: movl $2147483647, %eax andl 8(%esp), %eax ret where we previously produced: _foo: subl $12, %esp movsd 16(%esp), %xmm0 movsd %xmm0, (%esp) movl $2147483647, %eax andl 4(%esp), %eax addl $12, %esp ret It might also make sense to do this for ISD::CALL nodes, which have implicit stores on many targets. llvm-svn: 47054
* teach dag combiner how to eliminate MERGE_VALUES nodes.Chris Lattner2008-02-131-0/+14
| | | | llvm-svn: 47052
* Support legalizing insert_vector_elt on targets where the elementNate Begeman2008-02-131-27/+40
| | | | | | type is not legal. llvm-svn: 47048
* Initial support for copy elimination by commuting its definition MI.Evan Cheng2008-02-132-17/+243
| | | | | | | | | | | | | | | | | | | | | PR1877. A3 = op A2 B0<kill> ... B1 = A3 <- this copy ... = op A3 <- more uses ==> B2 = op B0 A2<kill> ... B1 = B2 <- now an identify copy ... = op B2 <- more uses This speeds up FreeBench/neural by 29%, Olden/bh by 12%, oopack_v1p8 by 53%. llvm-svn: 47046
* - Added removeValNo() to remove all live ranges of a particular value#.Evan Cheng2008-02-131-7/+61
| | | | | | - removeRange() can now update value# information. llvm-svn: 47044
* commuteInstr() can now commute non-ssa machine instrs.Evan Cheng2008-02-131-0/+9
| | | | llvm-svn: 47043
* Added debugging routine dumpUses.Evan Cheng2008-02-131-0/+8
| | | | llvm-svn: 47042
* Convert SelectionDAG::ComputeMaskedBits to use APInt instead of uint64_t.Dan Gohman2008-02-132-89/+119
| | | | | | | Add an overload that supports the uint64_t interface for use by clients that haven't been updated yet. llvm-svn: 47039
* Generalize getCopyFromParts and getCopyToParts toDuncan Sands2008-02-121-113/+215
| | | | | | | | | | | | handle arbitrary precision integers and any number of parts. For example, on a 32 bit machine an i50 corresponds to two i32 parts. getCopyToParts will extend the i50 to an i64 then write half of the i64 to each part; getCopyFromParts will combine the two i32 parts into an i64 then truncate the result to i50. llvm-svn: 47024
* Generalize the handling of call and return arguments,Duncan Sands2008-02-111-136/+85
| | | | | | | in preparation for apint support. These changes are intended to have no functional effect. llvm-svn: 46967
* From Chris' review: use isa instead of explicitly using classof.Dan Gohman2008-02-111-1/+1
| | | | llvm-svn: 46964
* From Chris' review: minor corrections in comments.Dan Gohman2008-02-111-2/+3
| | | | llvm-svn: 46963
* From Chris' review: use cast instead of dyn_cast with an assert.Dan Gohman2008-02-111-8/+4
| | | | llvm-svn: 46962
* From Chris' review: fix 80 column violationsDan Gohman2008-02-111-5/+10
| | | | llvm-svn: 46961
* Added "Profile" method to APFloat for use with FoldingSet.Ted Kremenek2008-02-111-3/+3
| | | | | | | | | | Added member template "Add" to FoldingSetNodeID that allows "adding" arbitrary objects to a profile via dispatch to FoldingSetTrait<T>::Profile(). Removed FoldingSetNodeID::AddAPFloat and FoldingSetNodeID::APInt, as their functionality is now replaced using the above mentioned member template. llvm-svn: 46957
* Add a isBigEndian method to complement isLittleEndian.Duncan Sands2008-02-113-11/+11
| | | | llvm-svn: 46954
* Determine whether a spill kills the register it's spilling before insertion ↵Evan Cheng2008-02-111-8/+3
| | | | | | rather than trying to undo the kill marker afterwards. llvm-svn: 46953
* Rename MRegisterInfo to TargetRegisterInfo.Dan Gohman2008-02-1034-417/+422
| | | | llvm-svn: 46930
* Add truncate and AssertZext result expansion.Duncan Sands2008-02-103-0/+33
| | | | llvm-svn: 46926
* Return "(c1 + c2)" instead of yet another ADD node (which made this aBill Wendling2008-02-101-1/+1
| | | | | | no-op). llvm-svn: 46922
* add anoteChris Lattner2008-02-101-0/+7
| | | | llvm-svn: 46918
* Remove unused hidden option.Evan Cheng2008-02-091-6/+1
| | | | llvm-svn: 46903
* Change ConstantSDNode to store an APInt instead of a uint64_t, andDan Gohman2008-02-081-3/+10
| | | | | | begin adding some methods to use it this way. llvm-svn: 46899
* Forgot these files.Evan Cheng2008-02-083-4/+4
| | | | llvm-svn: 46896
* Also print alignment.Evan Cheng2008-02-081-1/+1
| | | | llvm-svn: 46895
OpenPOWER on IntegriCloud