Skip to content

[mlir][EmitC] Drop unused code (NFC) #80325

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

Merged
merged 1 commit into from
Feb 4, 2024
Merged

[mlir][EmitC] Drop unused code (NFC) #80325

merged 1 commit into from
Feb 4, 2024

Conversation

marbre
Copy link
Member

@marbre marbre commented Feb 1, 2024

To register the conversion the autogenerated function registerSCFToEmitC() calls createSCFToEmitC(), which itself is also autogenerated. The removed function, however, isn't used in the upstream codebase.

To register the conversion the autogenerated function
`registerSCFToEmitC()` calls `createSCFToEmitC()`, which itself is also
autogenerated. The removed function, however, isn't used in the upstream
codebase.
@llvmbot
Copy link
Member

llvmbot commented Feb 1, 2024

@llvm/pr-subscribers-mlir

Author: Marius Brehler (marbre)

Changes

To register the conversion the autogenerated function registerSCFToEmitC() calls createSCFToEmitC(), which itself is also autogenerated. The removed function, however, isn't used in the upstream codebase.


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

2 Files Affected:

  • (modified) mlir/include/mlir/Conversion/SCFToEmitC/SCFToEmitC.h (-4)
  • (modified) mlir/lib/Conversion/SCFToEmitC/SCFToEmitC.cpp (-4)
diff --git a/mlir/include/mlir/Conversion/SCFToEmitC/SCFToEmitC.h b/mlir/include/mlir/Conversion/SCFToEmitC/SCFToEmitC.h
index 7ff682293f48b..22df7f1c5dcf2 100644
--- a/mlir/include/mlir/Conversion/SCFToEmitC/SCFToEmitC.h
+++ b/mlir/include/mlir/Conversion/SCFToEmitC/SCFToEmitC.h
@@ -20,10 +20,6 @@ class RewritePatternSet;
 
 /// Collect a set of patterns to convert SCF operations to the EmitC dialect.
 void populateSCFToEmitCConversionPatterns(RewritePatternSet &patterns);
-
-/// Creates a pass to convert SCF operations to the EmitC dialect.
-std::unique_ptr<Pass> createConvertSCFToEmitCPass();
-
 } // namespace mlir
 
 #endif // MLIR_CONVERSION_SCFTOEMITC_SCFTOEMITC_H
diff --git a/mlir/lib/Conversion/SCFToEmitC/SCFToEmitC.cpp b/mlir/lib/Conversion/SCFToEmitC/SCFToEmitC.cpp
index bf69ba503f4e6..367142a520742 100644
--- a/mlir/lib/Conversion/SCFToEmitC/SCFToEmitC.cpp
+++ b/mlir/lib/Conversion/SCFToEmitC/SCFToEmitC.cpp
@@ -199,7 +199,3 @@ void SCFToEmitCPass::runOnOperation() {
           applyPartialConversion(getOperation(), target, std::move(patterns))))
     signalPassFailure();
 }
-
-std::unique_ptr<Pass> mlir::createConvertSCFToEmitCPass() {
-  return std::make_unique<SCFToEmitCPass>();
-}

@aniragil
Copy link
Contributor

aniragil commented Feb 4, 2024

Looks like I meant to follow the SCFToCF example but left out the let constructor = ... line, which would have used the removed function in the register function. Anyway, seems there's no need to override the auto-generated constructor, so LGTM. Thanks for fixing this @marbre !

@marbre
Copy link
Member Author

marbre commented Feb 4, 2024

Looks like I meant to follow the SCFToCF example but left out the let constructor = ... line, which would have used the removed function in the register function. Anyway, seems there's no need to override the auto-generated constructor, so LGTM. Thanks for fixing this @marbre !

Very gladly. Yes, this is likely the case. I nearly implemented something similar for FuncToEmitC and that is why I actually spotted this.

@marbre marbre merged commit dea855d into llvm:main Feb 4, 2024
@marbre marbre deleted the scftoemitc branch February 4, 2024 17:51
@marbre
Copy link
Member Author

marbre commented Feb 4, 2024

Just after merging my changes, I noticed that you're comment could likely be interpreted as approval but that it technically wasn't a GitHub PR approval. I missed this and hope that merging was fine anyway.

@aniragil
Copy link
Contributor

aniragil commented Feb 5, 2024

Just after merging my changes, I noticed that you're comment could likely be interpreted as approval but that it technically wasn't a GitHub PR approval. I missed this and hope that merging was fine anyway.

Yes it was! (didn't approve at the time only since the Windows build failed)

@marbre
Copy link
Member Author

marbre commented Feb 5, 2024

Just after merging my changes, I noticed that you're comment could likely be interpreted as approval but that it technically wasn't a GitHub PR approval. I missed this and hope that merging was fine anyway.

Yes it was! (didn't approve at the time only since the Windows build failed)

This was due to a Could NOT find Python3 error with occurs since several days on Windows only, thus this is unrelated.

agozillon pushed a commit to agozillon/llvm-project that referenced this pull request Feb 5, 2024
To register the conversion the autogenerated function
`registerSCFToEmitC()` calls `createSCFToEmitC()`, which itself is also
autogenerated. The removed function, however, isn't used in the upstream
codebase.
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.

3 participants