summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of the getPointeeAlignment helper function fromEli Friedman2012-11-261-22/+4
| | | | | | | | InstCombineLoadStoreAlloca.cpp, which had many issues. (At least two bugs were noted on llvm-commits, and it was overly conservative.) Instead, use getOrEnforceKnownAlignment. llvm-svn: 168629
* rdar://12329730 (defect 2)Shuxin Yang2012-11-261-0/+21
| | | | | | | | | | | | | | Enhancement to InstCombine. Try to catch this opportunity: --------------------------------------------------------------- ((X^C1) >> C2) ^ C3 => (X>>C2) ^ ((C1>>C2)^C3) where the subexpression "X ^ C1" has more than one uses, and "(X^C1) >> C2" has single use. ---------------------------------------------------------------- Reviewed by Nadav (with minor change per his request). llvm-svn: 168615
* Fix a comment bug in toascii simplifierMeador Inge2012-11-261-1/+1
| | | | | | | When I migrated the toascii simplifier in r168580 Benjamin Kramer noticed a bug in one of the comments that I migrated. llvm-svn: 168605
* instcombine: Migrate printf optimizationsMeador Inge2012-11-262-89/+104
| | | | | | | This patch migrates the printf optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168604
* Move the code that uses SCEVs prior to creating the new loops. Nadav Rotem2012-11-261-32/+35
| | | | llvm-svn: 168601
* Remove stray trailing backslashMatt Beaumont-Gay2012-11-261-1/+1
| | | | llvm-svn: 168592
* tsan: fix lint warningsDmitry Vyukov2012-11-261-2/+2
| | | | llvm-svn: 168590
* [tsan] add fail order to compare_exchangeDmitry Vyukov2012-11-261-3/+27
| | | | llvm-svn: 168586
* instcombine: Migrate toascii optimizationsMeador Inge2012-11-262-26/+16
| | | | | | | This patch migrates the toascii optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168580
* instcombine: Migrate isascii optimizationsMeador Inge2012-11-262-20/+17
| | | | | | | This patch migrates the isascii optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168579
* instcombine: Migrate isdigit optimizationsMeador Inge2012-11-262-21/+19
| | | | | | | This patch migrates the isdigit optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168578
* instcombine: Migrate *abs optimizationsMeador Inge2012-11-262-25/+22
| | | | | | | This patch migrates the *abs optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168574
* instcombine: Migrate ffs* optimizationsMeador Inge2012-11-252-41/+47
| | | | | | | This patch migrates the ffs* optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168571
* Move the max vector width to a constant parameter. No functionality change.Nadav Rotem2012-11-251-5/+7
| | | | llvm-svn: 168570
* Fix the document style.Nadav Rotem2012-11-251-3/+3
| | | | llvm-svn: 168569
* Refactor the ptr runtime check generation code. No functionality change.Nadav Rotem2012-11-251-50/+66
| | | | llvm-svn: 168568
* Rename method. No functionality change.Nadav Rotem2012-11-251-3/+3
| | | | llvm-svn: 168560
* The induction-pointer work is inspired by a research paper. This commit adds ↵Nadav Rotem2012-11-251-0/+4
| | | | | | a reference. llvm-svn: 168559
* Add support for pointer induction variables even when there is no integer ↵Nadav Rotem2012-11-251-105/+182
| | | | | | induction variable. llvm-svn: 168558
* CodeGenPrepare: Move ret duplication out of the instruction iteration loop.Benjamin Kramer2012-11-231-6/+8
| | | | | | | It can delete the block, and the loop continues on free'd memory. No change in output. Found by valgrind. llvm-svn: 168525
* Remove unused parameter Penalty from the BoundsChecking pass.Joey Gouly2012-11-231-4/+3
| | | | llvm-svn: 168511
* llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp: Prune ↵NAKAMURA Takumi2012-11-221-1/+0
| | | | | | AddressSanitizerCreateGlobalRedzonesPass::ID. [-Wunused-variable] llvm-svn: 168499
* [asan] rip off the creation of global redzones from the main ↵Kostya Serebryany2012-11-221-52/+75
| | | | | | AddressSanitizer class into a separate class. The intent is to make it a separate ModulePass in the following commmits llvm-svn: 168484
* PR14055: Implement support for sub-vector operations in SROA.Chandler Carruth2012-11-211-21/+75
| | | | | | | | | | Now if we can transform an alloca into a single vector value, but it has subvector, non-element accesses, we form the appropriate shufflevectors to allow SROA to proceed. This fixes PR14055 which pointed out a very common pattern that SROA couldn't handle -- mixed vec3 and vec4 operations on a single alloca. llvm-svn: 168418
* [asan] use names of globals instead of an external set to distinguish the ↵Kostya Serebryany2012-11-201-4/+8
| | | | | | globals generated by asan llvm-svn: 168368
* [asan] don't instrument linker-initialized globals even with external ↵Kostya Serebryany2012-11-201-5/+3
| | | | | | linkage in -asan-initialization-order mode llvm-svn: 168367
* [asan] make sure that linker-initialized globals (non-extern) are not ↵Kostya Serebryany2012-11-201-31/+31
| | | | | | instrumented even in -asan-initialization-order mode. This time with a test llvm-svn: 168366
* Use LLVM_ENABLE_DUMP for the variables used in printing as well as theChandler Carruth2012-11-201-2/+2
| | | | | | | | | printing functions themselves. Part of PR14324 (which should have just been a patch to the list, but hey...) llvm-svn: 168362
* Fix PR14132 and handle OOB loads speculated throuh PHI nodes.Chandler Carruth2012-11-201-0/+21
| | | | | | | | | | | | The issue is that we may end up with newly OOB loads when speculating a load into the predecessors of a PHI node, and this confuses the new integer splitting logic in some cases, triggering an assertion failure. In fact, the branch in question must be dead code as it loads from a too-narrow alloca. Add code to handle this gracefully and leave the requisite FIXMEs for both optimizing more aggressively and doing more to aid sanitizing invalid code which triggers these patterns. llvm-svn: 168361
* Make the AttrListPtr object a part of the LLVMContext.Bill Wendling2012-11-204-21/+41
| | | | | | | | | When code deletes the context, the AttributeImpls that the AttrListPtr points to are now invalid. Therefore, instead of keeping a separate managed static for the AttrListPtrs that's reference counted, move it into the LLVMContext and delete it when deleting the AttributeImpls. llvm-svn: 168354
* Add a comment to associate a FIXME with a PR where it is matters.Chandler Carruth2012-11-201-1/+2
| | | | llvm-svn: 168347
* Rework the rewriting of loads and stores for vector and integer allocasChandler Carruth2012-11-201-168/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | to properly handle the combinations of these with split integer loads and stores. This essentially replaces Evan's r168227 by refactoring the code in a different way, and trynig to mirror that refactoring in both the load and store sides of the rewriting. Generally speaking there was some really problematic duplicated code here that led to poorly founded assumptions and then subtle bugs. Now much of the code actually flows through and follows a more consistent style and logical path. There is still a tiny bit of duplication on the store side of things, but it is much less bad. This also changes the logic to never re-use a load or store instruction as that was simply too error prone in practice. I've added a few tests (one a reduction of the one in Evan's original patch, which happened to be the same as the report in PR14349). I'm going to look at adding a few more tests for things I found and fixed in passing (such as the volatile tests in the vectorizable predicate). This patch has survived bootstrap, and modulo one bugfix survived Duncan's test suite, but let me know if anything else explodes. llvm-svn: 168346
* Clean up handling of always-inline functions in the inliner.Bob Wilson2012-11-191-44/+10
| | | | | | | | | This patch moves the isInlineViable function from the InlineAlways pass into the InlineCostAnalyzer and then changes the InlineCost computation to use that simple check for always-inline functions. All the special-case checks for AlwaysInline in the CallAnalyzer can then go away. llvm-svn: 168300
* Remove the last bit of constant folding from LinearizeExprTree (most of it wasDuncan Sands2012-11-181-11/+0
| | | | | | removed in commit 168035, but I missed this bit). llvm-svn: 168292
* Fix PR14060, an infinite loop in reassociate. The problem was that one of theDuncan Sands2012-11-181-6/+24
| | | | | | | | | | operands of the expression being written was wrongly thought to be reusable as an inner node of the expression resulting in it turning up as both an inner node *and* a leaf, creating a cycle in the def-use graph. This would have caused the verifier to blow up if things had gotten that far, however it managed to provoke an infinite loop first. llvm-svn: 168291
* Don't try to calculate the alignment of an unsigned type. Fixes PR14371!Nick Lewycky2012-11-181-1/+2
| | | | llvm-svn: 168280
* Plug a memory leak in the GCOV profiling emitter, which never released the ↵Benjamin Kramer2012-11-171-5/+5
| | | | | | edge table memory. llvm-svn: 168259
* LoopVectorizer: Add initial support for pointer induction variables (for ↵Nadav Rotem2012-11-171-33/+126
| | | | | | | | example: *dst++ = *src++). At the moment we still require to have an integer induction variable (for example: i++). llvm-svn: 168231
* Teach SROA rewriteVectorizedStoreInst to handle cases when the loaded value ↵Evan Cheng2012-11-171-33/+42
| | | | | | is narrower than the stored value. rdar://12713675 llvm-svn: 168227
* Make this easier to understand, as suggested by Chandler.Duncan Sands2012-11-161-1/+6
| | | | llvm-svn: 168196
* Fix PR14361: wrong simplification of A+B==B+A. You may think that the old logicDuncan Sands2012-11-161-2/+14
| | | | | | | | | replaced by this patch is equivalent to the new logic, but you'd be wrong, and that's exactly where the bug was. There's a similar bug in instsimplify which manifests itself as instsimplify failing to simplify this, rather than doing it wrong, see next commit. llvm-svn: 168181
* SimplifyCFG: Don't assume non-null ScalarTargetTransformInfo.Hans Wennborg2012-11-161-1/+2
| | | | | | Patch by Pekka Jääskeläinen! llvm-svn: 168176
* LoopVectorize: Division reductions generate incorrect code. Remove the part ↵Nadav Rotem2012-11-161-2/+0
| | | | | | | | of the code that deals with divs. Thanks to Paul Redmond for catching this while reviewing the code. llvm-svn: 168142
* misspellAndrew Trick2012-11-151-3/+3
| | | | llvm-svn: 168058
* whitespaceAndrew Trick2012-11-151-4/+4
| | | | llvm-svn: 168057
* Use empty parens for empty function parameter list instead of '(void)'.Dmitri Gribenko2012-11-152-2/+2
| | | | llvm-svn: 168049
* Make GlobalOpt be conservative with TLS variables (PR14309)Hans Wennborg2012-11-151-0/+9
| | | | | | | | | | | | | | For global variables that get the same value stored into them everywhere, GlobalOpt will replace them with a constant. The problem is that a thread-local GlobalVariable looks like one value (the address of the TLS var), but is different between threads. This patch introduces Constant::isThreadDependent() which returns true for thread-local variables and constants which depend on them (e.g. a GEP into a thread-local array), and teaches GlobalOpt not to track such values. llvm-svn: 168037
* Fix a crash observed by Shuxin Yang. The issue here is that LinearizeExprTree,Duncan Sands2012-11-151-54/+21
| | | | | | | | | | | | | | the utility for extracting a chain of operations from the IR, thought that it might as well combine any constants it came across (rather than just returning them along with everything else). On the other hand, the factorization code would like to see the individual constants (this is quite reasonable: it is much easier to pull a factor of 3 out of 2*3 than it is to pull it out of 6; you may think 6/3 isn't so hard, but due to overflow it's not as easy to undo multiplications of constants as it may at first appear). This patch therefore makes LinearizeExprTree stupider: it now leaves optimizing to the optimization part of reassociate, and sticks to just analysing the IR. llvm-svn: 168035
* InstCombineAndOrXor.cpp: Escape bracket in doxygen description. ↵NAKAMURA Takumi2012-11-151-1/+1
| | | | | | [-Wdocumentation] llvm-svn: 168013
* Replace std::vector -> SmallVector in BBVectorizeHal Finkel2012-11-141-4/+4
| | | | | | | | | For now, this uses 8 on-stack elements. I'll need to do some profiling to see if this is the best number. Pointed out by Jakob in post-commit review. llvm-svn: 167966
OpenPOWER on IntegriCloud