summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* [Utils] Put includes in correct order. NFC.Weiming Zhao2015-11-248-10/+8
| | | | | | | | | | | | | | | | | | | Summary: Followed the guidelines in: http://llvm.org/docs/CodingStandards.html#include-style However, I noticed that uppercase named headers come before lowercase ones throughout the codebase. So kept them as is. Patch by Mandeep Singh Grang <mgrang@codeaurora.org> Reviewers: majnemer, davide, jmolloy, atrick Subscribers: sanjoy Differential Revision: http://reviews.llvm.org/D14939 llvm-svn: 254005
* [InstCombine] fix propagation of fast-math-flagsSanjay Patel2015-11-241-10/+5
| | | | | | | Noticed while working on D4583: http://reviews.llvm.org/D4583 llvm-svn: 253997
* use convenience function for copying IR flags; NFCISanjay Patel2015-11-241-12/+2
| | | | llvm-svn: 253996
* [ThinLTO] Fix FunctionImport alias checking and testTeresa Johnson2015-11-241-4/+5
| | | | | | | Skip imports for weak_any aliases as well. Fix the test to check non-import of weak aliases and functions, and import of normal alias. llvm-svn: 253991
* Fix build after r253954Ismail Donmez2015-11-241-1/+1
| | | | llvm-svn: 253969
* Add a FunctionImporter helper to perform summary-based cross-module function ↵Mehdi Amini2015-11-244-1/+242
| | | | | | | | | | | | | | | | | importing Summary: This is a helper to perform cross-module import for ThinLTO. Right now it is importing naively every possible called functions. Reviewers: tejohnson Subscribers: dexonsmith, llvm-commits Differential Revision: http://reviews.llvm.org/D14914 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 253954
* [LIR] Put includes in correct order. NFC.Chad Rosier2015-11-231-1/+1
| | | | llvm-svn: 253915
* SamplePGO - Add coverage tracking for samples.Diego Novillo2015-11-231-26/+85
| | | | | | | | | | | | The existing coverage tracker counts the number of records that were used from the input profile. An alternative view of coverage is to check how many available samples were applied. This way, if the profile contains several records with few samples, it doesn't really matter much that they were not applied. The more interesting records to apply are the ones that contribute many samples. llvm-svn: 253912
* [WinEH] Fix a case where GVN could incorrectly PRE a load into an EH pad.Andrew Kaylor2015-11-231-0/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D14842 llvm-svn: 253908
* [PGO] Introduce alignment macro for instr-prof control data(NFC)Xinliang David Li2015-11-231-1/+1
| | | | llvm-svn: 253893
* SamplePGO - Clear coverage tracking when clearing per-function data.Diego Novillo2015-11-231-0/+2
| | | | llvm-svn: 253877
* SamplePGO - Use newly introduced local variable. NFC.Diego Novillo2015-11-231-2/+2
| | | | llvm-svn: 253868
* [LoopStrengthReduce] Mark dump() definitions as LLVM_DUMP_METHOD.Davide Italiano2015-11-231-14/+7
| | | | llvm-svn: 253841
* [PGO] move names of runtime sections definitions to InstrProfData.inc Xinliang David Li2015-11-221-1/+1
| | | | | | | | | | In profile runtime implementation for Darwin, Linux and FreeBSD, the names of sections holding profile control/counter/naming data need to be known by the runtime in order to locate the start/end of the data. Moving the name definitions to the common file to specify the connection. llvm-svn: 253814
* [PGO] Define value profiling updater API signature in InstrProfData.inc (NFC)Xinliang David Li2015-11-221-6/+7
| | | | llvm-svn: 253805
* Use modulo operator instead of multiplying result of a divide and ↵Craig Topper2015-11-211-1/+1
| | | | | | subtracting from the original dividend. NFC. llvm-svn: 253792
* use ternary ops; NFCSanjay Patel2015-11-211-8/+2
| | | | llvm-svn: 253787
* remove unnecessary temp variables; NFCSanjay Patel2015-11-211-4/+2
| | | | llvm-svn: 253786
* fix typo; NFCSanjay Patel2015-11-211-1/+1
| | | | llvm-svn: 253785
* [SimplifyLibCalls] Removed some TODOs which are already implemented. NFC.Weiming Zhao2015-11-211-4/+0
| | | | | | | | | | | | | | Summary: D14302 implements tan(atan(x)) -> x D14045 implements pow(exp(x), y) -> exp(x*y) Patch by Mandeep Singh Grang <mgrang@codeaurora.org> Reviewers: majnemer, davide Differential Revision: http://reviews.llvm.org/D14882 llvm-svn: 253768
* SamplePGO - Do not count never-executed inlined functions when computing ↵Diego Novillo2015-11-201-5/+24
| | | | | | | | | | | | | | | coverage. If a function was originally inlined but not actually hot at runtime, its samples will not be counted inside the parent function. This throws off the coverage calculation because it expects to find more used records than it should. Fixed by ignoring functions that will not be inlined into the parent. Currently, this is inlined functions with 0 samples. In subsequent patches, I'll change this to mean "cold" functions. llvm-svn: 253716
* Revert "[FunctionAttrs] Remove redundant assignment."Tilmann Scheller2015-11-201-0/+2
| | | | | | | | | | This reverts r253661. Turns out that the assignment is not redundant (despite the Clang static analyzer claiming the opposite). The variable is being used by the lambda function AddUsersToWorklistIfCapturing(). llvm-svn: 253696
* SamplePGO - Add line offset and discriminator information to sample reports.Diego Novillo2015-11-201-3/+5
| | | | | | | | | While debugging some sampling coverage problems, I found this useful: When applying samples from a profile, it helps to also know what line offset and discriminator the sample belongs to. This makes it easy to correlate against the input profile. llvm-svn: 253670
* [FunctionAttrs] Remove redundant assignment.Tilmann Scheller2015-11-201-2/+0
| | | | | | Identified by the Clang static analyzer. llvm-svn: 253661
* Fix a pair of issues that caused an infinite loop in reassociate.Owen Anderson2015-11-201-1/+1
| | | | | | | | Terrifyingly, one of them is a mishandling of floating point vectors in Constant::isZero(). How exactly this issue survived this long is beyond me. llvm-svn: 253655
* Use range-based for loops. NFCCraig Topper2015-11-201-12/+8
| | | | llvm-svn: 253652
* Follow up to r253591. Turn into an assertion.Davide Italiano2015-11-191-2/+1
| | | | | | Reported by: David Blaikie. llvm-svn: 253605
* [LIR] Update some comments. NFC.Chad Rosier2015-11-191-5/+4
| | | | llvm-svn: 253603
* Fix the debug build breakage that getDiscriminator is called by mistake.Dehao Chen2015-11-191-1/+2
| | | | llvm-svn: 253597
* Revert r253253 and r253126: "Don't recompute LCSSA after loop-unrolling when ↵Michael Zolotukhin2015-11-191-12/+2
| | | | | | | | | | | | possible." The change exposed a bug in IndVarSimplify (PR25578), which led to a failure (PR25538). When the bug is fixed, this patch can be reapplied. The tests are kept in tree, as they're useful anyway, and will not break with this revert. llvm-svn: 253596
* Reimplement discriminator assignment algorithm.Dehao Chen2015-11-191-52/+37
| | | | | | | | | | | | Summary: The new algorithm is more efficient (O(n), n is number of basic blocks). And it is guaranteed to cover all cases of multiple BB mapped to same line. Reviewers: dblaikie, davidxl, dnovillo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14738 llvm-svn: 253594
* [AddressSanitizer] assert(false) -> llvm_unreachable and remove return.Davide Italiano2015-11-191-4/+2
| | | | llvm-svn: 253591
* [LIR] Fix 80-column from previous commit.Chad Rosier2015-11-191-1/+2
| | | | llvm-svn: 253586
* [LIR] Sink checks into function to enable future refactoring. NFC.Chad Rosier2015-11-191-15/+17
| | | | | | | The purpose of this change is help delineate the memset and memcpy optimizations with the overall goal of resolving PR25520. llvm-svn: 253585
* [GlobalOpt] Localize some globals that have non-instruction usersJames Molloy2015-11-191-1/+60
| | | | | | We currently bail out of global localization if the global has non-instruction users. However, often these can be simple bitcasts or constant-GEPs, which we can easily turn into instructions before localizing. Be a bit more aggressive. llvm-svn: 253584
* [LIR] Use the more appropriate method. NFC.Chad Rosier2015-11-191-1/+1
| | | | llvm-svn: 253578
* [LV] Add a helper function, isReductionVariable. NFC.Chad Rosier2015-11-191-5/+7
| | | | llvm-svn: 253565
* [FunctionAttrs] Provide a mechanism for adding function attributes from the ↵James Molloy2015-11-191-0/+67
| | | | | | | | | | | | command line This provides a way to force a function to have certain attributes from the command line. This can be useful when debugging or doing workload exploration, where manually editing IR is tedious or not possible (due to build systems etc). The syntax is -force-attribute=function_name:attribute_name All function attributes are parsed except alignstack as it requires an argument. llvm-svn: 253550
* Revert "Change memcpy/memset/memmove to have dest and source alignments."Pete Cooper2015-11-1912-117/+90
| | | | | | | | | | This reverts commit r253511. This likely broke the bots in http://lab.llvm.org:8011/builders/clang-ppc64-elf-linux2/builds/20202 http://bb.pgr.jp/builders/clang-3stage-i686-linux/builds/3787 llvm-svn: 253543
* Fix bug 25440: GVN assertion after coercing loadsWeiming Zhao2015-11-191-1/+12
| | | | | | | | | | | | | | | | Optimizations like LoadPRE in GVN will insert new instructions. If the insertion point is in a already processed BB, they should get a value number explicitly. If the insertion point is after current instruction, then just leave it. However, current GVN framework has no support for it. In this patch, we just bail out if a VN can't be found. Dfferential Revision: http://reviews.llvm.org/D14670 A test/Transforms/GVN/pr25440.ll M lib/Transforms/Scalar/GVN.cpp llvm-svn: 253536
* Fix several long lines (>80) in LoopVectorize.cpp. NFC.Cong Hou2015-11-191-13/+19
| | | | llvm-svn: 253527
* [SimplifyLibCalls] New trick: pow(x, 0.5) -> sqrt(x) under -ffast-math.Davide Italiano2015-11-181-2/+9
| | | | | | Differential Revision: http://reviews.llvm.org/D14466 llvm-svn: 253521
* Fix returned value for GVN: could return "false" even after modifying the IRMehdi Amini2015-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | This bug would manifest in some very specific cases where all the following conditions are fullfilled: - GVN didn't remove block - The regular GVN iteration didn't change the IR - PRE is enabled - PRE will not split critical edge - The last instruction processed by PRE didn't change the IR Because the CallGraph PassManager relies on this returned value to decide if it needs to recompute a node after the execution of Function passes, not returning the right value can lead to unexpected results. Fix for: https://llvm.org/bugs/show_bug.cgi?id=24715 Patch by Wenxiang Qiu <vincentqiuuu@gmail.com> From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 253518
* [BuildLibCalls] EmitStrNLen() is dead code. Garbage collect.Davide Italiano2015-11-181-26/+0
| | | | llvm-svn: 253514
* Change memcpy/memset/memmove to have dest and source alignments.Pete Cooper2015-11-1812-90/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note, this was reviewed (and more details are in) http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html These intrinsics currently have an explicit alignment argument which is required to be a constant integer. It represents the alignment of the source and dest, and so must be the minimum of those. This change allows source and dest to each have their own alignments by using the alignment attribute on their arguments. The alignment argument itself is removed. There are a few places in the code for which the code needs to be checked by an expert as to whether using only src/dest alignment is safe. For those places, they currently take the minimum of src/dest alignments which matches the current behaviour. For example, code which used to read: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 8, i1 false) will now read: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %dest, i8* align 8 %src, i32 500, i1 false) For out of tree owners, I was able to strip alignment from calls using sed by replacing: (call.*llvm\.memset.*)i32\ [0-9]*\,\ i1 false\) with: $1i1 false) and similarly for memmove and memcpy. I then added back in alignment to test cases which needed it. A similar commit will be made to clang which actually has many differences in alignment as now IRBuilder can generate different source/dest alignments on calls. In IRBuilder itself, a new argument was added. Instead of calling: CreateMemCpy(Dst, Src, getInt64(Size), DstAlign, /* isVolatile */ false) you now call CreateMemCpy(Dst, Src, getInt64(Size), DstAlign, SrcAlign, /* isVolatile */ false) There is a temporary class (IntegerAlignment) which takes the source alignment and rejects implicit conversion from bool. This is to prevent isVolatile here from passing its default parameter to the source alignment. Note, changes in future can now be made to codegen. I didn't change anything here, but this change should enable better memcpy code sequences. Reviewed by Hal Finkel. llvm-svn: 253511
* Disable gvn non-local speculative loads under asan.Mike Aizatsky2015-11-181-0/+4
| | | | | | | | Summary: Fix for https://llvm.org/bugs/show_bug.cgi?id=25550 Differential Revision: http://reviews.llvm.org/D14763 llvm-svn: 253498
* [PGO] Value profiling supportBetul Buyukkurt2015-11-181-21/+122
| | | | | | | | | This change introduces an instrumentation intrinsic instruction for value profiling purposes, the lowering of the instrumentation intrinsic and raw reader updates. The raw profile data files for llvm-profdata testing are updated. llvm-svn: 253484
* Revert "Revert "Strip metadata when speculatively hoisting instructions ↵Igor Laevsky2015-11-182-0/+9
| | | | | | | | (r252604)" Failing clang test is now fixed by the r253458. llvm-svn: 253459
* [LTO] Add an early run of functionattrsJames Molloy2015-11-181-0/+1
| | | | | | Because we internalize early, we can potentially mark a bunch of functions as norecurse. Do this before globalopt. llvm-svn: 253451
* [OperandBundles] Tighten OperandBundleDef's interface; NFCSanjoy Das2015-11-181-1/+1
| | | | llvm-svn: 253446
OpenPOWER on IntegriCloud