summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Second part of pr16069Rafael Espindola2013-06-041-4/+9
| | | | | | | | | | | | | | | | | The problem this time seems to be a thinko. We were assuming that in the CFG A | \ | B | / C speculating the basic block B would cause only the phi value for the B->C edge to be speculated. That is not true, the phi's are semantically in the edges, so if the A->B->C path is taken, any code needed for A->C is not executed and we have to consider it too when deciding to speculate B. llvm-svn: 183226
* Typo: s/caes/cases/ in SimplifyCFGHans Wennborg2013-06-041-1/+1
| | | | llvm-svn: 183219
* Delete dead safety check.Nick Lewycky2013-06-031-6/+1
| | | | llvm-svn: 183167
* SimplifyCFG: Do not transform PHI to select if doing so would be unsafeDavid Majnemer2013-06-031-2/+19
| | | | | | | | | | | | | PR16069 is an interesting case where an incoming value to a PHI is a trap value while also being a 'ConstantExpr'. We do not consider this case when performing the 'HoistThenElseCodeToIf' optimization. Instead, make our modifications more conservative if we detect that we cannot transform the PHI to a select. llvm-svn: 183152
* SimplifyCFG: Small cleanup, use ICmpInst::isEquality()David Majnemer2013-06-031-3/+1
| | | | llvm-svn: 183151
* [asan] ASan Linux MIPS32 support (llvm part), patch by Jyun-Yan YKostya Serebryany2013-06-031-1/+10
| | | | llvm-svn: 183104
* When determining the new index for an insertelement, we may not assume that anNick Lewycky2013-06-011-7/+9
| | | | | | | | | | index greater than the size of the vector is invalid. The shuffle may be shrinking the size of the vector. Fixes a crash! Also drop the maximum recursion depth of the safety check for this optimization to five. llvm-svn: 183080
* SimplifyCFG: Fix typo in comment for ComputeSpeculationCostDavid Majnemer2013-06-011-1/+1
| | | | llvm-svn: 183078
* Move getRealLinkageName to a common place and remove all the duplicates of it.Benjamin Kramer2013-06-011-13/+2
| | | | | | Also simplify code a bit while there. No functionality change. llvm-svn: 183076
* LoopVectorize: Change API call to get the backedge taken countArnold Schwaighofer2013-05-311-3/+3
| | | | | | | | | | Use ScalarEvolution's getBackedgeTakenCount API instead of getExitCount since that is really what we want to know. Using the more specific getExitCount was safe because we made sure that there is only one exiting block. No functionality change. llvm-svn: 183047
* Loop Strength Reduce: Scaling factor cost.Quentin Colombet2013-05-311-3/+43
| | | | | | | | | | | | Account for the cost of scaling factor in Loop Strength Reduce when rating the formulae. This uses a target hook. The default implementation of the hook is: if the addressing mode is legal, the scaling factor is free. <rdar://problem/13806271> llvm-svn: 183045
* LoopVectorize: PHIs with only outside users should prevent vectorizationArnold Schwaighofer2013-05-311-13/+30
| | | | | | | | | | We check that instructions in the loop don't have outside users (except if they are reduction values). Unfortunately, we skipped this check for if-convertable PHIs. Fixes PR16184. llvm-svn: 183035
* Modify how the formulae are rated in Loop Strength Reduce.Quentin Colombet2013-05-311-6/+45
| | | | | | | | | | | | | | Namely, check if the target allows to fold more that one register in the addressing mode and if yes, adjust the cost accordingly. Prior to this commit, reg1 + scale * reg2 accesses were artificially preferred to reg1 + reg2 accesses. Indeed, the cost model wrongly assumed that reg1 + reg2 needs a temporary register for the computation, whereas it was correctly estimated for reg1 + scale * reg2. <rdar://problem/13973908> llvm-svn: 183021
* Simplify multiplications by vectors whose elements are powers of 2.Rafael Espindola2013-05-311-16/+48
| | | | | | Patch by Andrea Di Biagio. llvm-svn: 183005
* [msan] Handle mixed track-origins and keep-going settings (llvm part).Evgeniy Stepanov2013-05-311-4/+6
| | | | | | | | | | | | | Before this change, each module defined a weak_odr global __msan_track_origins with a value of 1 if origin tracking is enabled, 0 if disabled. If there are modules with different values, any of them may win. If 0 wins, and there is at least one module with 1, the program will most likely crash. With this change, __msan_track_origins is only emitted if origin tracking is on. Then runtime library detects if there is at least one module with origin tracking, and enables runtime support for it. llvm-svn: 182997
* Reapply with r182909 with a fix to the calculation of the new indices forNick Lewycky2013-05-312-2/+257
| | | | | | insertelement instructions. llvm-svn: 182976
* Revert r182909.Evgeniy Stepanov2013-05-302-246/+0
| | | | | | PR/16177 llvm-svn: 182919
* Swizzle vector inputs if it helps us eliminate shuffles.Nick Lewycky2013-05-302-0/+246
| | | | llvm-svn: 182909
* LoopVectorize.cpp: Fix abuse of StringRef on Twine. Twine captures the ↵NAKAMURA Takumi2013-05-291-2/+1
| | | | | | pointer of StringRef. llvm-svn: 182820
* Whitespace.NAKAMURA Takumi2013-05-291-4/+4
| | | | llvm-svn: 182819
* Add support for llvm.vectorizer metadataPaul Redmond2013-05-281-20/+139
| | | | | | | | | | | | | | | | | | | - llvm.loop.parallel metadata has been renamed to llvm.loop to be more generic by making the root of additional loop metadata. - Loop::isAnnotatedParallel now looks for llvm.loop and associated llvm.mem.parallel_loop_access - document llvm.loop and update llvm.mem.parallel_loop_access - add support for llvm.vectorizer.width and llvm.vectorizer.unroll - document llvm.vectorizer.* metadata - add utility class LoopVectorizerHints for getting/setting loop metadata - use llvm.vectorizer.width=1 to indicate already vectorized instead of already_vectorized - update existing tests that used llvm.loop.parallel and llvm.vectorizer.already_vectorized Reviewed by: Nadav Rotem llvm-svn: 182802
* Extend RemapInstruction and friends to take an optional new parameter, a ↵James Molloy2013-05-282-12/+22
| | | | | | | | ValueMaterializer. Extend LinkModules to pass a ValueMaterializer to RemapInstruction and friends to lazily create Functions for lazily linked globals. This is a big win when linking small modules with large (mostly unused) library modules. llvm-svn: 182776
* [msan] Fix argument shadow alignment.Evgeniy Stepanov2013-05-281-4/+11
| | | | llvm-svn: 182771
* Replace Count{Leading,Trailing}Zeros_{32,64} with count{Leading,Trailing}Zeros.Michael J. Spencer2013-05-244-4/+4
| | | | llvm-svn: 182680
* [objc-arc] KnownSafe does not imply that it is safe to perform code motion ↵Michael Gottesman2013-05-241-8/+40
| | | | | | | | across CFG edges since even if it is safe to remove RR pairs, we may still be able to move a retain/release into a loop. rdar://13949644 llvm-svn: 182670
* [objc-arc] Make sure that multiple owners is propogated correctly through ↵Michael Gottesman2013-05-241-17/+16
| | | | | | | | the pass via the usage of a global data structure. rdar://13750319 llvm-svn: 182669
* LoopVectorize: LoopSimplify can't canonicalize loops with an indirectbr in ↵Benjamin Kramer2013-05-241-1/+4
| | | | | | | | it, don't assert on those cases. Fixes PR16139. llvm-svn: 182656
* Run clang-format over the scalarizePHI function.Joey Gouly2013-05-241-12/+8
| | | | llvm-svn: 182640
* scalarizePHI needs to insert the next ExtractElement in the same blockJoey Gouly2013-05-241-2/+4
| | | | | | | | as the BinaryOperator, *not* in the block where the IRBuilder is currently inserting into. Fixes a bug where scalarizePHI would create instructions that would not dominate all uses. llvm-svn: 182639
* Re-implement DebugIR in a way that does not subclass AssemblyWriter:Daniel Malea2013-05-231-102/+166
| | | | | | | | | | | - move AsmWriter.h from public headers into lib - marked all AssemblyWriter functions as non-virtual; no need to override them - DebugIR now "plugs into" AssemblyWriter with an AssemblyAnnotationWriter helper - exposed flags to control hiding of a) debug metadata b) debug intrinsic calls C/R: Paul Redmond llvm-svn: 182617
* More symbols that should be static.Benjamin Kramer2013-05-231-2/+2
| | | | llvm-svn: 182590
* [objc-arc] Fixed number of prefixing slashes in some comments in a function ↵Michael Gottesman2013-05-231-6/+6
| | | | | | from 3 to 2 to match the rest of ObjCARCOpts. llvm-svn: 182557
* SLPVectorizer: Change the order in which new instructions are added to the ↵Nadav Rotem2013-05-223-57/+132
| | | | | | | | | | | | function. We are not working on a DAG and I ran into a number of problems when I enabled the vectorizations of 'diamond-trees' (trees that share leafs). * Imroved the numbering API. * Changed the placement of new instructions to the last root. * Fixed a bug with external tree users with non-zero lane. * Fixed a bug in the placement of in-tree users. llvm-svn: 182508
* This is an update to a previous commit (r181216).Jean-Luc Duprat2013-05-222-29/+43
| | | | | | | | | | | | | | | | | | | | | | | The earlier change list introduced the following inst combines: B * (uitofp i1 C) —> select C, B, 0 A * (1 - uitofp i1 C) —> select C, 0, A select C, 0, B + select C, A, 0 —> select C, A, B Together these 3 changes would simplify : A * (1 - uitofp i1 C) + B * uitofp i1 C down to : select C, B, A In practice we found that the first two substitutions can have a negative effect on performance, because they reduce opportunities to use FMA contractions; between the two options FMAs are often the better choice. This change list amends the previous one to enable just these inst combines: select C, B, 0 + select C, 0, A —> select C, B, A A * (1 - uitofp i1 C) + B * uitofp i1 C —> select C, B, A llvm-svn: 182499
* LoopVectorize: Make Value pointers that could be RAUW'ed a VHArnold Schwaighofer2013-05-221-3/+4
| | | | | | | | | | The Value pointers we store in the induction variable list can be RAUW'ed by a call to SCEVExpander::expandCodeFor, use a TrackingVH instead. Do the same thing in some other places where we store pointers that could potentially be RAUW'ed. Fixes PR16073. llvm-svn: 182485
* [msan] A no-op implementation of VarArg handling.Evgeniy Stepanov2013-05-211-2/+23
| | | | | | | This stuff is used on platforms where MSan does not have a proper VarArg implementation (anything other than x86_64 at the moment). llvm-svn: 182375
* Remove unused #include.Bill Wendling2013-05-201-1/+0
| | | | llvm-svn: 182315
* Rename LoopSimplify.h to LoopUtils.hHal Finkel2013-05-201-1/+1
| | | | | | As discussed, LoopUtils.h is a better name. llvm-svn: 182314
* Expose InsertPreheaderForLoop from LoopSimplify to other passesHal Finkel2013-05-201-11/+12
| | | | | | | | | | | Other passes, PPC counter-loop formation for example, also need to add loop preheaders outside of the regular loop simplification pass. This makes InsertPreheaderForLoop a global function so that it can be used by other passes. No functionality change intended. llvm-svn: 182299
* LoopVectorize: Handle single edge PHIsArnold Schwaighofer2013-05-181-4/+4
| | | | | | | | We might encouter single edge PHIs - handle them with an identity select. Fixes PR15990. llvm-svn: 182199
* Add missing -*- C++ -*- to headersMatt Arsenault2013-05-171-1/+1
| | | | llvm-svn: 182164
* LoopVectorize: Simplify code. No functionality change.Benjamin Kramer2013-05-171-21/+5
| | | | llvm-svn: 182100
* [msan] Switch TLS globals to initial-exec model.Evgeniy Stepanov2013-05-161-7/+7
| | | | | | They are always defined in the main executable. llvm-svn: 181994
* LoopVectorize: Move call of canHoistAllLoads to canVectorizeWithIfConvertArnold Schwaighofer2013-05-151-4/+4
| | | | | | | | | We only want to check this once, not for every conditional block in the loop. No functionality change (except that we don't perform a check redudantly anymore). llvm-svn: 181942
* [objc-arc] Fixed a spelling error and made the statistic descriptions be ↵Michael Gottesman2013-05-151-5/+5
| | | | | | consistent about their usage of periods. llvm-svn: 181901
* LoopVectorize: Fix commentsArnold Schwaighofer2013-05-151-4/+4
| | | | | | No functionality change. llvm-svn: 181862
* LoopVectorize: Hoist conditional loads if possibleArnold Schwaighofer2013-05-151-3/+102
| | | | | | | | | | | | InstCombine can be uncooperative to vectorization and sink loads into conditional blocks. This prevents vectorization. Undo this optimization if there are unconditional memory accesses to the same addresses in the loop. radar://13815763 llvm-svn: 181860
* Fix two typoSylvestre Ledru2013-05-141-1/+1
| | | | llvm-svn: 181848
* GlobalOpt: fix an issue where CXAAtExitFn points to a deleted function.Manman Ren2013-05-141-3/+3
| | | | | | | | | | | CXAAtExitFn was set outside a loop and before optimizations where functions can be deleted. This patch will set CXAAtExitFn inside the loop and after optimizations. Seg fault when running LTO because of accesses to a deleted function. rdar://problem/13838828 llvm-svn: 181838
* Removed trailing whitespace.Michael Gottesman2013-05-141-4/+4
| | | | llvm-svn: 181760
OpenPOWER on IntegriCloud