summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* [asan] do not instrument threadlocal globals, this is buggyKostya Serebryany2011-11-231-0/+6
| | | | llvm-svn: 145092
* Refactor code to use new attribute getters on CallSite for NoCapture and ByVal.Nick Lewycky2011-11-204-7/+6
| | | | | | | | Suggested in code review by Eli. That code in InstCombine looks kinda suspicious. llvm-svn: 145013
* [asan] workaround for reg alloc bug 11395: don't instrument functions with ↵Kostya Serebryany2011-11-181-0/+13
| | | | | | large chunks of inline assembler llvm-svn: 144962
* quick fix: remove GlobalVariable::GlobalVariable mistakenly commited at ↵Kostya Serebryany2011-11-171-3/+3
| | | | | | r144933. For some reason this compiles on linux llvm-svn: 144936
* Fix an overly general check in SimplifyIndvar to handle useless phi cycles.Andrew Trick2011-11-171-2/+2
| | | | | | | | | | | | | | The right way to check for a binary operation is cast<BinaryOperator>. The original check: cast<Instruction> && numOperands() == 2 would match phi "instructions", leading to an infinite loop in extreme corner case: a useless phi with operands [self, constant] that prior optimization passes failed to remove, being used in the loop by another useless phi, in turn being used by an lshr or udiv. Fixes PR11350: runaway iteration assertion. llvm-svn: 144935
* fall back to explicit list of allowed linkages when instrumenting globals in ↵Kostya Serebryany2011-11-171-2/+5
| | | | | | asan; add a test check that asan does not touch linkonce_odr llvm-svn: 144933
* Add support for custom names for library functions in TargetLibraryInfo. ↵Eli Friedman2011-11-172-13/+25
| | | | | | | | | | Add a custom name for fwrite and fputs on x86-32 OSX. Make SimplifyLibCalls honor the custom names for fwrite and fputs. Fixes <rdar://problem/9815881>. llvm-svn: 144876
* Merge isObjectPointerWithTrustworthySize with getPointerSize. Use it whenNick Lewycky2011-11-161-30/+20
| | | | | | looking at the size of the pointee. Fixes PR11390! llvm-svn: 144773
* AddressSanitizer, first commit (compiler module only)Kostya Serebryany2011-11-163-0/+967
| | | | llvm-svn: 144758
* test commit to verify that commit access works (added blank line)Kostya Serebryany2011-11-161-0/+1
| | | | llvm-svn: 144748
* Fix MSVC warnings by adding a cast. Nadav Rotem2011-11-151-4/+4
| | | | llvm-svn: 144721
* StringRefize and simplify.Benjamin Kramer2011-11-152-13/+10
| | | | llvm-svn: 144675
* Remove all remaining uses of Value::getNameStr().Benjamin Kramer2011-11-154-10/+11
| | | | llvm-svn: 144648
* Make headers standalone, move a virtual method out of line.Benjamin Kramer2011-11-141-0/+7
| | | | llvm-svn: 144536
* build: Attempt to rectify inconsistencies between CMake and LLVMBuild ↵Daniel Dunbar2011-11-121-0/+1
| | | | | | | | versions of explicit dependencies. - The hope is that we have a tool/test to verify these are accurate (and tight) soon. llvm-svn: 144444
* Make sure scalarrepl picks the correct alloca when it rewrites a bitcast. ↵Eli Friedman2011-11-121-2/+10
| | | | | | Fixes PR11353. llvm-svn: 144442
* LLVMBuild: Alphabetize required_libraries lists.Daniel Dunbar2011-11-112-2/+2
| | | | llvm-svn: 144416
* Get rid of an optimization in SCCP which appears to have many issues. ↵Eli Friedman2011-11-111-167/+1
| | | | | | | | | | Specifically, it doesn't handle many cases involving undef correctly, and it is missing other checks which lead to it trying to re-mark a value marked as a constant with a different value. It also appears to trigger very rarely. Fixes PR11357. llvm-svn: 144352
* Fixed bug in DeadStoreElimination commit r144239Pete Cooper2011-11-101-1/+1
| | | | | | | | Size of data being pointed to wasn't always being checked so some small writes were killing big writes Fixes <rdar://problem/10426753> llvm-svn: 144312
* DeadStoreElimination can now trim the size of a store if the end of the ↵Pete Cooper2011-11-091-33/+110
| | | | | | | | | | | store is dead. Currently checks alignment and killing stores on a power of 2 boundary as this is likely to trim the size of the earlier store without breaking large vector stores into scalar ones. Fixes <rdar://problem/10140300> llvm-svn: 144239
* LICM pass now understands invariant load metadata. Nothing generates this ↵Pete Cooper2011-11-081-0/+2
| | | | | | yet so it will currently never get used in real tests llvm-svn: 144107
* InstCombine now optimizes vector udiv by power of 2 to shiftsPete Cooper2011-11-071-5/+9
| | | | | | Fixes r8429 llvm-svn: 144036
* Make sure we don't insert instructions before a landingpad instruction.Bill Wendling2011-11-071-2/+2
| | | | | | <rdar://problem/10405911> llvm-svn: 144000
* Do simple cross-block DSE when we encounter a free statement. Fixes PR11240.Nick Lewycky2011-11-051-25/+56
| | | | llvm-svn: 143808
* Speculatively revert "DeadStoreElimination can now trim the size of a store ifDaniel Dunbar2011-11-041-109/+33
| | | | | | the end of it is dead.", which appears to break bootstrapping LLVM. llvm-svn: 143668
* build: Add initial cut at LLVMBuild.txt files.Daniel Dunbar2011-11-036-0/+139
| | | | llvm-svn: 143634
* DeadStoreElimination can now trim the size of a store if the end of it is dead.Pete Cooper2011-11-031-33/+109
| | | | | | | | | | Only currently done if the later store is writing to a power of 2 address or has the same alignment as the earlier store as then its likely to not break up large stores into smaller ones Fixes <rdar://problem/10140300> llvm-svn: 143630
* Rewrite LinearFunctionTestReplace to handle pointer-type IVs.Andrew Trick2011-11-021-73/+116
| | | | | | | | We've been hitting asserts in this code due to the many supported combintions of modes (iv-rewrite/no-iv-rewrite) and IV types. This second rewrite of the code attempts to deal with these cases systematically. llvm-svn: 143546
* Add parentheses to disambiguate the precedence of these operations andChandler Carruth2011-11-021-2/+2
| | | | | | silence -Wparentheses. llvm-svn: 143534
* Broaden an assert to handle enable-iv-rewrite=true following r143183.Andrew Trick2011-11-021-1/+1
| | | | | | Narrowest possible fix for PR11279. llvm-svn: 143522
* Make sure we use the right insertion point when instcombine replaces a PHI ↵Eli Friedman2011-11-011-3/+4
| | | | | | with another instruction. (Specifically, don't insert an arbitrary instruction before a PHI.) Fixes PR11275. llvm-svn: 143437
* Add utility to append a function to the list of global constructors. Devang Patel2011-10-312-0/+56
| | | | | | Patch by Kostya Serebryany. llvm-svn: 143405
* SimplifyLibCalls: Use IRBuilder.CreateGlobalString when creating a string ↵Benjamin Kramer2011-10-291-4/+2
| | | | | | | | for printf->puts, which correctly sets the unnamed_addr bit on the resulting GlobalVariable. Fixes PR11264. llvm-svn: 143289
* LFTR should avoid a type mismatch with null pointer IVs.Andrew Trick2011-10-281-16/+18
| | | | | | Fixes rdar://10359193 Indvar LinearFunctionTestReplace assertion llvm-svn: 143183
* It is not safe to sink an alloca into a stacksave/stackrestore pair, so ↵Eli Friedman2011-10-271-5/+6
| | | | | | don't do that. <rdar://problem/10352360> llvm-svn: 143093
* A dead malloc, a free(NULL) and a free(undef) are all trivially deadNick Lewycky2011-10-241-0/+8
| | | | | | | | | | instructions. This doesn't introduce any optimizations we weren't doing before (except potentially due to pass ordering issues), now passes will eliminate them sooner as part of their own cleanups. llvm-svn: 142787
* The element insertion code in scalar replacement doesn't handle incorrectCameron Zwarich2011-10-231-2/+4
| | | | | | | element types, even though the element extraction code does. It is surprising that this bug has been here for so long. Fixes <rdar://problem/10318778>. llvm-svn: 142740
* A non-escaping malloc in the entry block is not unlike an alloca. Do dead-storeNick Lewycky2011-10-221-2/+25
| | | | | | elimination on them too. llvm-svn: 142735
* Remap blockaddress correctly when inlining a function. Fixes PR10162.Eli Friedman2011-10-211-1/+32
| | | | llvm-svn: 142684
* Minor simplification: use ShuffleVectorInst::getMaskValue instead of a more ↵Eli Friedman2011-10-211-2/+2
| | | | | | expensive helper. llvm-svn: 142672
* Extend instcombine's shufflevector simplification to handle more cases where ↵Eli Friedman2011-10-211-61/+195
| | | | | | the input and output vectors have different sizes. Patch by Xiaoyi Guo. llvm-svn: 142671
* Refactor code from inlining and globalopt that checks whether a function ↵Eli Friedman2011-10-203-7/+4
| | | | | | definition is unused, and enhance it so it can tell that functions which are only used by a blockaddress are in fact dead. This probably doesn't happen much on most code, but the Linux kernel's _THIS_IP_ can trigger this issue with blockaddress. (GlobalDCE can also handle the given tescase, but we only run that at -O3.) Found while looking at PR11180. llvm-svn: 142572
* Initialze ScalarEvalution dependency.Devang Patel2011-10-191-0/+1
| | | | | | Patch by Pranav Bhandarkar! llvm-svn: 142556
* Teach the ARC optimizer about the !clang.arc.copy_on_escape metadataDan Gohman2011-10-171-12/+40
| | | | | | | tag on objc_retainBlock calls, which indicates that they may be optimized away. rdar://10211286. llvm-svn: 142298
* Add support for the Objective-C personality function to the instructionBill Wendling2011-10-171-2/+5
| | | | | | | | combining of the landingpad instruction. The ObjC personality function acts almost identically to the C++ personality function. In particular, it uses "null" as a "catch-all" value. llvm-svn: 142256
* Suppress partial retain+release elimination when there's aDan Gohman2011-10-171-2/+24
| | | | | | | possibility that it will span multiple CFG diamonds/triangles which could have different controlling predicates. rdar://10282956 llvm-svn: 142222
* Correct over-zealous removal of hack.Bill Wendling2011-10-171-1/+1
| | | | | | | Some code want to check that *any* call within a function has the 'returns twice' attribute, not just that the current function has one. llvm-svn: 142221
* Now that we have the ReturnsTwice function attribute, this method isBill Wendling2011-10-171-1/+1
| | | | | | | obsolete. Check the attribute instead. <rdar://problem/8031714> llvm-svn: 142212
* Fix CMake build.Michael J. Spencer2011-10-171-0/+1
| | | | llvm-svn: 142204
* svn mv Target/ARM/ARMGlobalMerge.cpp Transforms/Scalar/GlobalMerge.cppDevang Patel2011-10-171-0/+226
| | | | | | There is no reason to have simple IR level pass in lib/Target. llvm-svn: 142200
OpenPOWER on IntegriCloud