summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Modify df_iterator to support post-order actionsDavid Callahan2016-10-051-1/+1
| | | | | | | | | | | | Summary: This makes a change to the state used to maintain visited information for depth first iterator. We know assume a method "completed(...)" which is called after all children of a node have been visited. In all existing cases, this method does nothing so this patch has no functional changes. It will however allow a client to distinguish back from cross edges in a DFS tree. Reviewers: nadav, mehdi_amini, dberlin Subscribers: MatzeB, mzolotukhin, twoh, freik, llvm-commits Differential Revision: https://reviews.llvm.org/D25191 llvm-svn: 283391
* [asan] Reapply: Switch to using dynamic shadow offset on iOSAnna Zaks2016-10-051-2/+3
| | | | | | | | | | The VM layout is not stable between iOS version releases, so switch to dynamic shadow offset. This is the LLVM counterpart of https://reviews.llvm.org/D25218 Differential Revision: https://reviews.llvm.org/D25219 llvm-svn: 283376
* [LV] Pass profitability analysis in vectorizer constructor (NFC)Matthew Simpson2016-10-051-23/+28
| | | | | | | | | The vectorizer already holds a pointer to one cost model artifact in a member variable (i.e., MinBWs). As we add more, it will be easier to communicate these artifacts to the vectorizer if we simply pass a pointer to the cost model instead. llvm-svn: 283373
* [LV] Pass legality analysis in vectorizer constructor (NFC)Matthew Simpson2016-10-051-12/+12
| | | | | | | The vectorizer already holds a pointer to the legality analysis in a member variable, so it makes sense that we would pass it in the constructor. llvm-svn: 283368
* [LV] Remove obsolete comment (NFC)Matthew Simpson2016-10-051-3/+1
| | | | llvm-svn: 283365
* [LV] Use getScalarizationOverhead in memory instruction costs (NFC)Matthew Simpson2016-10-051-14/+10
| | | | | | | | | This patch refactors the cost estimation of scalarized loads and stores to reuse getScalarizationOverhead for the cost of the extractelement and insertelement instructions we might create. The existing code accounted for this cost, but it was functionally equivalent to the helper function. llvm-svn: 283364
* [LV] Add helper function for predicated block probability (NFC)Matthew Simpson2016-10-051-13/+25
| | | | | | | | | | | | The cost model has to estimate the probability of executing predicated blocks. However, we currently always assume predicated blocks have a 50% chance of executing (this value is hardcoded in several places throughout the code). Since we always use the same value, this patch adds a helper function for getting this uniform probability. The function simplifies some comments and makes our assumptions more clear. In the future, we may want to extend this with actual block probability information if it's available. llvm-svn: 283354
* [LV] Add isScalarWithPredication helper function (NFC)Matthew Simpson2016-10-051-11/+23
| | | | | | | | | This patch adds a single helper function for checking if an instruction will be scalarized with predication. Such instructions include conditional stores and instructions that may divide by zero. Existing checks have been updated to use the new function. llvm-svn: 283350
* Revert "[asan] LLVM: Switch to using dynamic shadow offset on iOS"Anna Zaks2016-10-051-3/+2
| | | | | | | | This reverts commit abe77a118615cd90b0d7f127e4797096afa2b394. Revert as these changes broke a Chromium buildbot. llvm-svn: 283348
* Use StringRef in ARCRuntimeEntryPoints APIs (NFC)Mehdi Amini2016-10-051-6/+3
| | | | llvm-svn: 283288
* [LoopDistribute] Fix a typo in the pass name.Michael Zolotukhin2016-10-051-1/+1
| | | | llvm-svn: 283282
* [asan] LLVM: Switch to using dynamic shadow offset on iOSAnna Zaks2016-10-041-2/+3
| | | | | | | | | | The VM layout is not stable between iOS version releases, so switch to dynamic shadow offset. This is the LLVM counterpart of https://reviews.llvm.org/D25218 Differential Revision: https://reviews.llvm.org/D25219 llvm-svn: 283239
* [RS4GC] Handle ShuffleVector instruction in findBasePointerAnna Thomas2016-10-041-10/+32
| | | | | | | | | | | | | | | Summary: This patch modifies the findBasePointer to handle the shufflevector instruction. Tests run: RS4GC tests, local downstream tests. Reviewers: reames, sanjoy Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25197 llvm-svn: 283219
* [PruneEH] Be correct in the face IPOSanjoy Das2016-10-031-4/+1
| | | | | | | This fixes one spot I had missed in r265762. Credit goes to Philip Reames for spotting this one! llvm-svn: 283137
* Refactor LICM pass in preparation for LoopSink pass.Dehao Chen2016-10-031-8/+17
| | | | | | | | | | | | Summary: LoopSink pass uses some common function in LICM. This patch refactor the LICM code to make it usable by LoopSink pass (https://reviews.llvm.org/D22778). Reviewers: davidxl, danielcdh, hfinkel, chandlerc Subscribers: hfinkel, llvm-commits Differential Revision: https://reviews.llvm.org/D24168 llvm-svn: 283134
* Jump threading: avoid trying to split edge into landingpad block (PR27840)Hans Wennborg2016-10-031-0/+4
| | | | | | | | | Splitting the edge is nontrivial because of the landing pad, and we would currently assert trying to do it. Differential Revision: https://reviews.llvm.org/D24680 llvm-svn: 283129
* Add new target hooks for LoadStoreVectorizerVolkan Keles2016-10-031-42/+39
| | | | | | | | | | | | Summary: Added 6 new target hooks for the vectorizer in order to filter types, handle size constraints and decide how to split chains. Reviewers: tstellarAMD, arsenm Subscribers: arsenm, mzolotukhin, wdng, llvm-commits, nhaehnle Differential Revision: https://reviews.llvm.org/D24727 llvm-svn: 283099
* Remove duplicated code; NFCSanjoy Das2016-10-021-1/+2
| | | | | | | ICmpInst::makeConstantRange does exactly the same thing as ConstantRange::makeExactICmpRegion. llvm-svn: 283059
* Use StringRef in Pass/PassManager APIs (NFC)Mehdi Amini2016-10-0119-34/+24
| | | | llvm-svn: 283004
* [ASAN] Add the binder globals on Darwin to llvm.compiler.used to avoid LTO ↵Mehdi Amini2016-10-011-2/+34
| | | | | | | | | | | | | | | | dead-stripping The binder is in a specific section that "reverse" the edges in a regular dead-stripping: the binder is live as long as a global it references is live. This is a big hammer that prevents LLVM from dead-stripping these, while still allowing linker dead-stripping (with special knowledge of the section). Differential Revision: https://reviews.llvm.org/D24673 llvm-svn: 282988
* [InstCombine] allow non-splat folds of select cond (ext X), CSanjay Patel2016-09-302-40/+34
| | | | llvm-svn: 282906
* [Coroutines] Part15c: Fix coro-split to correctly handle definitions between ↵Gor Nishanov2016-09-301-22/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | coro.save and coro.suspend Summary: In the case below, %Result.i19 is defined between coro.save and coro.suspend and used after coro.suspend. We need to correctly place such a value into the coroutine frame. ``` %save = call token @llvm.coro.save(i8* null) %Result.i19 = getelementptr inbounds %"struct.lean_future<int>::Awaiter", %"struct.lean_future<int>::Awaiter"* %ref.tmp7, i64 0, i32 0 %suspend = call i8 @llvm.coro.suspend(token %save, i1 false) switch i8 %suspend, label %exit [ i8 0, label %await.ready i8 1, label %exit ] await.ready: %val = load i32, i32* %Result.i19 ``` Reviewers: majnemer Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D24418 llvm-svn: 282902
* [Coroutines] Part15b: Fix dbg information handling in coro-split.Gor Nishanov2016-09-302-6/+13
| | | | | | | | | | | | | | | Summary: Without the fix, if there was a function inlined into the coroutine with debug information, CloneFunctionInto(NewF, &F, VMap, /*ModuleLevelChanges=*/true, Returns); would duplicate all of the debug information including the DICompileUnit. We know use VMap to indicate that debug metadata for a File, Unit and FunctionType should not be duplicated when we creating clones that will become f.resume, f.destroy and f.cleanup. Reviewers: majnemer Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D24417 llvm-svn: 282899
* [Coroutines] Part 15a: Lower coro.subfn.addr in CoroCleanupGor Nishanov2016-09-302-3/+26
| | | | | | | | | | | | Summary: Not all coro.subfn.addr intrinsics can be eliminated in CoroElide through devirtualization. Those that remain need to be lowered in CoroCleanup. Reviewers: majnemer Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D24412 llvm-svn: 282897
* Update loop unroller cost model to make sure debug info does not affect ↵Dehao Chen2016-09-301-0/+3
| | | | | | | | | | | | | | optimization decisions. Summary: Debug info should *not* affect optimization decisions. This patch updates loop unroller cost model to make it not affected by debug info. Reviewers: davidxl, mzolotukhin Subscribers: haicheng, llvm-commits, mzolotukhin Differential Revision: https://reviews.llvm.org/D25098 llvm-svn: 282894
* [asan] Support dynamic shadow address instrumentationEtienne Bergeron2016-09-301-7/+50
| | | | | | | | | | | | | | | | | | | Summary: This patch is adding the support for a shadow memory with dynamically allocated address range. The compiler-rt needs to export a symbol containing the shadow memory range. This is required to support ASAN on windows 64-bits. Reviewers: kcc, rnk, vitalybuka Subscribers: zaks.anna, kubabrecka, dberris, llvm-commits, chrisha Differential Revision: https://reviews.llvm.org/D23354 llvm-svn: 282881
* CVP. Turn marking adds as no wrap on by default (was turned off by 279082)Artur Pilipenko2016-09-301-1/+1
| | | | | | With 282650 in tree extra no wrap on adds doesn't cause regressions anymore. Reenable the optimzation. llvm-svn: 282872
* [LV] Build all scalar steps for non-uniform induction variablesMatthew Simpson2016-09-301-14/+3
| | | | | | | | | | | | | | | | When building the steps for scalar induction variables, we previously attempted to determine if all the scalar users of the induction variable were uniform. If they were, we would only emit the step corresponding to vector lane zero. This optimization was too aggressive. We generally don't know the entire set of induction variable users that will be scalar. We have isScalarAfterVectorization, but this is only a conservative estimate of the instructions that will be scalarized. Thus, an induction variable may have scalar users that aren't already known to be scalar. To avoid emitting unused steps, we can only check that the induction variable is uniform. This should fix PR30542. Reference: https://llvm.org/bugs/show_bug.cgi?id=30542 llvm-svn: 282863
* [LDist] Port to new streaming API for opt remarksAdam Nemet2016-09-301-17/+26
| | | | llvm-svn: 282838
* [LoopUnroll] Port to the new streaming interface for opt remarks.Adam Nemet2016-09-302-31/+41
| | | | llvm-svn: 282834
* [thinlto] Don't decay threshold for hot callsitesPiotr Padlewski2016-09-301-5/+22
| | | | | | | | | | | | | | Summary: We don't want to decay hot callsites to import chains of hot callsites. The same mechanism is used in LIPO. Reviewers: tejohnson, eraman, mehdi_amini Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D24976 llvm-svn: 282833
* [LoopDataPrefetch] Port to new streaming API for opt remarksAdam Nemet2016-09-301-1/+2
| | | | llvm-svn: 282826
* [LV] Port the remarks in processLoop to the new streaming APIAdam Nemet2016-09-301-22/+39
| | | | | | This completes LV. llvm-svn: 282821
* [LV] Port the last opt remark in Hints to the new streaming interfaceAdam Nemet2016-09-301-5/+6
| | | | llvm-svn: 282820
* [LAA, LV] Port to new streaming interface for opt remarks. Update LVAdam Nemet2016-09-301-3/+6
| | | | | | | | | | | | | | (Recommit after making sure IsVerbose gets properly initialized in DiagnosticInfoOptimizationBase. See previous commit that takes care of this.) OptimizationRemarkAnalysis directly takes the role of the report that is generated by LAA. Then we need the magic to be able to turn an LAA remark into an LV remark. This is done via a new OptimizationRemark ctor. llvm-svn: 282813
* [InstCombine] fix function names; NFCSanjay Patel2016-09-292-44/+48
| | | | | | | | Also, make foldSelectExtConst() a member of InstCombiner, remove unnecessary parameters from its interface, and group visitSelectInst helpers together in the header file. llvm-svn: 282796
* Revert "[LAA, LV] Port to new streaming interface for opt remarks. Update LV"Adam Nemet2016-09-291-6/+3
| | | | | | | | This reverts commit r282758. There are some clang failures I haven't seen. llvm-svn: 282759
* [LAA, LV] Port to new streaming interface for opt remarks. Update LVAdam Nemet2016-09-291-3/+6
| | | | | | | | | | OptimizationRemarkAnalysis directly takes the role of the report that is generated by LAA. Then we need the magic to be able to turn an LAA remark into an LV remark. This is done via a new OptimizationRemark ctor. llvm-svn: 282758
* [LV] Port OptimizationRemarkAnalysisFPCommute andAdam Nemet2016-09-291-10/+12
| | | | | | OptimizationRemarkAnalysisAliasing to new streaming API for opt remarks llvm-svn: 282742
* [LV] Convert processLoop to new streaming API for opt remarksAdam Nemet2016-09-291-10/+10
| | | | llvm-svn: 282740
* fix formatting; NFCSanjay Patel2016-09-291-11/+9
| | | | llvm-svn: 282737
* [sanitizer-coverage/libFuzzer] make the guards for trace-pc 32-bit; create ↵Kostya Serebryany2016-09-291-64/+91
| | | | | | one array of guards per function, instead of one guard per BB. reorganize the code so that trace-pc-guard does not create unneeded globals llvm-svn: 282735
* [thinlto] Add cold-callsite import heuristicPiotr Padlewski2016-09-291-6/+16
| | | | | | | | | | | | | | Summary: Not tunned up heuristic, but with this small heuristic there is about +0.10% improvement on SPEC 2006 Reviewers: tejohnson, mehdi_amini, eraman Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D24940 llvm-svn: 282733
* [LV] Move static createMissedAnalysis from anonymous to global namespaceAdam Nemet2016-09-291-26/+26
| | | | | | This is an attempt to fix a windows bot. llvm-svn: 282730
* [LV] Convert CostModel to use the new streaming opt remark APIAdam Nemet2016-09-291-21/+20
| | | | | | Here we can already remove the member function emitAnalysis. llvm-svn: 282729
* [LV] Split most of createMissedAnalysis into a static function. NFCAdam Nemet2016-09-291-15/+28
| | | | | | This will be shared between Legality and CostModel. llvm-svn: 282728
* [LV] Convert all but one opt remark in Legality to new streaming interfaceAdam Nemet2016-09-291-46/+72
| | | | | | | | The last one remaining after which emitAnalysis can be removed is when we convert the LAA's report to a vectorization report. This requires converting LAA to the new interface first. llvm-svn: 282726
* [LV] Convert emitRemark to new opt remark streaming interfaceAdam Nemet2016-09-291-14/+17
| | | | | | | Also renamed the function to emitRemarkWithHints to better reflect what the function actually does. llvm-svn: 282723
* Test commit. NFC.Volkan Keles2016-09-291-1/+1
| | | | llvm-svn: 282717
* Wisely choose sext or zext when widening IV.Evgeny Stupachenko2016-09-281-37/+88
| | | | | | | | | | | | Summary: The patch fixes regression caused by two earlier patches D18777 and D18867. Reviewers: reames, sanjoy Differential Revision: http://reviews.llvm.org/D24280 From: Li Huang llvm-svn: 282650
OpenPOWER on IntegriCloud