Skip to content

[IR] Remove variants of dropUnknownNonDebugMetadata #98854

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

kazutakahirata
Copy link
Contributor

This patch removes:

  • dropUnknownNonDebugMetadata()
  • dropUnknownNonDebugMetadata(ID1)
  • dropUnknownNonDebugMetadata(ID1, ID2)

The first variant has existing uses, but we can accommodate those by
adding a default parameter to the main variant.

The second and third variant do not have any existing use AFAICT.

This patch removes:

- dropUnknownNonDebugMetadata()
- dropUnknownNonDebugMetadata(ID1)
- dropUnknownNonDebugMetadata(ID1, ID2)

The first variant has existing uses, but we can accommodate those by
adding a default parameter to the main variant.

The second and third variant do not have any existing use AFAICT.
@kazutakahirata kazutakahirata requested a review from nikic July 15, 2024 02:49
@llvmbot
Copy link
Member

llvmbot commented Jul 15, 2024

@llvm/pr-subscribers-llvm-ir

Author: Kazu Hirata (kazutakahirata)

Changes

This patch removes:

  • dropUnknownNonDebugMetadata()
  • dropUnknownNonDebugMetadata(ID1)
  • dropUnknownNonDebugMetadata(ID1, ID2)

The first variant has existing uses, but we can accommodate those by
adding a default parameter to the main variant.

The second and third variant do not have any existing use AFAICT.


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

1 Files Affected:

  • (modified) llvm/include/llvm/IR/Instruction.h (+1-11)
diff --git a/llvm/include/llvm/IR/Instruction.h b/llvm/include/llvm/IR/Instruction.h
index 7a9b95f23465c..c27572300d506 100644
--- a/llvm/include/llvm/IR/Instruction.h
+++ b/llvm/include/llvm/IR/Instruction.h
@@ -433,17 +433,7 @@ class Instruction : public User,
   /// convenience method for passes to do so.
   /// dropUBImplyingAttrsAndUnknownMetadata should be used instead of
   /// this API if the Instruction being modified is a call.
-  void dropUnknownNonDebugMetadata(ArrayRef<unsigned> KnownIDs);
-  void dropUnknownNonDebugMetadata() {
-    return dropUnknownNonDebugMetadata(std::nullopt);
-  }
-  void dropUnknownNonDebugMetadata(unsigned ID1) {
-    return dropUnknownNonDebugMetadata(ArrayRef(ID1));
-  }
-  void dropUnknownNonDebugMetadata(unsigned ID1, unsigned ID2) {
-    unsigned IDs[] = {ID1, ID2};
-    return dropUnknownNonDebugMetadata(IDs);
-  }
+  void dropUnknownNonDebugMetadata(ArrayRef<unsigned> KnownIDs = std::nullopt);
   /// @}
 
   /// Adds an !annotation metadata node with \p Annotation to this instruction.

Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kazutakahirata kazutakahirata merged commit 2b5595b into llvm:main Jul 15, 2024
9 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_IR_dropUnknownNonDebugMetadata branch July 15, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants