search for: memoryssa

Displaying 20 results from an estimated 169 matches for "memoryssa".

2017 May 30
4
RFC: Replace usage of Alias Set Tracker with MemorySSA in LICM
Hi, I wanted to give a heads-up that I've been looking into replacing the AliasSetTracker(AST) with MemorySSA in the Loop Invariant Code Motion (LICM) pass. I would love to get feedback on the best way to incrementally push in this change. Motivation: There has been an outstanding issue with using the Alias Set Tracker due to its expensive construction time (quadratic). We've had test cases take forev...
2016 Apr 11
2
[LICM][MemorySSA] Converting LICM pass to use MemorySSA to avoid AliasSet collapse issue
Hi All, I'm looking into converting LICM to use MemorySSA instead of AliasSets to determine when it is safe to hoist/sink/promote loads and stores to get around the issue of alias set collapse (see discussion [1]). I have a prototype implementation, but have run into two issues that I could use input from the designers of MemorySSA to resolve: 1) I...
2016 Apr 21
2
[LICM][MemorySSA] Converting LICM pass to use MemorySSA to avoid AliasSet collapse issue
...After digging a little deeper, it appears that readonly calls showing up as MemoryDefs is only happening on an EarlyCSE test that is using the new pass manager (test/Transforms/EarlyCSE/basic.ll test5 if you’re curious), so I suspect it is an issue with the new pass manager setup code for either MemorySSA, my changes to EarlyCSE, the test run command line or something else not related to the MemorySSA code proper. -- Geoff Berry Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project From: Geo...
2020 Aug 18
7
[RFC] Switching to MemorySSA-backed Dead Store Elimination (aka cross-bb DSE)
Hi, Over the past six months, a MemorySSA-backed DSE implementation has been added to LLVM and it now covers almost all cases the existing DSE implementation does, plus adding a major new capability: eliminating stores across basic blocks. Thanks everyone involved with reviews, testing & patches! I think now would be a good time to st...
2020 Sep 01
2
[RFC] Switching to MemorySSA-backed Dead Store Elimination (aka cross-bb DSE)
...minimize impact at this time (we won't have benefits > as large at the time of the switch). I'm talking about getting the geomean > closer to 1% in all configurations if possible. > > I believe that the regressions introduced by this flag flip can be > undone by further using MemorySSA in the other passes currently using > MemDepAnalysis, and offsetting the cost of computing MemorySSA in the first > place. The threshold could be raised again to enable more stores eliminated > once the MemCpyOpt+MSSA and NewGVN become the default. > > > > If reducing the thres...
2016 Apr 20
2
[LICM][MemorySSA] Converting LICM pass to use MemorySSA to avoid AliasSet collapse issue
Hi Daniel, Thanks for the info. I’ve started looking into converting EarlyCSE to use MemorySSA first since 1) I don’t think it needs any additional MemorySSA update API and 2) the particular case I’m looking at needs EarlyCSE to catch more load cases before LICM to be profitable. I have a prototype working, but have run into two issues: 1) readonly calls are treated as clobbers by...
2018 Aug 10
2
llvm MemorySSA def-use chains
Hi, try adding some alias analysis to the pipeline: see examples in llvm/test/Analysis/MemorySSA/*.ll for example assume.ll has ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' without basic-aa the memory ssa will safely assume that the stores to %a and %d alias which may be proven disjoint by one of the alias analyses. On Thu, Aug 9, 2018 at 8...
2016 Apr 20
4
[LICM][MemorySSA] Converting LICM pass to use MemorySSA to avoid AliasSet collapse issue
..., a Linux Foundation Collaborative Project From: Daniel Berlin [mailto:dberlin at dberlin.org] Sent: Wednesday, April 20, 2016 1:06 PM To: Geoff Berry <gberry at codeaurora.org>; George Burgess <gbiv at google.com> Cc: llvm-dev <llvm-dev at lists.llvm.org> Subject: Re: [LICM][MemorySSA] Converting LICM pass to use MemorySSA to avoid AliasSet collapse issue On Wed, Apr 20, 2016 at 9:58 AM, Geoff Berry <gberry at codeaurora.org <mailto:gberry at codeaurora.org> > wrote: Hi Daniel, Thanks for the info. I’ve started looking into converting EarlyCSE to use...
2019 Mar 05
2
RFC: Contained stateful AliasAnalysis
...d. Are you suggesting keeping them? It's possible, but it will be very tricky to ensure they are cleared at the right times and they will likely be prone to adding hidden bugs. I don't have strong indications currently that keeping such information would be useful by other users, other than MemorySSA, and only at build time, so I'd rather not sign up for updating/invalidating such internal caches. MemorySSA itself can be viewed as a cache, but you can view it as storing different information than what AA computes internally. e.g. MemorySSA will not remember "is this pointer captured&q...
2018 Oct 02
2
Reordering of load/stores using MemorySSA
Hello all, It seems that it is insufficient to rely on MemorySSA to correctly reorder load/stores. For example, we have this following code: v = load q store 10, p => store 10, p v = load q // This is incorrect if p and q may alias In the MemorySSA representation however, there's no syntactic dependency between load/store, because MemorySSA before tr...
2017 Apr 28
2
[MemorySSA] A question about how to update the MemorySSA when we call RecursivelyDeleteTriviallyDeadInstructions
When we erase a memory access instruction, existing passes using memory ssa like GVN, NewGVN, GVNHoist and EarlyCSE uses MemorySSAUpdater to do the update before the instruction is erased. However, if we call llvm::RecursivelyDeleteTriviallyDeadInstructions to find out dead instruction recursively and memory access instructions may be erased inside the recursive process, we need a way to update MemorySSA for those instruction...
2018 Aug 09
2
llvm MemorySSA def-use chains
Hi, I have a question about how llvm MemorySSA works, as seems I misunderstand something. Consider following code snippet and corresponding IR with MemorySSA annotations (got with opt -print-memoryssa) void foo(int* b) { int a = 0; int d = 12; if (b) { a = 42; d = 32; } int c = a; int e = d; } ; Fun...
2018 Oct 02
0
Reordering of load/stores using MemorySSA
On Tue, Oct 2, 2018 at 4:44 AM Juneyoung Lee <juneyoung.lee at sf.snu.ac.kr> wrote: > > Hello Daniel, > > Thank you for the reply. > My impression was that embedding such information into MemorySSA > would be helpful for shorter compilation time > as well as people who needs this kind of information for writing optimizations, > but building time of MemorySSA also should have been considered. Right now the building time of MemorySSA in LLVM has high cost because AA in LLVM is so slow...
2019 Mar 05
2
RFC: Contained stateful AliasAnalysis
...ed. I'm interested to first and foremost clarify what is the best way to even start such an infrastructure change, such that it is not abused (or even available) by other passes. We certainly don't want to keep arbitrary caches in all passes. Would making this a feature used exclusively by MemorySSA make sense? Only from other Analysis? The usecases I have stem from BasicAA and TBAA being used to build MemorySSA. MemorySSA is essentially a cache itself, and we're building it with a stateless tool. We know that while building MemorySSA, there are no changes in the program, and yet, there i...
2020 Oct 12
3
MemorySSA LLVM-dev meeting notes and upcoming meetings
Hello, Following up on last week's LLVM-Dev meeting where we discussed MemorySSA related topics, I created the following google doc <https://docs.google.com/document/d/1-uEEZfmRdPThZlctOq9eXlmUaSSAAi8oKxhrPY_lpjk/edit#> with some of the meeting notes and planning for future meetings. For those who participated, please feel free to add items I may have missed into the docu...
2017 Dec 21
4
Hoisting in the presence of volatile loads.
...oist a non-volatile > load above a volatile load when the loads alias. It's probably best > not to exploit this ambiguity at the moment by unconditionally > allowing the motion of nonvolatile loads above volatile loads (and > vice versa)" > So the testcase: test/Analysis/MemorySSA/volatile-clobber.ll, is > checking that a volatile load is the defining access of a load with > which it may alias. > > Snippet: > ; Ensuring that we don't automatically hoist nonvolatile loads around > volatile > ; loads > ; CHECK-LABEL define void @volatile_only &gt...
2017 Dec 19
4
MemorySSA question
Hi, I am new to MemorySSA and wanted to understand its capabilities. Hence I wrote the following program (test.c): int N; void test(int *restrict a, int *restrict b, int *restrict c, int *restrict d, int *restrict e) { int i; for (i = 0; i < N; i = i + 5) { a[i] = b[i] + c[i]; } for (i = 0; i < N - 5;...
2020 Oct 19
0
MemorySSA LLVM-dev meeting notes and upcoming meetings
...>> Thank you for the tutorial, I did watch the video for that but >> unfortunately I wasn't able to attend the Q&A session. >> I thought the tutorial was a very useful high-level view. I think there's >> more depth that can be added, but we were missing a longer MemorySSA video >> tutorial and having this added to youtube (after post-production) will be >> great. It was very much appreciated that you and Simon worked on this! >> Yes, I have a few items to add to the documentation, and this video is >> one of them once available. >> >...
2020 Aug 19
2
[RFC] Switching to MemorySSA-backed Dead Store Elimination (aka cross-bb DSE)
...he threshold somewhat to minimize impact at this time (we won't have benefits as large at the time of the switch). I'm talking about getting the geomean closer to 1% in all configurations if possible. I believe that the regressions introduced by this flag flip can be undone by further using MemorySSA in the other passes currently using MemDepAnalysis, and offsetting the cost of computing MemorySSA in the first place. The threshold could be raised again to enable more stores eliminated once the MemCpyOpt+MSSA and NewGVN become the default. If reducing the thresholds is not possible or removes m...
2017 Dec 19
2
MemorySSA question
On Tue, Dec 19, 2017 at 9:10 AM, Siddharth Bhat via llvm-dev < llvm-dev at lists.llvm.org> wrote: > I could be entirely wrong, but from my understanding of memorySSA, each > def defines an "abstract heap state" which has the coarsest possible > definition - any write will be modelled as a "new heap state". > This is true for def-def relationships, but doesn't;'t matter here. > > So in that sense, from what I understa...