Skip to content

[NFC] Remove adhoc definition of MDMapT in IRMover #118626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

…neFunctionInto

Summary:
Moving the cloning of BBs after the metadata makes the flow of the
function a bit more straightforward and makes it easier to extract more
into helper functions.

Test Plan:
ninja check-llvm-unit check-llvm

stack-info: PR: #118621, branch: users/artempyanykh/fast-coro-upstream/2
Summary:
Extract the logic to build up a metadata map to use in metadata cloning
into a separate function.

Test Plan:
ninja check-llvm-unit check-llvm

stack-info: PR: #118622, branch: users/artempyanykh/fast-coro-upstream/3
Summary:
The new API expects the caller to populate the VMap. We need it this way
for a subsequent change around coroutine cloning.

Test Plan:
ninja check-llvm-unit check-llvm

stack-info: PR: #118623, branch: users/artempyanykh/fast-coro-upstream/4
Summary:
This and previously extracted `CloneFunction*Into` functions will be used in later diffs.

Test Plan:
ninja check-llvm-unit check-llvm

stack-info: PR: #118624, branch: users/artempyanykh/fast-coro-upstream/5
Summary:
Previously, we'd add all SPs distinct from the cloned one into a set.
Then when cloning a local scope we'd check if it's from one of those
'distinct' SPs by checking if it's in the set. We don't need to do that.
We can just check against the cloned SP directly and drop the set.

Test Plan:
ninja check-llvm-unit check-llvm

stack-info: PR: #118625, branch: users/artempyanykh/fast-coro-upstream/6
Summary:
The typedef was there probably because the type alias in ValueMap was private.

Test Plan:
ninja check-llvm-unit check-llvm

stack-info: PR: #118626, branch: users/artempyanykh/fast-coro-upstream/7
@llvmbot llvmbot added the LTO Link time optimization (regular/full LTO or ThinLTO) label Dec 4, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 4, 2024

@llvm/pr-subscribers-lto

Author: Artem Pianykh (artempyanykh)

Changes

[NFC] Remove adhoc definition of MDMapT in IRMover

Summary:
The typedef was there probably because the type alias in ValueMap was private.

Test Plan:
ninja check-llvm-unit check-llvm


Full diff: https://github.com/llvm/llvm-project/pull/118626.diff

2 Files Affected:

  • (modified) llvm/include/llvm/Linker/IRMover.h (+1-3)
  • (modified) llvm/lib/Linker/IRMover.cpp (-3)
diff --git a/llvm/include/llvm/Linker/IRMover.h b/llvm/include/llvm/Linker/IRMover.h
index 1e3c5394ffa2af..89e9cbe0be18e1 100644
--- a/llvm/include/llvm/Linker/IRMover.h
+++ b/llvm/include/llvm/Linker/IRMover.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/FunctionExtras.h"
+#include "llvm/IR/ValueMap.h"
 #include <functional>
 
 namespace llvm {
@@ -41,9 +42,6 @@ class IRMover {
     static bool isEqual(const StructType *LHS, const StructType *RHS);
   };
 
-  /// Type of the Metadata map in \a ValueToValueMapTy.
-  typedef DenseMap<const Metadata *, TrackingMDRef> MDMapT;
-
 public:
   class IdentifiedStructTypeSet {
     // The set of opaque types is the composite module.
diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp
index a0c3f2c5b0baf6..76af83df00cba2 100644
--- a/llvm/lib/Linker/IRMover.cpp
+++ b/llvm/lib/Linker/IRMover.cpp
@@ -373,9 +373,6 @@ class LocalValueMaterializer final : public ValueMaterializer {
   Value *materialize(Value *V) override;
 };
 
-/// Type of the Metadata map in \a ValueToValueMapTy.
-typedef DenseMap<const Metadata *, TrackingMDRef> MDMapT;
-
 /// This is responsible for keeping track of the state used for moving data
 /// from SrcM to DstM.
 class IRLinker {

@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream/7 branch from 7986937 to b698e06 Compare December 4, 2024 13:16
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream/6 branch from e74ea37 to 302580a Compare December 4, 2024 13:16
jollaitbot pushed a commit to sailfishos-mirror/llvm-project that referenced this pull request Dec 4, 2024
Summary:
The typedef was there probably because the type alias in ValueMap was private.

Test Plan:
ninja check-llvm-unit check-llvm

stack-info: PR: llvm/llvm-project#118626, branch: users/artempyanykh/fast-coro-upstream/7
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream/6 branch from 302580a to 1b7941e Compare December 6, 2024 12:43
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream/7 branch from b698e06 to f0e2d2b Compare December 6, 2024 12:43
@artempyanykh artempyanykh force-pushed the users/artempyanykh/fast-coro-upstream/6 branch from 1b7941e to 51e786e Compare December 6, 2024 14:04
@artempyanykh
Copy link
Contributor Author

Abandoned due to a change in #118622.

@artempyanykh artempyanykh deleted the users/artempyanykh/fast-coro-upstream/7 branch December 6, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTO Link time optimization (regular/full LTO or ThinLTO)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants