summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* now that the cost model has changed, we can always consider Chris Lattner2010-01-101-25/+16
| | | | | | | | elimination of a sign extend to be a win, which simplifies the client of CanEvaluateSExtd, and allows us to eliminate more casts (examples taken from real code). llvm-svn: 93109
* Compute isFunctionLocal in MDNode ctor or via argument in new function ↵Victor Hernandez2010-01-105-23/+59
| | | | | | | | getWhenValsUnresolved(). Document PFS argument to ParseValID() and ConvertGlobalOrMetadataValIDToValue(). llvm-svn: 93108
* change the preferred canonical form for a sign extension to beChris Lattner2010-01-102-23/+8
| | | | | | | | lshr+ashr instead of trunc+sext. We want to avoid type conversions whenever possible, it is easier to codegen expressions without truncates and extensions. llvm-svn: 93107
* fix indentation of switch statements, no functionality change.Chris Lattner2010-01-101-79/+79
| | | | llvm-svn: 93106
* fix pasto that broke bootstrap.Chris Lattner2010-01-101-1/+1
| | | | llvm-svn: 93105
* simplify CanEvaluateZExtd now that we don't care about the number of Chris Lattner2010-01-101-89/+23
| | | | | | | bits known clear in the result and don't care about the # casts eliminated. TD is also dead but keeping it for now. llvm-svn: 93098
* two changes: Chris Lattner2010-01-101-25/+27
| | | | | | | | | | | 1) don't try to optimize a sext or zext that is only used by a trunc, let the trunc get optimized first. This avoids some pointless effort in some common cases since instcombine scans down a block in the first pass. 2) Change the cost model for zext elimination to consider an 'and' cheaper than a zext. This allows us to do it more aggressively, and for the next patch to simplify the code quite a bit. llvm-svn: 93097
* enhance CanEvaluateZExtd to handle shift left and sext, allowingChris Lattner2010-01-101-3/+17
| | | | | | more expressions to be promoted and casts eliminated. llvm-svn: 93096
* remove an xform subsumed by EvaluateInDifferentType.Chris Lattner2010-01-101-27/+0
| | | | llvm-svn: 93095
* Fix nondeterministic behavior.Julien Lerouge2010-01-101-9/+3
| | | | llvm-svn: 93093
* clean up this xform by using m_Trunc.Chris Lattner2010-01-101-12/+9
| | | | llvm-svn: 93092
* inline and remove the rest of commonIntCastTransforms.Chris Lattner2010-01-102-18/+18
| | | | llvm-svn: 93091
* Inline the expression type promotion/demotion stuff out ofChris Lattner2010-01-101-417/+417
| | | | | | | | | commonIntCastTransforms into the callers, eliminating a switch, and allowing the static predicate methods to be moved down to live next to the corresponding function. No functionality change. llvm-svn: 93089
* "In order to ease automatic bindings generation, it would be helpful if ↵Chris Lattner2010-01-096-71/+76
| | | | | | | | boolean values were distinguishable from integers. The attached patch introduces "typedef int LLVMBool;", and uses LLVMBool instead of int throughout the C API, wherever a boolean value is called for." Patch by James Y Knight! llvm-svn: 93079
* fix PR5983, reject function bodies with no blocks per the grammar.Chris Lattner2010-01-091-0/+4
| | | | llvm-svn: 93067
* Fix http://llvm.org/PR5729: x86-64 tail calls were putting their targets intoJeffrey Yasskin2010-01-091-2/+2
| | | | | | | | R11, and then asserting that the target was in R9. Since R9 isn't reserved for the target anymore, and is used as an argument, this patch changes the assertion. llvm-svn: 93065
* Use WriteAsOperand instead of getName() to print loop header names,Dan Gohman2010-01-092-8/+19
| | | | | | so that unnamed blocks are handled. llvm-svn: 93059
* Fixed linking of modules containing aliases to constant bitcasts. Existing ↵David Chisnall2010-01-091-5/+16
| | | | | | | | behaviour first tried to replace the aliases with the global that they aliased (rather than the bitcast), causing a crash on an assert because the types didn't match. When this was fixed, it then did the same thing creating the new alias (creating an alias with a different type to its aliasee). Linking modules containing aliases to GEPs is still not quite right. GEPs that are equivalent to bitcasts will be replaced by bitcasts, GEPs that are not will just break. Aliases to GEPs that are not equivalent to bitcasts are horribly broken anyway (it might be worth adding an assert when creating the alias to prevent these being created; they just cause problems later). llvm-svn: 93052
* Suppress use of uninitialized variable warning.Duncan Sands2010-01-091-1/+1
| | | | llvm-svn: 93046
* only factor from expressions whose uses are empty and whoseChris Lattner2010-01-091-0/+5
| | | | | | base is the right expression type. This fixes PR5981. llvm-svn: 93045
* Revert an earlier change to SIGN_EXTEND_INREG for vectors. The VTSDNodeDan Gohman2010-01-097-67/+107
| | | | | | | | | | 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
* clean up this code, add a fixme.Chris Lattner2010-01-091-7/+7
| | | | llvm-svn: 93042
* Delete NamedMDSymTable while destrucing Module.Devang Patel2010-01-092-0/+3
| | | | | | Disable copy ctor and operator= for NamedMDSymTable. Hide typedef that should be public. llvm-svn: 93041
* NamedMDNode is never used so there is no need to enumerate it here.Devang Patel2010-01-091-1/+1
| | | | llvm-svn: 93039
* Fix nondeterministic behavior.Julien Lerouge2010-01-091-6/+7
| | | | llvm-svn: 93038
* NamedMDNode element is either null or MDNode. Otherwise this is a malformed ↵Devang Patel2010-01-091-1/+3
| | | | | | NamedMDNode record. llvm-svn: 93037
* Derive NamedMDNode from Value.Devang Patel2010-01-093-11/+25
| | | | llvm-svn: 93032
* Dan pointed out checking whether a node is dead by comparing its opcode to ↵Evan Cheng2010-01-091-8/+26
| | | | | | ISD::DELETED_NODE is not safe. Use a DAGUpdateListener to remove dead nodes from work list instead. llvm-svn: 93031
* Fix a critical bug in 64-bit atomic operation lowering for 32-bit. The ↵Evan Cheng2010-01-081-8/+10
| | | | | | results of the cmpxchg8b instructions are being thrown away when it branches back to the top of the checking loop. This means the loop always compares against the old value and this can result in a dead lock. llvm-svn: 93028
* Remove unnecessary dyn_cast and add a comment. Part of a WIP.Eric Christopher2010-01-081-4/+4
| | | | llvm-svn: 93026
* mplement a theoretical fixme.Chris Lattner2010-01-081-3/+7
| | | | llvm-svn: 93024
* rename CanEvaluateInDifferentType -> CanEvaluateTruncated and Chris Lattner2010-01-081-71/+28
| | | | | | simplify it now that it is only used for truncates. llvm-svn: 93021
* Fix comment.Evan Cheng2010-01-081-1/+1
| | | | llvm-svn: 93020
* teach instcombine to delete sign extending shift pairs (sra(shl X, C), C) whenChris Lattner2010-01-081-4/+15
| | | | | | the input is already sign extended. llvm-svn: 93019
* fix PR5978 by peeling the loop so that we avoid shifting theChris Lattner2010-01-081-2/+2
| | | | | | | result int by 8 for the first byte. While normally harmless, if the result is smaller than a byte, this shift is invalid. llvm-svn: 93018
* Suppress an unused variable warning when assertions are off;Duncan Sands2010-01-081-2/+3
| | | | | | remove some trailing whitespace while there. llvm-svn: 93008
* tidy up some stuff duncan pointed out.Chris Lattner2010-01-081-2/+3
| | | | llvm-svn: 93007
* Minor change, change the order of two "let Inst{...}" stmts within multiclassJohnny Chen2010-01-081-1/+1
| | | | | | T2I_bin_ii12rs definition. llvm-svn: 93006
* After further thought revert the patch to make fast-isel avoidEric Christopher2010-01-081-6/+0
| | | | | | | | | | | putting relocations into the constant pool - this isn't needed for correctness and in the rare occasion it happens would pull us out of fast isel for the block. If fast-isel application startup time ever becomes an issue we can add better support for these addresses instead of bailing. llvm-svn: 92995
* ReplaceAllUsesOfValueWith may delete other nodes that the one being ↵Evan Cheng2010-01-081-1/+2
| | | | | | replaced. Do not delete dead nodes again. llvm-svn: 92988
* Fix what looks to me obvious instruction definition bugs.Evan Cheng2010-01-082-1/+3
| | | | | | | 1. CMPXCHG8B and CMPXCHG16B did not specify implicit physical register defs and uses. 2. LCMPXCHG8B is loading 64 bit memory, not 32 bit. llvm-svn: 92985
* Remove extraneous include.Eric Christopher2010-01-081-1/+0
| | | | llvm-svn: 92972
* teach ComputeNumSignBits to look through PHI nodes.Chris Lattner2010-01-072-7/+19
| | | | llvm-svn: 92964
* Enhance instcombine to reason more strongly about promoting computationChris Lattner2010-01-071-51/+144
| | | | | | | that feeds into a zext, similar to the patch I did yesterday for sext. There is a lot of room for extension beyond this patch. llvm-svn: 92962
* Fix rdar://7517201, a regression introduced by r92849.Chris Lattner2010-01-071-1/+1
| | | | | | | | | | When folding a and(any_ext(load)) both the any_ext and the load have to have only a single use. This removes the anyext-uses.ll testcase which started failing because it is unreduced and unclear what it is testing. llvm-svn: 92950
* factor this code better and reduce nesting at the sameChris Lattner2010-01-071-61/+41
| | | | | | time, no functionality change. llvm-svn: 92948
* APInt'fy TargetLowering::SimplifySetCC to fix PR5963.Evan Cheng2010-01-071-15/+15
| | | | llvm-svn: 92943
* Simplify code. No intended functionality/performance change.Benjamin Kramer2010-01-071-37/+12
| | | | llvm-svn: 92938
* If the data requires a relocation then don't attempt toEric Christopher2010-01-071-0/+7
| | | | | | | add it to the constant pool for fast-isel. We already don't add it for the normal case. llvm-svn: 92934
* We need to put any kind of data with a relocation into aEric Christopher2010-01-071-1/+1
| | | | | | not-readonly segment on darwin. llvm-svn: 92933
OpenPOWER on IntegriCloud