Skip to content

Commit

Permalink
[Backport 3.8] Remove function localization (#225) (#294)
Browse files Browse the repository at this point in the history
This PR removes function localization. These were capabilities that were
initially added during prototyping and were ultimately not expanded on.
They are currently just adding compilation time and in the future, if
these capabilities are required will likely be implemented differently.

---------

Co-authored-by: Thomas Alexander <[email protected]>
  • Loading branch information
bcdonovan and taalexander authored Mar 14, 2024
1 parent b0ded63 commit 3b575f4
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 527 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
fixes:
- |
Remove function localization pass as this is not being used for any
compilation features as was initially planned.
1 change: 0 additions & 1 deletion targets/systems/mock/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ qssc_add_plugin(QSSCTargetMock QSSC_TARGET_PLUGIN
Conversion/QUIRToStandard/QUIRToStandard.cpp
MockTarget.cpp
MockUtils.cpp
Transforms/FunctionLocalization.cpp
Transforms/QubitLocalization.cpp

ADDITIONAL_HEADER_DIRS
Expand Down
4 changes: 0 additions & 4 deletions targets/systems/mock/MockTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "Conversion/QUIRToLLVM/QUIRToLLVM.h"
#include "Conversion/QUIRToStandard/QUIRToStandard.h"
#include "Transforms/FunctionLocalization.h"
#include "Transforms/QubitLocalization.h"

#include "Dialect/QUIR/Transforms/Passes.h"
Expand Down Expand Up @@ -154,7 +153,6 @@ MockSystem::MockSystem(std::unique_ptr<MockConfig> config)
} // MockSystem

llvm::Error MockSystem::registerTargetPasses() {
mlir::PassRegistration<MockFunctionLocalizationPass>();
mlir::PassRegistration<MockQubitLocalizationPass>();
mlir::PassRegistration<conversion::MockQUIRToStdPass>(
[]() -> std::unique_ptr<conversion::MockQUIRToStdPass> {
Expand All @@ -173,9 +171,7 @@ void mockPipelineBuilder(mlir::OpPassManager &pm) {
pm.addPass(std::make_unique<mlir::quir::RemoveQubitOperandsPass>());
pm.addPass(std::make_unique<mlir::quir::ClassicalOnlyDetectionPass>());
pm.addPass(std::make_unique<MockQubitLocalizationPass>());
pm.addPass(std::make_unique<SymbolTableBuildPass>());
OpPassManager &nestedModulePM = pm.nest<ModuleOp>();
nestedModulePM.addPass(std::make_unique<MockFunctionLocalizationPass>());
nestedModulePM.addPass(
std::make_unique<mlir::quir::FunctionArgumentSpecializationPass>());
} // mockPipelineBuilder
Expand Down
Loading

0 comments on commit 3b575f4

Please sign in to comment.