aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Revert 93158. It's breaking quite a few x86_64 tests.Evan Cheng2010-01-115-44/+37
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93185 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid adding PHI arguments for a predecessor that has gone away when a ↵Jakob Stoklund Olesen2010-01-111-14/+19
| | | | | | | | BRCOND was constant folded. This fixes PR5980. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93184 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused string functions.Benjamin Kramer2010-01-111-12/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93183 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not turn 8-bit OR to ADD since ADD8ri is not 3-addressfiable.Evan Cheng2010-01-111-4/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93182 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable transformation of select of two loads to a select of address and ↵Mon P Wang2010-01-111-28/+41
| | | | | | | | | then a load if the loads are not in the default address space because the transformation discards src value info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93180 91177308-0d34-0410-b5e6-96231b3b80d8
* Add StrInStrNoCase, a StringRef version of CStrInCStrNoCase.Benjamin Kramer2010-01-111-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93174 91177308-0d34-0410-b5e6-96231b3b80d8
* s/NextValueNo/NextMDValueNo while processing metadata.Devang Patel2010-01-112-12/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93165 91177308-0d34-0410-b5e6-96231b3b80d8
* Turns out llvm-gcc still uses SplitString with a vector. Add it back until IBenjamin Kramer2010-01-111-0/+12
| | | | | | | have a fix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93163 91177308-0d34-0410-b5e6-96231b3b80d8
* Reimplement getToken and SplitString as "StringRef helper functions"Benjamin Kramer2010-01-113-37/+30
| | | | | | | | | | - getToken is modeled after StringRef::split but it can split on multiple separator chars and skips leading seperators. - SplitString is a StringRef::split variant for more than 2 elements with the same behaviour as getToken. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93161 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a 32-bit and with implicit zero-extension instead of a 64-bit and if itDan Gohman2010-01-111-0/+11
| | | | | | | | | | | | has an immediate with at least 32 bits of leading zeros, to avoid needing to materialize that immediate in a register first. FileCheckize, tidy, and extend a testcase to cover this case. This fixes rdar://7527390. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93160 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-instate MOV64r0 and MOV16r0, with adjustments to work with theDan Gohman2010-01-115-37/+44
| | | | | | | | | new AsmPrinter. This is perhaps less elegant than describing them in terms of MOV32r0 and subreg operations, but it allows the current register to rematerialize them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93158 91177308-0d34-0410-b5e6-96231b3b80d8
* Pattern top-level operators don't need to be restricted to aDan Gohman2010-01-112-2/+2
| | | | | | | single user. The _su forms are intended for non-top-level nodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93155 91177308-0d34-0410-b5e6-96231b3b80d8
* Reword this comment to reference a more fundamental issue.Dan Gohman2010-01-111-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93154 91177308-0d34-0410-b5e6-96231b3b80d8
* Select an OR with immediate as an ADD if the input bits are known zero. This ↵Evan Cheng2010-01-112-9/+46
| | | | | | allow the instruction to be 3address-fied if needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93152 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a feature (-vector-unaligned-mem) to allow targets toDavid Greene2010-01-114-4/+16
| | | | | | | | | ignore alignment requirements for SIMD memory operands. This is useful on architectures like the AMD 10h that do not trap on unaligned references if a status bit is twiddled at startup time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93151 91177308-0d34-0410-b5e6-96231b3b80d8
* Respond to Chris' review:Victor Hernandez2010-01-112-9/+13
| | | | | | | | | Make InsertDbgValueIntrinsic() and get Offset take and recieve a uint64_t. Get constness correct for getVariable() and getValue(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93149 91177308-0d34-0410-b5e6-96231b3b80d8
* add one more bitfield optimization, allowing clang to generateChris Lattner2010-01-111-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | good code on PR4216: _test_bitfield: ## @test_bitfield orl $32962, %edi movl $4294941946, %eax andq %rdi, %rax ret instead of: _test_bitfield: movl $4294941696, %ecx movl %edi, %eax orl $194, %edi orl $32768, %eax andq $250, %rdi andq %rax, %rcx movq %rdi, %rax orq %rcx, %rax ret Evan is looking into the remaining andq+imm -> andl optimization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93147 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend CanEvaluateZExtd to handle and/or/xor more aggressively in theChris Lattner2010-01-111-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BitsToClear case. This allows it to promote expressions which have an and/or/xor after the lshr, promoting cases like test2 (from PR4216) and test3 (random extample extracted from a spec benchmark). clang now compiles the code in PR4216 into: _test_bitfield: ## @test_bitfield movl %edi, %eax orl $194, %eax movl $4294902010, %ecx andq %rax, %rcx orl $32768, %edi andq $39936, %rdi movq %rdi, %rax orq %rcx, %rax ret instead of: _test_bitfield: ## @test_bitfield movl %edi, %eax orl $194, %eax movl $4294902010, %ecx andq %rax, %rcx shrl $8, %edi orl $128, %edi shlq $8, %rdi andq $39936, %rdi movq %rdi, %rax orq %rcx, %rax ret which is still not great, but is progress. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93145 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the dead TD argument to CanEvaluateZExtd, and add aChris Lattner2010-01-111-14/+57
| | | | | | | | | | new BitsToClear result which allows us to start promoting expressions that end with a lshr-by-constant. This is conservatively correct and better than what we had before (see testcases) but still needs to be extended further. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93144 91177308-0d34-0410-b5e6-96231b3b80d8
* improve comments, remove dead TD argument to CanEvaluateSExtd.Chris Lattner2010-01-111-11/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93143 91177308-0d34-0410-b5e6-96231b3b80d8
* teach sext optimization to handle truncs from types that are notChris Lattner2010-01-101-3/+4
| | | | | | | the dest of the sext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93128 91177308-0d34-0410-b5e6-96231b3b80d8
* teach zext optimization how to deal with truncs that don't come fromChris Lattner2010-01-101-12/+12
| | | | | | | | | | | | | | | | | | | the zext dest type. This allows us to handle test52/53 in cast.ll, and allows llvm-gcc to generate much better code for PR4216 in -m64 mode: _test_bitfield: ## @test_bitfield orl $32962, %edi movl %edi, %eax andl $-25350, %eax ret This also fixes a bug handling vector extends, ensuring that the mask produced is a vector constant, not an integer constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93127 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a buggy assertion, CreateIntegerCast should allow Chris Lattner2010-01-101-1/+2
| | | | | | | integer vectors as well as just integers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93126 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress a warning on gcc 4.4.Mikhail Glushenkov2010-01-101-26/+26
| | | | | | warning: suggest parentheses around ‘&&’ within ‘||’. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93121 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify CanEvaluateSExtd to return a bool now that we have aChris Lattner2010-01-101-63/+22
| | | | | | | simpler profitability predicate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93111 91177308-0d34-0410-b5e6-96231b3b80d8
* the NumCastsRemoved argument to CanEvaluateSExtd is dead, remove it.Chris Lattner2010-01-101-26/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93110 91177308-0d34-0410-b5e6-96231b3b80d8
* 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93109 91177308-0d34-0410-b5e6-96231b3b80d8
* 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(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93108 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93107 91177308-0d34-0410-b5e6-96231b3b80d8
* fix indentation of switch statements, no functionality change.Chris Lattner2010-01-101-79/+79
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93106 91177308-0d34-0410-b5e6-96231b3b80d8
* fix pasto that broke bootstrap.Chris Lattner2010-01-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93105 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93098 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93097 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance CanEvaluateZExtd to handle shift left and sext, allowingChris Lattner2010-01-101-3/+17
| | | | | | | more expressions to be promoted and casts eliminated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93096 91177308-0d34-0410-b5e6-96231b3b80d8
* remove an xform subsumed by EvaluateInDifferentType.Chris Lattner2010-01-101-27/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93095 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix nondeterministic behavior.Julien Lerouge2010-01-101-9/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93093 91177308-0d34-0410-b5e6-96231b3b80d8
* clean up this xform by using m_Trunc.Chris Lattner2010-01-101-12/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93092 91177308-0d34-0410-b5e6-96231b3b80d8
* inline and remove the rest of commonIntCastTransforms.Chris Lattner2010-01-102-18/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93091 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93089 91177308-0d34-0410-b5e6-96231b3b80d8
* "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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93079 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR5983, reject function bodies with no blocks per the grammar.Chris Lattner2010-01-091-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93067 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93065 91177308-0d34-0410-b5e6-96231b3b80d8
* Use WriteAsOperand instead of getName() to print loop header names,Dan Gohman2010-01-092-8/+19
| | | | | | | so that unnamed blocks are handled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93059 91177308-0d34-0410-b5e6-96231b3b80d8
* 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93052 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress use of uninitialized variable warning.Duncan Sands2010-01-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93046 91177308-0d34-0410-b5e6-96231b3b80d8
* only factor from expressions whose uses are empty and whoseChris Lattner2010-01-091-0/+5
| | | | | | | base is the right expression type. This fixes PR5981. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93045 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93043 91177308-0d34-0410-b5e6-96231b3b80d8
* clean up this code, add a fixme.Chris Lattner2010-01-091-7/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93042 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete NamedMDSymTable while destrucing Module.Devang Patel2010-01-092-0/+3
| | | | | | | Disable copy ctor and operator= for NamedMDSymTable. Hide typedef that should be public. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93041 91177308-0d34-0410-b5e6-96231b3b80d8
* NamedMDNode is never used so there is no need to enumerate it here.Devang Patel2010-01-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93039 91177308-0d34-0410-b5e6-96231b3b80d8