summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix handling of missing DataLayout in sanitizers.Evgeniy Stepanov2014-04-234-4/+4
| | | | | | | Pass::doInitialization is supposed to return False when it did not change the program, not when a fatal error occurs. llvm-svn: 206975
* [LV] Statistics numbers for LoopVectorize introduced: a number of analyzed ↵Alexander Musman2014-04-231-0/+7
| | | | | | | | | | | loops & a number of vectorized loops. Use -stats to see how many loops were analyzed for possible vectorization and how many of them were actually vectorized. Patch by Zinovy Nis Differential Revision: http://reviews.llvm.org/D3438 llvm-svn: 206956
* [Constant Hoisting] Materialize the constant before the cloned cast instruction.Juergen Ributzka2014-04-221-2/+11
| | | | | | | | | | | | In the case where the constant comes from a cloned cast instruction, the materialization code has to go before the cloned cast instruction. This commit fixes the method that finds the materialization insertion point by making it aware of this case. This fixes <rdar://problem/15532441> llvm-svn: 206913
* [Constant Hoisting] Print the instructions in the correct order for ↵Juergen Ributzka2014-04-221-2/+2
| | | | | | debugging. No functional change. llvm-svn: 206912
* [asan] Support outline instrumentation for wide types and delete dead code, ↵Kostya Serebryany2014-04-221-27/+12
| | | | | | patch by Yuri Gribov llvm-svn: 206883
* [Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-2298-111/+202
| | | | | | | | | | | | | | | | | definition below all of the header #include lines, lib/Transforms/... edition. This one is tricky for two reasons. We again have a couple of passes that define something else before the includes as well. I've sunk their name macros with the DEBUG_TYPE. Also, InstCombine contains headers that need DEBUG_TYPE, so now those headers #define and #undef DEBUG_TYPE around their code, leaving them well formed modular headers. Fixing these headers was a large motivation for all of these changes, as "leaky" macros of this form are hard on the modules implementation. llvm-svn: 206844
* [Modules] Make Support/Debug.h modular. This requires it to not changeChandler Carruth2014-04-214-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | behavior based on other files defining DEBUG_TYPE, which means it cannot define DEBUG_TYPE at all. This is actually better IMO as it forces folks to define relevant DEBUG_TYPEs for their files. However, it requires all files that currently use DEBUG(...) to define a DEBUG_TYPE if they don't already. I've updated all such files in LLVM and will do the same for other upstream projects. This still leaves one important change in how LLVM uses the DEBUG_TYPE macro going forward: we need to only define the macro *after* header files have been #include-ed. Previously, this wasn't possible because Debug.h required the macro to be pre-defined. This commit removes that. By defining DEBUG_TYPE after the includes two things are fixed: - Header files that need to provide a DEBUG_TYPE for some inline code can do so by defining the macro before their inline code and undef-ing it afterward so the macro does not escape. - We no longer have rampant ODR violations due to including headers with different DEBUG_TYPE definitions. This may be mostly an academic violation today, but with modules these types of violations are easy to check for and potentially very relevant. Where necessary to suppor headers with DEBUG_TYPE, I have moved the definitions below the includes in this commit. I plan to move the rest of the DEBUG_TYPE macros in LLVM in subsequent commits; this one is big enough. The comments in Debug.h, which were hilariously out of date already, have been updated to reflect the recommended practice going forward. llvm-svn: 206822
* Simplify a vpermil* with constant mask.Rafael Espindola2014-04-211-0/+15
| | | | | | | | With a constant mask a vpermil* is just a shufflevector. This patch implements that simplification. This allows us to produce denser code. It should also allow more folding down the line. llvm-svn: 206801
* Use unique_ptr to handle GlobalOpt's Evaluator membersDavid Blaikie2014-04-211-17/+10
| | | | llvm-svn: 206790
* Fix PR7272 in -tailcallelim instead of the inlinerReid Kleckner2014-04-212-8/+10
| | | | | | | | | | | | | | | | The -tailcallelim pass should be checking if byval or inalloca args can be captured before marking calls as tail calls. This was the real root cause of PR7272. With a better fix in place, revert the inliner change from r105255. The test case it introduced still passes and has been moved to test/Transforms/Inline/byval-tail-call.ll. Reviewers: chandlerc Differential Revision: http://reviews.llvm.org/D3403 llvm-svn: 206789
* Simplify expression that was explicitly naming an operator overload in a call.David Blaikie2014-04-211-1/+1
| | | | llvm-svn: 206788
* Use unique_ptr to handle ownership of GCOVFunctions in GCOVProfiler.David Blaikie2014-04-211-14/+10
| | | | llvm-svn: 206786
* [Modules] Sink all the DEBUG_TYPE defines for InstCombine out of theChandler Carruth2014-04-2113-2/+12
| | | | | | | | | | | header files and into the cpp files. These files will require more touches as the header files actually use DEBUG(). Eventually, I'll have to introduce a matched #define and #undef of DEBUG_TYPE for the header files, but that comes as step N of many to clean all of this up. llvm-svn: 206777
* [msan] Enable out-of-line instrumentation for large functions by default.Evgeniy Stepanov2014-04-211-1/+1
| | | | llvm-svn: 206759
* [asan] add a run-time flag detect_container_overflow=true/falseKostya Serebryany2014-04-211-1/+1
| | | | llvm-svn: 206756
* [asan] instead of inserting inline instrumentation around ↵Kostya Serebryany2014-04-211-29/+33
| | | | | | memset/memcpy/memmove, replace the intrinsic with __asan_memset/etc. This makes the memset/etc handling more complete and consistent with what we do in msan. It may slowdown some cases (when the intrinsic was actually inlined) and speedup other cases (when it was not inlined) llvm-svn: 206746
* [asan] temporary disable generating __asan_loadN/__asan_storeNKostya Serebryany2014-04-211-11/+6
| | | | llvm-svn: 206741
* [asan] insert __asan_loadN/__asan_storeN as out-lined asan checks, llvm partKostya Serebryany2014-04-211-3/+15
| | | | llvm-svn: 206734
* Remove some empty statementsAlp Toker2014-04-191-1/+1
| | | | | | Cleanup only. llvm-svn: 206710
* Check whether functions have any lines associated before emitting coverage ↵Nick Lewycky2014-04-181-0/+17
| | | | | | info for them. This isn't just a size/time saving, gcov may crash on these. llvm-svn: 206671
* [msan] Add -msan-instrumentation-with-call-threshold.Evgeniy Stepanov2014-04-181-42/+110
| | | | | | | | | This flag replaces inline instrumentation for checks and origin stores with calls into MSan runtime library. This is a workaround for PR17409. Disabled by default. llvm-svn: 206585
* [asan] one more workaround for PR17409: don't do BB-level coverage ↵Kostya Serebryany2014-04-181-1/+6
| | | | | | instrumentation if there are more than N (=1500) basic blocks. This makes ASanCoverage work on libjpeg_turbo/jchuff.c used by Chrome, which has 1824 BBs llvm-svn: 206564
* PMBuilder: Expose an option to disable tail callsDuncan P. N. Exon Smith2014-04-181-1/+3
| | | | | | | | Adds API to allow frontends to disable tail calls in PassManagerBuilder. <rdar://problem/16050591> llvm-svn: 206542
* Fix bug 19437 - Only add discriminators for DWARF 4 and above.Diego Novillo2014-04-171-2/+7
| | | | | | | | | | | | | | Summary: This prevents the discriminator generation pass from triggering if the DWARF version being used in the module is prior to 4. Reviewers: echristo, dblaikie CC: llvm-commits Differential Revision: http://reviews.llvm.org/D3413 llvm-svn: 206507
* remove some dead codeNuno Lopes2014-04-173-29/+0
| | | | | | | | | | | | | | | lib/Analysis/IPA/InlineCost.cpp | 18 ------------------ lib/Analysis/RegionPass.cpp | 1 - lib/Analysis/TypeBasedAliasAnalysis.cpp | 1 - lib/Transforms/Scalar/LoopUnswitch.cpp | 21 --------------------- lib/Transforms/Utils/LCSSA.cpp | 2 -- lib/Transforms/Utils/LoopSimplify.cpp | 6 ------ utils/TableGen/AsmWriterEmitter.cpp | 13 ------------- utils/TableGen/DFAPacketizerEmitter.cpp | 7 ------- utils/TableGen/IntrinsicEmitter.cpp | 2 -- 9 files changed, 71 deletions(-) llvm-svn: 206506
* Inliner::OptimizationRemark: Fix crash in ↵NAKAMURA Takumi2014-04-171-1/+4
| | | | | | | | clang/test/Frontend/optimization-remark.c on some hosts, including --vg. DebugLoc in Callsite would not live after Inliner. It should be copied before Inliner. llvm-svn: 206459
* [asan] add two new hidden compile-time flags for asan: ↵Kostya Serebryany2014-04-161-27/+56
| | | | | | asan-instrumentation-with-call-threshold and asan-memory-access-callback-prefix. This is part of the workaround for PR17409 (instrument huge functions with callbacks instead of inlined code). These flags will also help us experiment with kasan (kernel-asan) and clang llvm-svn: 206383
* Add lifetime markers for allocas created to hold byval arguments, make themJulien Lerouge2014-04-151-0/+1
| | | | | | appear in the InlineFunctionInfo. llvm-svn: 206308
* Split byval argument initialization so the memcpy(s) are injected at theJulien Lerouge2014-04-151-29/+42
| | | | | | beginning of the first new block after inlining. llvm-svn: 206307
* LTO: Add more loop simplification passes to LTODuncan P. N. Exon Smith2014-04-151-1/+3
| | | | | | | | | Similar to r202051, add missing loop simplification passes to the LTO optimization pipeline. Patch by Rafael Espindola. llvm-svn: 206306
* verify-di: Implement DebugInfoVerifierDuncan P. N. Exon Smith2014-04-151-0/+1
| | | | | | | | | | | | | | | | | | | | | Implement DebugInfoVerifier, which steals verification relying on DebugInfoFinder from Verifier. - Adds LegacyDebugInfoVerifierPassPass, a ModulePass which wraps DebugInfoVerifier. Uses -verify-di command-line flag. - Change verifyModule() to invoke DebugInfoVerifier as well as Verifier. - Add a call to createDebugInfoVerifierPass() wherever there was a call to createVerifierPass(). This implementation as a module pass should sidestep efficiency issues, allowing us to turn debug info verification back on. <rdar://problem/15500563> llvm-svn: 206300
* D3348 - [BUG] "Rotate Loop" pass kills "llvm.vectorizer.enable" metadataAlexey Bataev2014-04-152-6/+23
| | | | llvm-svn: 206266
* Revert "Revert r206045, "Fix shift by constants for vector.""Matt Arsenault2014-04-142-16/+34
| | | | | | Fix cases where the Value itself is used, and not the constant value. llvm-svn: 206214
* Whitespace.NAKAMURA Takumi2014-04-141-1/+0
| | | | llvm-svn: 206154
* Revert r206045, "Fix shift by constants for vector."NAKAMURA Takumi2014-04-142-23/+13
| | | | | | It broke some builders, at least, i686. llvm-svn: 206153
* Use APInt arithmetic, fixed typo. Thanks to Benjamin Kramer for noticing that.Serge Pavlov2014-04-141-2/+2
| | | | llvm-svn: 206144
* Recognize test for overflow in integer multiplication.Serge Pavlov2014-04-131-0/+240
| | | | | | | | | | | | | | | | | | If multiplication involves zero-extended arguments and the result is compared as in the patterns: %mul32 = trunc i64 %mul64 to i32 %zext = zext i32 %mul32 to i64 %overflow = icmp ne i64 %mul64, %zext or %overflow = icmp ugt i64 %mul64 , 0xffffffff then the multiplication may be replaced by call to umul.with.overflow. This change fixes PR4917 and PR4918. Differential Revision: http://llvm-reviews.chandlerc.com/D2814 llvm-svn: 206137
* Fix shift by constants for vector.Matt Arsenault2014-04-112-13/+23
| | | | | | ashr <N x iM>, <N x iM> M -> undef llvm-svn: 206045
* Implement depth_first and inverse_depth_first range factory functions.David Blaikie2014-04-115-21/+13
| | | | | | | | | | | | | | Also updated as many loops as I could find using df_begin/idf_begin - strangely I found no uses of idf_begin. Is that just used out of tree? Also a few places couldn't use df_begin because either they used the member functions of the depth first iterators or had specific ordering constraints (I added a comment in the latter case). Based on a patch by Jim Grosbach. (Jim - you just had iterator_range<T> where you needed iterator_range<idf_iterator<T>>) llvm-svn: 206016
* Reapply "SLPVectorizer: Ignore users that are insertelements we can ↵Arnold Schwaighofer2014-04-101-30/+65
| | | | | | | | | reschedule them" This commit reapplies 205018. After 205855 we should correctly vectorize intrinsics. llvm-svn: 205965
* Fix some doc and comment typosAlp Toker2014-04-091-1/+1
| | | | llvm-svn: 205899
* SLPVectorizer: Only vectorize intrinsics whose operands are widened equallyArnold Schwaighofer2014-04-092-26/+10
| | | | | | | | | The vectorizer only knows how to vectorize intrinics by widening all operands by the same factor. Patch by Tyler Nowicki! llvm-svn: 205855
* Add support for optimization reports.Diego Novillo2014-04-081-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds backend support for -Rpass=, which indicates the name of the optimization pass that should emit remarks stating when it made a transformation to the code. Pass names are taken from their DEBUG_NAME definitions. When emitting an optimization report diagnostic, the lack of debug information causes the diagnostic to use "<unknown>:0:0" as the location string. This is the back end counterpart for http://llvm-reviews.chandlerc.com/D3226 Reviewers: qcolombet CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3227 llvm-svn: 205774
* Add NDEBUG markers around debug only function.Eric Christopher2014-04-071-0/+4
| | | | llvm-svn: 205706
* Add debug location information to the vectorizer debug statements.Eric Christopher2014-04-071-5/+29
| | | | | | Patch by Zinovy Nis. llvm-svn: 205705
* Fixing typo.David Blaikie2014-04-051-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D3154 llvm-svn: 205674
* Fix PR19270 - type mismatch caused by invalid optimization.Eli Bendersky2014-04-031-3/+27
| | | | | | Patch by Jingyue Wu. llvm-svn: 205547
* Revert "[Constant Hoisting] Lazily compute the idom and cache the result."Juergen Ributzka2014-04-031-43/+4
| | | | | | | This code is no longer usefull, because we only compute and use the IDom once. There is no benefit in caching it anymore. llvm-svn: 205498
* Revert "Reapply "LTO: add API to set strategy for -internalize""Duncan P. N. Exon Smith2014-04-021-26/+12
| | | | | | | | | | | This reverts commit r199244. Conflicts: include/llvm-c/lto.h include/llvm/LTO/LTOCodeGenerator.h lib/LTO/LTOCodeGenerator.cpp llvm-svn: 205471
* SLPVectorizer: compare entire intrinsic for SLP compatibility.Tim Northover2014-04-021-2/+2
| | | | | | | | | Some Intrinsics are overloaded to the extent that return type equality (all that's been checked up to now) does not guarantee that the arguments are the same. In these cases SLP vectorizer should not recurse into the operands, which can be achieved by comparing them as "Function *" rather than simply the ID. llvm-svn: 205424
OpenPOWER on IntegriCloud