Skip to content

Commit

Permalink
Fix linking
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanradanov committed May 17, 2024
1 parent 84e115a commit 8895e52
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 26 deletions.
4 changes: 0 additions & 4 deletions include/polygeist/Passes/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ std::unique_ptr<Pass> createCPUifyPass(StringRef method = "");
std::unique_ptr<Pass> createBarrierRemovalContinuation();
std::unique_ptr<Pass> detectReductionPass();
std::unique_ptr<Pass> createRemoveTrivialUsePass();
#ifdef POLYGEIST_ENABLE_POLYMER
std::unique_ptr<Pass>
createAffineOptPass(polymer::PlutoOptPipelineOptions &plutoOpts);
#endif
std::unique_ptr<Pass> createAffineOptPass();
std::unique_ptr<Pass> createParallelLowerPass(
bool wrapParallelOps = false,
Expand Down
4 changes: 0 additions & 4 deletions lib/polygeist/Passes/AffineOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,6 @@ void AffineOptPass::runOnOperation() {
}
}

std::unique_ptr<Pass> mlir::polygeist::createAffineOptPass(
polymer::PlutoOptPipelineOptions &plutoOpts) {
return std::make_unique<AffineOptPass>(&plutoOpts);
}
std::unique_ptr<Pass> mlir::polygeist::createAffineOptPass() {
return std::make_unique<AffineOptPass>(nullptr);
}
Expand Down
20 changes: 7 additions & 13 deletions tools/cgeist/driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ using namespace llvm;

static cl::OptionCategory toolOptions("clang to mlir - tool options");

static cl::opt<std::string>
PolymerPlutoOpt("polymer-pluto-opt", cl::init(""),
cl::desc("Use polymer to optimize"));
static cl::opt<bool>
ClAffineOpt("affine-opt", cl::init(false),
cl::desc("Use polymer to optimize affine regions"));

static cl::opt<bool> CudaLower("cuda-lower", cl::init(false),
cl::desc("Add parallel loops around cuda"));
Expand Down Expand Up @@ -882,16 +882,10 @@ int main(int argc, char **argv) {
pm.addPass(mlir::createSymbolDCEPass());

#ifdef POLYGEIST_ENABLE_POLYMER
if (PolymerPlutoOpt.getNumOccurrences() > 0) {
auto plutoOpts =
polymer::PlutoOptPipelineOptions::createFromString(PolymerPlutoOpt);
if (!plutoOpts) {
llvm::errs() << "Could not parse --polymer-pluto-opt option: "
<< PolymerPlutoOpt << "\n";
abort();
}
pm.addPass(polygeist::createAffineOptPass(*plutoOpts));
pm.addPass(createInlinerPass());
if (ClAffineOpt) {
pm.addPass(polygeist::createAffineOptPass());
pm.addPass(mlir::polygeist::createPolygeistCanonicalizePass(
canonicalizerConfig, {}, {}));
}
#endif

Expand Down
13 changes: 8 additions & 5 deletions tools/polygeist-opt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ set(LIBS
MLIRPolygeist
MLIRPolygeistTransforms
MLIRFuncAllExtensions
)
)
if(POLYGEIST_ENABLE_POLYMER)
list(APPEND LIBS
PolymerTransforms)
PolymerTransforms
MLIRTranslateLib
MLIRFromLLVMIRTranslationRegistration
)
endif()
add_llvm_executable(polygeist-opt polygeist-opt.cpp)

install(TARGETS polygeist-opt
EXPORT PolygeistTargets
RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}
COMPONENT polygeist-opt)
EXPORT PolygeistTargets
RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}
COMPONENT polygeist-opt)

llvm_update_compile_flags(polygeist-opt)
target_link_libraries(polygeist-opt PRIVATE ${LIBS})

0 comments on commit 8895e52

Please sign in to comment.