summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* [TTI] Expose TTI::getGEPCost and use it in SLSR and NaryReassociate.Jingyue Wu2016-07-082-76/+14
| | | | | | NFC. llvm-svn: 274940
* Add 'thinlto_src_module' md with asserts or -enable-import-metadataPiotr Padlewski2016-07-081-6/+19
| | | | | | | | | | | | | | Summary: This way the metadata will be only generated when asserts enabled, or when -enable-import-metadata specified Reviewers: tejohnson, eraman, mehdi_amini Subscribers: mehdi_amini, llvm-commits Differential Revision: http://reviews.llvm.org/D22167 llvm-svn: 274938
* [InstCombine] don't form select from bitcasted logic ops if bitcasts have >1 useSanjay Patel2016-07-081-2/+2
| | | | | | | | | | | | | | | This isn't a sure thing (are 2 extra bitcasts less expensive than a logic op?), but we'll try to err on the conservative side by going with the case that has less IR instructions. Note: This question came up in http://reviews.llvm.org/D22114 , but this part is independent of that patch proposal, so I'm making this small change ahead of that one. See also: http://reviews.llvm.org/rL274926 llvm-svn: 274932
* Rename LoopAccessAnalysis to LoopAccessLegacyAnalysis /NFCXinliang David Li2016-07-086-21/+21
| | | | llvm-svn: 274927
* [InstCombine] don't form select from logic ops if it's unlikely that we'll ↵Sanjay Patel2016-07-081-17/+22
| | | | | | eliminate any ops llvm-svn: 274926
* Remove duplicate inclusion /NFCXinliang David Li2016-07-081-1/+0
| | | | llvm-svn: 274921
* Remove inline hints computation from SampleProfile.cppDehao Chen2016-07-081-70/+0
| | | | | | | | | | | | Summary: As we will move to use uniformed hotness check in inliner, we do not need inline hints in SampleProfile pass any more. Reviewers: dnovillo, davidxl Subscribers: eraman, llvm-commits Differential Revision: http://reviews.llvm.org/D19287 llvm-svn: 274918
* [CrossDSOCFI] Change the pass so that it doesn't require doInitialization()Davide Italiano2016-07-081-19/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D21357 llvm-svn: 274910
* [SCCP] Fold constants as we build them whne visiting cast instructions.Davide Italiano2016-07-081-2/+4
| | | | | | | | | This should be slightly more efficient and could avoid spurious overdefined markings, as Eli pointed out. Differential Revision: http://reviews.llvm.org/D22122 llvm-svn: 274905
* [InstCombine] check for one-use before turning simple logic op into a selectSanjay Patel2016-07-081-2/+2
| | | | llvm-svn: 274891
* [InstCombine] allow or(sext(A), B) --> A ? -1 : B transform for vectorsSanjay Patel2016-07-081-4/+5
| | | | llvm-svn: 274883
* [DSE] Minor refactor based on D21007. NFC.Chad Rosier2016-07-081-39/+50
| | | | llvm-svn: 274877
* InstCombine rule to fold truncs whose value is availableAnna Thomas2016-07-081-1/+23
| | | | | | | | | | | | | We can fold truncs whose operand feeds from a load, if the trunc value is available through a prior load/store. This change is from: http://reviews.llvm.org/D21246, which folded the trunc but missed the bitcast or ptrtoint/inttoptr required in the RAUW call, when the load type didnt match the prior load/store type. Differential Revision: http://reviews.llvm.org/D21791 llvm-svn: 274853
* [tsan] Try harder to not instrument gcov countersVedant Kumar2016-07-071-2/+2
| | | | | | | | GCOVProfiler::emitProfileArcs() can create many variables with names starting with "__llvm_gcov_ctr", so llvm appends a numeric suffix to most of them. Teach tsan about this. llvm-svn: 274801
* [PM] Port InstSimplify to the new pass manager.Davide Italiano2016-07-071-44/+62
| | | | llvm-svn: 274796
* [DSE] Remove dead stores in end blocks containing fenceAnna Thomas2016-07-071-0/+8
| | | | | | | | | | We can remove dead stores in the presence of fence instructions. Fence does not change an otherwise thread local store to visible. reviewers: reames, dexonsmith, jfb Differential Revision: http://reviews.llvm.org/D22001 llvm-svn: 274795
* Add a missing semicolon.Rui Ueyama2016-07-071-1/+1
| | | | llvm-svn: 274794
* Clang-format LoadStoreVectorizerAlina Sbirlea2016-07-071-35/+33
| | | | | | | | | | Reviewers: llvm-commits, jlebar, arsenm Subscribers: mzolotukhin Differential Revision: http://reviews.llvm.org/D22107 llvm-svn: 274792
* [LoopStrengthReduce] Fix -Wmisleading-indentation. Reported by GCC6.Davide Italiano2016-07-071-2/+2
| | | | llvm-svn: 274773
* save type in local var; NFCISanjay Patel2016-07-071-10/+11
| | | | llvm-svn: 274760
* Addressing post-commit comments for not rewriting fputs:Sjoerd Meijer2016-07-071-2/+5
| | | | | | moved the optimise for size check inside function optimizeFPuts. llvm-svn: 274758
* Code size optimisation: don't rewrite fputs to fwrite when optimising for sizeSjoerd Meijer2016-07-071-0/+2
| | | | | | because fwrite requires more arguments and thus extra MOVs are required. llvm-svn: 274753
* Fixed a bug in vectorizing GEP before gather/scatter intrinsic.Elena Demikhovsky2016-07-071-8/+11
| | | | | | | | | | Vectorizing GEP was incorrect and broke SSA in some cases. The patch fixes PR27997 https://llvm.org/bugs/show_bug.cgi?id=27997. Differential revision: http://reviews.llvm.org/D22035 llvm-svn: 274735
* [esan:cfrag] Add option -esan-aux-field-infoQin Zhao2016-07-071-44/+66
| | | | | | | | | | | | | | | | | | | Summary: Adds option -esan-aux-field-info to control generating binary with auxiliary struct field information. Extracts code for creating auxiliary information from createCacheFragInfoGV into createCacheFragAuxGV. Adds test struct_field_small.ll for -esan-aux-field-info test. Reviewers: aizatsky Subscribers: llvm-commits, bruening, eugenis, kcc, zhaoqin, vitalybuka Differential Revision: http://reviews.llvm.org/D22019 llvm-svn: 274726
* [PM] Port TailCallElimSean Silva2016-07-061-2/+19
| | | | llvm-svn: 274708
* [PM] Port CorrelatedValuePropagationSean Silva2016-07-061-7/+27
| | | | llvm-svn: 274705
* [InstCombine] enhance (select X, C1, C2 --> ext X) to handle vectorsSanjay Patel2016-07-061-22/+28
| | | | | | | | | By replacing dyn_cast of ConstantInt with m_Zero/m_One/m_AllOnes, we allow these transforms for splat vectors. Differential Revision: http://reviews.llvm.org/D21899 llvm-svn: 274696
* [MemorySSA] Reinstate the legacy printer and verifier.Chad Rosier2016-07-062-0/+31
| | | | | | Differential Revision: http://reviews.llvm.org/D22058 llvm-svn: 274679
* [LIR] Fix mis-compilation with unwinding.Haicheng Wu2016-07-061-0/+8
| | | | | | | | To fix PR27859, bail out if there is an instruction may throw. Differential Revision: http://reviews.llvm.org/D20638 llvm-svn: 274673
* [InstCombine] use more specific pattern matchers; NFCISanjay Patel2016-07-061-12/+10
| | | | | | | | Follow-up from r274465: we don't need to capture the value in these cases, so just match the constant that we're looking for. m_One/m_Zero work with vector splats as well as scalars. llvm-svn: 274670
* Add 'thinlto_src_module' metadata to imported functionPiotr Padlewski2016-07-061-0/+6
| | | | | | | | | | | | | | Added metadata to be able to make statistics on how many functions that have been imported have been removed. Also module name might be helpfull when debugging. Reviewers: tejohnson, eraman Subscribers: mehdi_amini, llvm-commits Differential Revision: http://reviews.llvm.org/D21943 llvm-svn: 274668
* [esan|wset] Fix incorrect memory size assertDerek Bruening2016-07-061-2/+2
| | | | | | | | | | | | | | Summary: Fixes an incorrect assert that fails on 128-bit-sized loads or stores. Augments the wset tests to include this case. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits Differential Revision: http://reviews.llvm.org/D22062 llvm-svn: 274666
* [DSE] Avoid iterator invalidation bugs.Chad Rosier2016-07-061-40/+34
| | | | | | | | | | The dse_with_dbg_value.ll test committed with r273141 is removed because this we no longer performs any type of back tracking, which is what was causing the codegen differences with and without debug information. Differential Revision: http://reviews.llvm.org/D21613 llvm-svn: 274660
* Work around PR28400 a bit harder.Sean Silva2016-07-061-2/+5
| | | | | | | | | | We were still crashing in the "no change" case because LVI was not getting invalidated. See the thread "Should analyses be able to hold AssertingVH to IR? (related to PR28400)" for more discussion. llvm-svn: 274656
* NFC changed names in FunctionImportPiotr Padlewski2016-07-061-14/+14
| | | | llvm-svn: 274649
* [LV] Don't widen trivial induction variablesMatthew Simpson2016-07-061-8/+58
| | | | | | | | | | | | | | | | | | | | We currently always vectorize induction variables. However, if an induction variable is only used for counting loop iterations or computing addresses with getelementptr instructions, we don't need to do this. Vectorizing these trivial induction variables can create vector code that is difficult to simplify later on. This is especially true when the unroll factor is greater than one, and we create vector arithmetic when computing step vectors. With this patch, we check if an induction variable is only used for counting iterations or computing addresses, and if so, scalarize the arithmetic when computing step vectors instead. This allows for greater simplification. This patch addresses the suboptimal pointer arithmetic sequence seen in PR27881. Reference: https://llvm.org/bugs/show_bug.cgi?id=27881 Differential Revision: http://reviews.llvm.org/D21620 llvm-svn: 274627
* Fix handling of forward unreachable but reverse-reachable blocks in ↵Daniel Berlin2016-07-061-2/+16
| | | | | | MemorySSA construction llvm-svn: 274606
* [MSSA] Fix typo. NFC.George Burgess IV2016-07-061-1/+1
| | | | llvm-svn: 274590
* [CFLAA] Split into Anders+Steens analysis.George Burgess IV2016-07-061-6/+30
| | | | | | | | | | | | | | | | | | | | | StratifiedSets (as implemented) is very fast, but its accuracy is also limited. If we take a more aggressive andersens-like approach, we can be way more accurate, but we'll also end up being slower. So, we've decided to split CFLAA into CFLSteensAA and CFLAndersAA. Long-term, we want to end up in a place where CFLSteens is queried first; if it can provide an answer, great (since queries are basically map lookups). Otherwise, we'll fall back to CFLAnders, BasicAA, etc. This patch splits everything out so we can try to do something like that when we get a reasonable CFLAnders implementation. Patch by Jia Chen. Differential Revision: http://reviews.llvm.org/D21910 llvm-svn: 274589
* [asan] Add a hidden option for Mach-O global metadata liveness trackingRyan Govostes2016-07-051-0/+10
| | | | llvm-svn: 274578
* [LV] Refactor integer induction widening (NFC)Matthew Simpson2016-07-051-87/+86
| | | | | | | | | This patch also removes the SCEV variants of getStepVector() since they have no uses after the refactoring. Differential Revision: http://reviews.llvm.org/D21903 llvm-svn: 274558
* [InstCombine] enable vector select of bools -> logic foldsSanjay Patel2016-07-031-5/+8
| | | | llvm-svn: 274465
* fix formatting; NFCSanjay Patel2016-07-031-6/+6
| | | | llvm-svn: 274463
* PR28400: Partly undo r274440 to bring test-suite back to life with the new PMSean Silva2016-07-031-1/+2
| | | | | | | | | PR28400 seems to be not an isolated issue, but a general problem related to caching analyses. We will need to discuss on llvm-dev. A test case is in the PR. llvm-svn: 274457
* [PM] Some preparatory refactoring to minimize the diff of D21921Sean Silva2016-07-031-14/+20
| | | | llvm-svn: 274456
* Remove dead TLI arg of isKnownNonNull and propagate deadness. NFC.Sean Silva2016-07-023-31/+13
| | | | | | | | | | | | | | This actually uncovered a surprisingly large chain of ultimately unused TLI args. From what I can gather, this argument is a remnant of when isKnownNonNull would look at the TLI directly. The current approach seems to be that InferFunctionAttrs runs early in the pipeline and uses TLI to annotate the TLI-dependent non-null information as return attributes. This also removes the dependence of functionattrs on TLI altogether. llvm-svn: 274455
* [PM] Some preparatory refactoring to minimize the diff of D21921Sean Silva2016-07-021-15/+17
| | | | | | The main change here is just moving stuff to static functions. llvm-svn: 274446
* [PM] Preparatory cleanups to ArgumentPromotion.Sean Silva2016-07-021-54/+74
| | | | | | | This pulls some obvious changes out of http://reviews.llvm.org/D21921 to minimize the diff. llvm-svn: 274445
* [PM] Fix a small typo from when I ported JumpThreadingSean Silva2016-07-021-1/+1
| | | | llvm-svn: 274440
* Use arrays or initializer lists to feed ArrayRefs instead of SmallVector ↵Benjamin Kramer2016-07-021-5/+2
| | | | | | | | where possible. No functionality change intended. llvm-svn: 274431
OpenPOWER on IntegriCloud