- Nov 28, 2016
-
-
John McCall authored
llvm-svn: 288081
-
John McCall authored
llvm-svn: 288080
-
John McCall authored
move the member classes up to top level to allow forward declarations to name them. NFC. llvm-svn: 288079
-
Chandler Carruth authored
accept an Invalidator that allows them to invalidate themselves if their dependencies are in turn invalidated. Rather than recording the dependency graph ahead of time when analysis get results from other analyses, this simply lets each result trigger the immediate invalidation of any analyses they actually depend on. They do this in a way that has three nice properties: 1) They don't have to handle transitive dependencies because the infrastructure will recurse for them. 2) The invalidate methods are still called only once. We just dynamically discover the necessary topological ordering, everything is memoized nicely. 3) The infrastructure still provides a default implementation and can access it so that only analyses which have dependencies need to do anything custom. To make this work at all, the invalidation logic also has to defer the deletion of the result objects themselves so that they can remain alive until we have collected the complete set of results to invalidate. A unittest is added here that has exactly the dependency pattern we are concerned with. It hit the use-after-free described by Sean in much detail in the long thread about analysis invalidation before this change, and even in an intermediate form of this change where we failed to defer the deletion of the result objects. There is an important problem with doing dependency invalidation that *isn't* solved here: we don't *enforce* that results correctly invalidate all the analyses whose results they depend on. I actually looked at what it would take to do that, and it isn't as hard as I had thought but the complexity it introduces seems very likely to outweigh the benefit. The technique would be to provide a base class for an analysis result that would be populated with other results, and automatically provide the invalidate method which immediately does the correct thing. This approach has some nice pros IMO: - Handles the case we care about and nothing else: only *results* that depend on other analyses trigger extra invalidation. - Localized to the result rather than centralized in the analysis manager. - Ties the storage of the reference to another result to the triggering of the invalidation of that analysis. - Still supports extending invalidation in customized ways. But the down sides here are: - Very heavy-weight meta-programming is needed to provide this base class. - Requires a pretty awful API for accessing the dependencies. Ultimately, I fear it will not pull its weight. But we can re-evaluate this at any point if we start discovering consistent problems where the invalidation and dependencies get out of sync. It will fit as a clean layer on top of the facilities in this patch that we can add if and when we need it. Note that I'm not really thrilled with the names for these APIs... The name "Invalidator" seems ok but not great. The method name "invalidate" also. In review some improvements were suggested, but they really need *other* uses of these terms to be updated as well so I'm going to do that in a follow-up commit. I'm working on the actual fixes to various analyses that need to use these, but I want to try to get tests for each of them so we don't regress. And those changes are seperable and obvious so once this goes in I should be able to roll them out throughout LLVM. Many thanks to Sean, Justin, and others for help reviewing here. Differential Revision: https://reviews.llvm.org/D23738 llvm-svn: 288077
-
Peter Collingbourne authored
This fixes a regression introduced by r285714: we weren't setting the rpath on LLVMgold.so correctly. Spotted by mark@chromium.org! Differential Revision: https://reviews.llvm.org/D27176 llvm-svn: 288076
-
Eli Friedman authored
Preserving lifetime markers isn't as important as allowing promotion, so just drop the lifetime markers if necessary. This also fixes an assertion failure where other parts of SROA assumed that lifetime markers never block promotion. Fixes https://llvm.org/bugs/show_bug.cgi?id=29139. Differential Revision: https://reviews.llvm.org/D24854 llvm-svn: 288074
-
Sanjay Patel authored
llvm-svn: 288073
-
Kuba Mracek authored
Differential Revision: https://reviews.llvm.org/D27137 llvm-svn: 288072
-
Mehdi Amini authored
Some scanner errors were not checked and reported by the parser. Fix PR30934. Recommit r288014 after fixing unittest. Patch by: Serge Guelton <serge.guelton@telecom-bretagne.eu> Differential Revision: https://reviews.llvm.org/D26419 llvm-svn: 288071
-
David Blaikie authored
Patch by Tom Tromey! (for use with Rust) llvm-svn: 288068
-
Kuba Mracek authored
llvm-svn: 288067
-
Kuba Mracek authored
Differential Revision: https://reviews.llvm.org/D27012 llvm-svn: 288065
-
Marcin Koscielnicki authored
See D19555 for rationale. As it turns out, this treatment is also necessary for scanf/printf. Differential Revision: https://reviews.llvm.org/D27118 llvm-svn: 288064
-
Michal Gorny authored
Add a set of unit tests for the distro detection code. The tests use an in-memory virtual filesystems resembling release files for various distributions supported. All release files are provided (not only the ones directly used) in order to guarantee that one of the rules will not mistakenly recognize the distribution incorrectly due to the additional files (e.g. Ubuntu as Debian). Differential Revision: https://reviews.llvm.org/D25869 llvm-svn: 288062
-
Michal Gorny authored
Fix recognizing newer OpenSUSE versions that combine the two version components into 'VERSION = x.y'. The check was written against an older version that kept those two split as VERSION and PATCHLEVEL. Differential Revision: https://reviews.llvm.org/D26850 llvm-svn: 288061
-
Michal Gorny authored
Refactor the Distro enum along with helper functions into a full-fledged Distro class, inspired by llvm::Triple, and make it a public API. The new class wraps the enum with necessary comparison operators, adding the convenience Is*() methods and a constructor performing the detection. The public API is needed to run the unit tests (D25869). Differential Revision: https://reviews.llvm.org/D25949 llvm-svn: 288060
-
Reid Kleckner authored
This solves PR23715 in a way that is compatible with LTO. MSVC supports jumping to source-level labels and between inline asm blocks, but we don't. Also revert the old solution, r255201, which was to mark these calls as noduplicate. llvm-svn: 288059
-
Matthias Braun authored
This makes the createGenericSchedLive() function that constructs the default scheduler available for the public API. This should help when you want to get a scheduler and the default list of DAG mutations. This also shrinks the list of default DAG mutations: {Load|Store}ClusterDAGMutation and MacroFusionDAGMutation are no longer added by default. Targets can easily add them if they need them. It also makes it easier for targets to add alternative/custom macrofusion or clustering mutations while staying with the default createGenericSchedLive(). It also saves the callback back and forth in TargetInstrInfo::enableClusterLoads()/enableClusterStores(). Differential Revision: https://reviews.llvm.org/D26986 llvm-svn: 288057
-
Jonathan Peyton authored
Patch by Victor Campos Differential Revision: https://reviews.llvm.org/D27172 llvm-svn: 288056
-
Artem Belevich authored
-cgp-freq-ratio-to-skip-merge option was removed by rollback in r288052. llvm-svn: 288055
-
Andrey Churbanov authored
Cleanup: memory leaks on warnings printing fixed; some memory freeing cleaned; poor indents and one typo fixed. Patch by Victor Campos. Differential Revision: https://reviews.llvm.org/D26786 llvm-svn: 288054
-
Stanislav Mekhanoshin authored
Codegen prepare sinks comparisons close to a user is we have only one register for conditions. For AMDGPU we have many SGPRs capable to hold vector conditions. Changed BE to report we have many condition registers. That way IR LICM pass would hoist an invariant comparison out of a loop and codegen prepare will not sink it. With that done a condition is calculated in one block and used in another. Current behavior is to store workitem's condition in a VGPR using v_cndmask_b32 and then restore it with yet another v_cmp instruction from that v_cndmask's result. To mitigate the issue a propagation of source SGPR pair in place of v_cmp is implemented. Additional side effect of this is that we may consume less VGPRs at a cost of more SGPRs in case if holding of multiple conditions is needed, and that is a clear win in most cases. Differential Revision: https://reviews.llvm.org/D26114 llvm-svn: 288053
-
Joerg Sonnenberger authored
It results in assertions in lib/Analysis/BlockFrequencyInfoImpl.cpp line 670 ("Expected irreducible CFG"). llvm-svn: 288052
-
Justin Lebar authored
Reviewers: arsenm Subscribers: wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D27000 llvm-svn: 288051
-
Justin Lebar authored
Summary: As far as I can tell, doing our own computations in NearestCommonDominator is a false optimization -- DomTree will build up what appears to be exactly this data when it decides it's worthwhile. Moreover, by building the cache ourselves, we cannot take advantage of the cache that the domtree might have available. In addition, I am not convinced of the correctness of the original code. In particular, setting ResultIndex = 1 on the first addBlock instead of setting it to 0 is quite fishy. Similarly, it's not clear to me that setting IndexMap[Node] = 0 for every node as we walk up the tree finding a common parent is correct. But rather than ponder over these questions, I'd rather just make the code do the obviously-correct thing. This patch also changes the NearestCommonDominator API a bit, improving the names and getting rid of the boolean parameter in addBlock -- see http://jlebar.com/2011/12/16/Boolean_parameters_to_API_functions_considered_harmful..html Reviewers: arsenm Subscribers: aemerson, wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D26998 llvm-svn: 288050
-
Simon Pilgrim authored
llvm-svn: 288049
-
Adam Nemet authored
This requires some changes to the opt-diag API. Hal and I have discussed this at the Dev Meeting and came up with a streaming delimiter (setExtraArgs) to solve this. Arguments after this delimiter are only included in the optimization records and not in the remarks printed in the compiler output. (Note, how in the test the content of the YAML file changes but the remarks on the compiler output don't.) This implements the green GVN message with a bug fix at line http://lab.llvm.org:8080/artifacts/opt-view_test-suite/build/SingleSource/Benchmarks/Dhrystone/CMakeFiles/dry.dir/html/_org_test-suite_SingleSource_Benchmarks_Dhrystone_dry.c.html#L446 The fix is that now we properly include the constant value in the message: "load of type i32 eliminated in favor of 7" Differential Revision: https://reviews.llvm.org/D26489 llvm-svn: 288047
-
Adam Nemet authored
Follow-on patches will add more interesting cases. The goal of this patch-set is to get the GVN messages printed in opt-viewer from Dhrystone as was presented in my Dev Meeting talk. This is the optimization view for the function (the last remark in the function has a bug which is fixed in this series): http://lab.llvm.org:8080/artifacts/opt-view_test-suite/build/SingleSource/Benchmarks/Dhrystone/CMakeFiles/dry.dir/html/_org_test-suite_SingleSource_Benchmarks_Dhrystone_dry.c.html#L430 Differential Revision: https://reviews.llvm.org/D26488 llvm-svn: 288046
-
Sanjay Patel authored
llvm-svn: 288045
-
Todd Fiala authored
llvm-svn: 288044
-
Benjamin Kramer authored
Just let the existing typo correction machinery handle that. llvm-svn: 288043
-
Daniil Fukalov authored
At the moment optimized tablegen is generated by LLVM_USE_HOST_TOOLS variable that is not set for Visual Sudio since LLVM_ENABLE_ASSERTIONS depends on CMAKE_BUILD_TYPE value that is not equal to "DEBUG" in case of Visual Studio soltion generation. Modified to do not depend on LLVM_ENABLE_ASSERTIONS value in VS and Xcode cases Reviewers: beanz Subscribers: RKSimon, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D27135 llvm-svn: 288042
-
Adam Nemet authored
This addresses the comment D26832. llvm-svn: 288041
-
Simon Pilgrim authored
Bit-shifts by a whole number of bytes can be represented as a shuffle mask suitable for combining. Added a 'getFauxShuffleMask' function to allow us to create shuffle masks from other suitable operations. llvm-svn: 288040
-
Alexey Bataev authored
If member expression is used in the task region and the base expression is a DeclRefExp and the variable used in this ref expression is private, it should be marked as implicitly firstprivate inside this region. Patch fixes this issue. llvm-svn: 288039
-
Pavel Labath authored
Summary: On for 64-bit targets, the correct register set to read the fxsave are is NT_PRFPREG (only 32-bit targets need NT_PRXFPREG, presumably for historic reasons). Reference: <https://github.com/torvalds/linux/blob/v4.8/arch/x86/kernel/ptrace.c#L1261>. Reviewers: tberghammer, valentinagiusti Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D27161 llvm-svn: 288038
-
Simon Pilgrim authored
llvm-svn: 288037
-
Daniel Cederman authored
llvm-svn: 288036
-
Nirav Dave authored
This reverts commit r287773 which caused issues with ppc64le builds. llvm-svn: 288035
-
NAKAMURA Takumi authored
msc Debug build detected it. llvm-svn: 288034
-