[llvm-branch-commits] [llvm] PR for llvm/llvm-project#79571 (PR #79572)

2024-02-05 Thread Alina Sbirlea via llvm-branch-commits

https://github.com/alinas approved this pull request.

There are some pre-merge failures to review, but including this in the release 
makes sense.

https://github.com/llvm/llvm-project/pull/79572
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [memoryssa] Exclude llvm.allow.{runtime, ubsan}.check() (PR #86066)

2024-03-21 Thread Alina Sbirlea via llvm-branch-commits

https://github.com/alinas approved this pull request.

lgtm

https://github.com/llvm/llvm-project/pull/86066
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 63aeaf7 - [DominatorTree] Add support for mixed pre/post CFG views.

2021-01-06 Thread Alina Sbirlea via llvm-branch-commits

Author: Alina Sbirlea
Date: 2021-01-06T14:53:09-08:00
New Revision: 63aeaf754a78c67ca3f8343d525dfb7a378dfa9e

URL: 
https://github.com/llvm/llvm-project/commit/63aeaf754a78c67ca3f8343d525dfb7a378dfa9e
DIFF: 
https://github.com/llvm/llvm-project/commit/63aeaf754a78c67ca3f8343d525dfb7a378dfa9e.diff

LOG: [DominatorTree] Add support for mixed pre/post CFG views.

Add support for mixed pre/post CFG views.

Update usages of the MemorySSAUpdater to use the new DT API by
requesting the DT updates to be done by the MSSAUpdater.

Differential Revision: https://reviews.llvm.org/D93371

Added: 


Modified: 
llvm/include/llvm/Analysis/MemorySSAUpdater.h
llvm/include/llvm/Support/GenericDomTree.h
llvm/lib/Analysis/MemorySSAUpdater.cpp
llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp
llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
llvm/lib/Transforms/Utils/LoopRotationUtils.cpp

Removed: 




diff  --git a/llvm/include/llvm/Analysis/MemorySSAUpdater.h 
b/llvm/include/llvm/Analysis/MemorySSAUpdater.h
index d41b93209979..b0bf2e5ead62 100644
--- a/llvm/include/llvm/Analysis/MemorySSAUpdater.h
+++ b/llvm/include/llvm/Analysis/MemorySSAUpdater.h
@@ -119,8 +119,11 @@ class MemorySSAUpdater {
   ArrayRef ExitBlocks,
   ArrayRef> VMaps, DominatorTree &DT);
 
-  /// Apply CFG updates, analogous with the DT edge updates.
-  void applyUpdates(ArrayRef Updates, DominatorTree &DT);
+  /// Apply CFG updates, analogous with the DT edge updates. By default, the
+  /// DT is assumed to be already up to date. If UpdateDTFirst is true, first
+  /// update the DT with the same updates.
+  void applyUpdates(ArrayRef Updates, DominatorTree &DT,
+bool UpdateDTFirst = false);
   /// Apply CFG insert updates, analogous with the DT edge updates.
   void applyInsertUpdates(ArrayRef Updates, DominatorTree &DT);
 

diff  --git a/llvm/include/llvm/Support/GenericDomTree.h 
b/llvm/include/llvm/Support/GenericDomTree.h
index d2d7c8c4481d..28b2537bc481 100644
--- a/llvm/include/llvm/Support/GenericDomTree.h
+++ b/llvm/include/llvm/Support/GenericDomTree.h
@@ -550,7 +550,7 @@ class DominatorTreeBase {
   /// \param Updates An unordered sequence of updates to perform. The current
   /// CFG and the reverse of these updates provides the pre-view of the CFG.
   /// \param PostViewUpdates An unordered sequence of update to perform in 
order
-  /// to obtain a post-view of the CFG. The DT will be updates assuming the
+  /// to obtain a post-view of the CFG. The DT will be updated assuming the
   /// obtained PostViewCFG is the desired end state.
   void applyUpdates(ArrayRef Updates,
 ArrayRef PostViewUpdates) {
@@ -558,14 +558,18 @@ class DominatorTreeBase {
   GraphDiff PostViewCFG(PostViewUpdates);
   DomTreeBuilder::ApplyUpdates(*this, PostViewCFG, &PostViewCFG);
 } else {
-  // TODO:
   // PreViewCFG needs to merge Updates and PostViewCFG. The updates in
   // Updates need to be reversed, and match the direction in PostViewCFG.
-  // Normally, a PostViewCFG is created without reversing updates, so one
-  // of the internal vectors needs reversing in order to do the
-  // legalization of the merged vector of updates.
-  llvm_unreachable("Currently unsupported to update given a set of "
-   "updates towards a PostView");
+  // The PostViewCFG is created with updates reversed (equivalent to 
changes
+  // made to the CFG), so the PreViewCFG needs all the updates reverse
+  // applied.
+  SmallVector AllUpdates(Updates.begin(), Updates.end());
+  for (auto &Update : PostViewUpdates)
+AllUpdates.push_back(Update);
+  GraphDiff PreViewCFG(AllUpdates,
+   /*ReverseApplyUpdates=*/true);
+  GraphDiff PostViewCFG(PostViewUpdates);
+  DomTreeBuilder::ApplyUpdates(*this, PreViewCFG, &PostViewCFG);
 }
   }
 

diff  --git a/llvm/lib/Analysis/MemorySSAUpdater.cpp 
b/llvm/lib/Analysis/MemorySSAUpdater.cpp
index 4ff61d4324f8..99fa58b8872a 100644
--- a/llvm/lib/Analysis/MemorySSAUpdater.cpp
+++ b/llvm/lib/Analysis/MemorySSAUpdater.cpp
@@ -811,7 +811,7 @@ void MemorySSAUpdater::updateExitBlocksForClonedLoop(
 }
 
 void MemorySSAUpdater::applyUpdates(ArrayRef Updates,
-DominatorTree &DT) {
+DominatorTree &DT, bool UpdateDT) {
   SmallVector DeleteUpdates;
   SmallVector RevDeleteUpdates;
   SmallVector InsertUpdates;
@@ -825,10 +825,15 @@ void MemorySSAUpdater::applyUpdates(ArrayRef 
Updates,
   }
 
   if (!DeleteUpdates.empty()) {
-SmallVector Empty;
-// Deletes are reversed applied, because this CFGView is pretending the
-// deletes did not happen yet, hence the edges still exist.
-DT.applyUpdates(Empty, RevDeleteUpdates);
+if (!U

[llvm-branch-commits] [llvm] 5a2d954 - [NFC] Remove stray comment.

2020-12-14 Thread Alina Sbirlea via llvm-branch-commits

Author: Alina Sbirlea
Date: 2020-12-14T11:19:17-08:00
New Revision: 5a2d954671e91e63e2f944cce31bdcc232c8ecc2

URL: 
https://github.com/llvm/llvm-project/commit/5a2d954671e91e63e2f944cce31bdcc232c8ecc2
DIFF: 
https://github.com/llvm/llvm-project/commit/5a2d954671e91e63e2f944cce31bdcc232c8ecc2.diff

LOG: [NFC] Remove stray comment.

Added: 


Modified: 
llvm/include/llvm/Support/GenericDomTree.h

Removed: 




diff  --git a/llvm/include/llvm/Support/GenericDomTree.h 
b/llvm/include/llvm/Support/GenericDomTree.h
index 4bed550f44c0..d2d7c8c4481d 100644
--- a/llvm/include/llvm/Support/GenericDomTree.h
+++ b/llvm/include/llvm/Support/GenericDomTree.h
@@ -554,7 +554,6 @@ class DominatorTreeBase {
   /// obtained PostViewCFG is the desired end state.
   void applyUpdates(ArrayRef Updates,
 ArrayRef PostViewUpdates) {
-// GraphDiff *PostViewCFG = nullptr) {
 if (Updates.empty()) {
   GraphDiff PostViewCFG(PostViewUpdates);
   DomTreeBuilder::ApplyUpdates(*this, PostViewCFG, &PostViewCFG);



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 1289835 - [MemorySSA/docs] Extend MemorySSA documentation.

2020-12-09 Thread Alina Sbirlea via llvm-branch-commits

Author: Alina Sbirlea
Date: 2020-12-09T18:00:16-08:00
New Revision: 1289835a96ebc3a7567c949011a3f7fe87dbc6d5

URL: 
https://github.com/llvm/llvm-project/commit/1289835a96ebc3a7567c949011a3f7fe87dbc6d5
DIFF: 
https://github.com/llvm/llvm-project/commit/1289835a96ebc3a7567c949011a3f7fe87dbc6d5.diff

LOG: [MemorySSA/docs] Extend MemorySSA documentation.

Added: 


Modified: 
llvm/docs/MemorySSA.rst

Removed: 




diff  --git a/llvm/docs/MemorySSA.rst b/llvm/docs/MemorySSA.rst
index d6ab667613a1..224b57d54255 100644
--- a/llvm/docs/MemorySSA.rst
+++ b/llvm/docs/MemorySSA.rst
@@ -230,6 +230,19 @@ be using. Walkers were built to be flexible, though, so 
it's entirely reasonable
 (and expected) to create more specialized walkers (e.g. one that specifically
 queries ``GlobalsAA``, one that always stops at ``MemoryPhi`` nodes, etc).
 
+Default walker APIs
+^^^
+
+There are two main APIs used to retrive the clobbering access using the walker:
+
+-  ``MemoryAccess *getClobberingMemoryAccess(MemoryAccess *MA);`` return the
+   clobbering memory access for ``MA``, caching all intermediate results
+   computed along the way as part of each access queried.
+
+-  ``MemoryAccess *getClobberingMemoryAccess(MemoryAccess *MA, const 
MemoryLocation &Loc);``
+   returns the access clobbering memory location ``Loc``, starting at ``MA``.
+   Because this API does not request the clobbering access of a specific memory
+   access, there are no results that can be cached.
 
 Locating clobbers yourself
 ^^
@@ -394,3 +407,9 @@ useful guarantee - all loads are optimized to point at the 
thing that
 actually clobbers them. This gives some nice properties.  For example,
 for a given store, you can find all loads actually clobbered by that
 store by walking the immediate uses of the store.
+
+LLVM Developers Meeting presentations
+-
+
+- `2016 LLVM Developers' Meeting: G. Burgess - MemorySSA in Five Minutes 
`_.
+- `2020 LLVM Developers' Meeting: S. Baziotis & S. Moll - Finding Your Way 
Around the LLVM Dependence Analysis Zoo 
`_



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits