summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* LoadStoreVectorizer: Fix warning about extra semicolonMatt Arsenault2016-07-011-2/+2
| | | | llvm-svn: 274406
* [msan] Fix __msan_maybe_ for non-standard type sizes.Evgeniy Stepanov2016-07-011-1/+1
| | | | | | | | | | | Fix incorrect calculation of the type size for __msan_maybe_warning_N call that resulted in an invalid (narrowing) zext instruction and "Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed." Only happens in very large functions (with more than 3500 MSan checks) operating on integer types that are not power-of-two. llvm-svn: 274395
* Address two correctness issues in LoadStoreVectorizerAlina Sbirlea2016-07-011-3/+10
| | | | | | | | | | | | | | Summary: GetBoundryInstruction returns the last instruction as the instruction which follows or end(). Otherwise the last instruction in the boundry set is not being tested by isVectorizable(). Partially solve reordering of instructions. More extensive solution to follow. Reviewers: tstellarAMD, llvm-commits, jlebar Subscribers: escha, arsenm, mzolotukhin Differential Revision: http://reviews.llvm.org/D21934 llvm-svn: 274389
* fix documentation comments; NFCSanjay Patel2016-07-011-13/+12
| | | | llvm-svn: 274362
* [PM] refactor LoopAccessInfo code part-2Xinliang David Li2016-07-014-10/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D21636 llvm-svn: 274334
* LoadStoreVectorizer: improvements: better pointer analysisMatt Arsenault2016-07-011-5/+26
| | | | | | | | | If OpB has an ADD NSW/NUW, we can use that to prove that adding 1 to OpA won't wrap if OpA + 1 == OpB. Patch by Fiona Glaser llvm-svn: 274324
* LoadStoreVectorizer: Don't increase alignment with no align setMatt Arsenault2016-07-011-2/+18
| | | | | | | If no alignment was set on the load/stores, it would vectorize to the new type even though this increases the default alignment. llvm-svn: 274323
* LoadStoreVectorizer: Check TTI for vec reg bit widthMatt Arsenault2016-07-011-16/+28
| | | | llvm-svn: 274322
* LoadStoreVectorizer: Fix assert when merging pointer opsMatt Arsenault2016-07-011-3/+17
| | | | | | | This needs to use inttoptr/ptrtoint if combining an int and pointer load. If a pointer is used always do an integer load. llvm-svn: 274321
* Revert "code hoisting pass based on GVN"Duncan P. N. Exon Smith2016-07-014-747/+0
| | | | | | | | | | | | This reverts commit r274305, since it breaks self-hosting: http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_build/22349/ http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules/builds/17232 Note that the blamelist on lab.llvm.org:8011 is incorrect. The previous build was r274299, but somehow r274305 wasn't included in the blamelist: http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules llvm-svn: 274320
* LoadStoreVectorizer: Use AA metadataMatt Arsenault2016-07-011-8/+5
| | | | | | | This was not passing the full instruction with metadata to the alias query. llvm-svn: 274318
* LoadStoreVectorizer: if one element of a vector is integer, default toMatt Arsenault2016-07-011-2/+18
| | | | | | | | | | | | integer. Fixes issues on some architectures where we use arithmetic ops to build vectors, which can cause bad things to happen for loads/stores of mixed types. Patch by Fiona Glaser llvm-svn: 274307
* LoadStoreVectorizer: Fix crashes on sub-byte typesMatt Arsenault2016-07-011-2/+14
| | | | llvm-svn: 274306
* code hoisting pass based on GVNSebastian Pop2016-07-014-0/+747
| | | | | | | | | | | | | This pass hoists duplicated computations in the program. The primary goal of gvn-hoist is to reduce the size of functions before inline heuristics to reduce the total cost of function inlining. Pass written by Sebastian Pop, Aditya Kumar, Xiaoyu Hu, and Brian Rzycki. Important algorithmic contributions by Daniel Berlin under the form of reviews. Differential Revision: http://reviews.llvm.org/D19338 llvm-svn: 274305
* LoadStoreVectorizer: Check skipFunction first.Matt Arsenault2016-06-301-4/+4
| | | | | | Also add test I forgot to add to r274296. llvm-svn: 274299
* LoadStoreVectorizer: Skip optnone functionsMatt Arsenault2016-06-301-1/+1
| | | | llvm-svn: 274296
* Add LoadStoreVectorizer passMatt Arsenault2016-06-303-1/+827
| | | | | | | This was contributed by Apple, and I've been working on minimal cleanups and generalizing it. llvm-svn: 274293
* Don't use unchecked dyn_castMatt Arsenault2016-06-301-1/+1
| | | | llvm-svn: 274282
* SLPVectorizer: Move propagateMetadata to VectorUtilsMatt Arsenault2016-06-302-68/+7
| | | | | | | | This will be re-used by the LoadStoreVectorizer. Fix handling of range metadata and testcase by Justin Lebar. llvm-svn: 274281
* Refine the set of UniformAfterVectorization instructions.Wei Mi2016-06-301-26/+71
| | | | | | | | | | Except the seed uniform instructions (conditional branch and consecutive ptr instructions), dependencies to be added into uniform set should only be used by existing uniform instructions or intructions outside of current loop. Differential Revision: http://reviews.llvm.org/D21755 llvm-svn: 274262
* fix formatting, add TODO; NFCSanjay Patel2016-06-301-1/+2
| | | | llvm-svn: 274238
* [DSE] Fix bug in partial overwrite trackingJun Bum Lim2016-06-301-7/+14
| | | | | | | | | | | | | | Summary: Found cases where DSE incorrectly add partially-overwritten intervals. Please see the test case for details. Reviewers: mcrosier, eeckstein, hfinkel Subscribers: mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D21859 llvm-svn: 274237
* [InstCombine] shrink switch conditions better (PR24766)Sanjay Patel2016-06-301-7/+5
| | | | | | | | | | | | | | https://llvm.org/bugs/show_bug.cgi?id=24766#c2 This removes a hack that was added for the benefit of x86 codegen. It prevented shrinking the switch condition even to smaller legal (DataLayout) types. We have a safety mechanism in CGP after: http://reviews.llvm.org/rL251857 ...so we're free to use the optimal (smallest) IR type now. Differential Revision: http://reviews.llvm.org/D12965 llvm-svn: 274233
* [InstCombine] use ConstantExpr::getBitCast() instead of creating useless ↵Sanjay Patel2016-06-301-2/+1
| | | | | | instruction llvm-svn: 274229
* [InstCombine] extend matchSelectFromAndOr() to work with i1 scalar typesSanjay Patel2016-06-301-10/+26
| | | | | | | | If the incoming types are i1, then we don't have to pattern match any sext ops. Differential Revision: http://reviews.llvm.org/D21740 llvm-svn: 274228
* [LV] Improve accuracy and formatting of function commentAdam Nemet2016-06-291-2/+3
| | | | llvm-svn: 274182
* [InstCombine] Simplify and correct folding fcmps with the same childrenTim Shen2016-06-291-122/+76
| | | | | | | | | | | | | | Summary: Take advantage of FCmpInst::Predicate's bit pattern and handle (fcmp *, x, y) | (fcmp *, x, y) and (fcmp *, x, y) & (fcmp *, x, y) more consistently. Also fold more FCmpInst::FCMP_FALSE and FCmpInst::FCMP_TRUE to constants. Currently InstCombine wrongly folds (fcmp ogt, x, y) | (fcmp ord, x, y) to (fcmp ogt, x, y); this patch also fixes that. Reviewers: spatel Subscribers: llvm-commits, iteratee, echristo Differential Revision: http://reviews.llvm.org/D21775 llvm-svn: 274156
* [InstCombine, NFC] Change the generated variable names by creating new ↵Tim Shen2016-06-291-6/+6
| | | | | | | | instructions This removes some noise for D21775's test changes. llvm-svn: 274155
* Reverted patch 273864Elena Demikhovsky2016-06-291-8/+85
| | | | llvm-svn: 274115
* [Diag] Add getter shouldAlwaysPrint. NFCAdam Nemet2016-06-292-3/+4
| | | | | | | | | | For the new hotness attribute, the API will take the pass rather than the pass name so we can no longer play the trick of AlwaysPrint being a special pass name. This adds a getter to help the transition. There is also a corresponding clang patch. llvm-svn: 274100
* Revert "[InstCombine] Avoid combining the bitcast of a var that is used as ↵Eric Christopher2016-06-292-114/+0
| | | | | | | | | | | | both address and result of load instructions" Revert "[InstCombine] Combine A->B->A BitCast" as this appears to cause PR27996 and as discussed in http://reviews.llvm.org/D20847 This reverts commits r270135 and r263734. llvm-svn: 274094
* [LLE] Don't hoist conditionally executed loadsAdam Nemet2016-06-281-0/+11
| | | | | | | | If the load is conditional we can't hoist its 0-iteration instance to the preheader because that would make it unconditional. Thus we would access a memory location that the original loop did not access. llvm-svn: 273991
* [PM] Normalize FIXMEs for missing PreserveCFG to have the same wording.Michael Kuperstein2016-06-289-19/+9
| | | | llvm-svn: 273974
* [InstCombine] shrink type of sdiv if dividend is sexted and constant divisor ↵Sanjay Patel2016-06-271-0/+17
| | | | | | | | | | | is small enough (PR28153) This should fix PR28153: https://llvm.org/bugs/show_bug.cgi?id=28153 Differential Revision: http://reviews.llvm.org/D21769 llvm-svn: 273951
* Fixed crash of SLP Vectorizer on KNLElena Demikhovsky2016-06-271-0/+2
| | | | | | | The bug is connected to vector GEPs. https://llvm.org/bugs/show_bug.cgi?id=28313 llvm-svn: 273919
* [InstCombine] refactor sdiv by APInt transforms (NFC)Sanjay Patel2016-06-271-9/+10
| | | | | | | There's at least one more fold to do here: https://llvm.org/bugs/show_bug.cgi?id=28153 llvm-svn: 273904
* Factor out buildMemorySSA from getWalker.Daniel Berlin2016-06-271-8/+11
| | | | | | NFC. llvm-svn: 273901
* [InstCombine] use m_APInt for div --> ashr foldSanjay Patel2016-06-271-8/+6
| | | | | | The APInt matcher works with splat vectors, so we get this fold for vectors too. llvm-svn: 273897
* [PM] Port PartialInlining to the new PMEaswaran Raman2016-06-272-22/+29
| | | | | | Differential revision: http://reviews.llvm.org/D21699 llvm-svn: 273894
* [asan] fix false dynamic-stack-buffer-overflow report with constantly-sized ↵Kuba Brecka2016-06-271-9/+10
| | | | | | | | | | dynamic allocas, LLVM part See the bug report at https://github.com/google/sanitizers/issues/691. When a dynamic alloca has a constant size, ASan instrumentation will treat it as a regular dynamic alloca (insert calls to poison and unpoison), but the backend will turn it into a regular stack variable. The poisoning/unpoisoning is then broken. This patch will treat such allocas as static. Differential Revision: http://reviews.llvm.org/D21509 llvm-svn: 273888
* [msan] Tighten up type in StoreList. NFC.Benjamin Kramer2016-06-271-13/+13
| | | | llvm-svn: 273866
* Fixed consecutive memory access detection in Loop Vectorizer.Elena Demikhovsky2016-06-271-85/+8
| | | | | | | | | | | | | | | | It did not handle correctly cases without GEP. The following loop wasn't vectorized: for (int i=0; i<len; i++) *to++ = *from++; I use getPtrStride() to find Stride for memory access and return 0 is the Stride is not 1 or -1. Re-commit rL273257 - revision: http://reviews.llvm.org/D20789 llvm-svn: 273864
* [CodeExtractor] Merge DEBUG statements in an attempt to fix the msvcBenjamin Kramer2016-06-261-4/+6
| | | | | | | | | build. There's a known bug in msvc 2013 that fails to compile do-while loops inside of ranged for loops. llvm-svn: 273811
* Apply clang-tidy's modernize-loop-convert to most of lib/Transforms.Benjamin Kramer2016-06-2651-506/+388
| | | | | | Only minor manual fixes. No functionality change intended. llvm-svn: 273808
* [RSForGC] Appease MSVCSanjoy Das2016-06-261-2/+4
| | | | llvm-svn: 273805
* [LoopUnswitch] Unswitch on conditions feeding into guardsSanjoy Das2016-06-261-7/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a straightforward extension of what LoopUnswitch does to branches to guards. That is, we unswitch ``` for (;;) { ... guard(loop_invariant_cond); ... } ``` into ``` if (loop_invariant_cond) { for (;;) { ... // There is no need to emit guard(true) ... } } else { for (;;) { ... guard(false); // SimplifyCFG will clean this up by adding an // unreachable after the guard(false) ... } } ``` Reviewers: majnemer Subscribers: mcrosier, llvm-commits, mzolotukhin Differential Revision: http://reviews.llvm.org/D21725 llvm-svn: 273801
* [RSForGC] Bring the BDVState struct up to code; NFCSanjoy Das2016-06-261-25/+33
| | | | llvm-svn: 273800
* [RSForGC] Bring computeLiveInValues up to code; NFCSanjoy Das2016-06-261-8/+5
| | | | llvm-svn: 273799
* [RSForGC] Bring computeLiveOutSeed up to code; NFCSanjoy Das2016-06-261-7/+7
| | | | llvm-svn: 273798
* [RSForGC] Bring computeLiveInValues up to code; NFCSanjoy Das2016-06-261-19/+8
| | | | llvm-svn: 273797
OpenPOWER on IntegriCloud