Continued fixes
This commit is contained in:
parent
98cc0fe7a9
commit
32c474df19
|
@ -1160,7 +1160,6 @@ void AffineCFGPass::runOnFunction() {
|
|||
applyPatternsAndFoldGreedily(getFunction().getOperation(), std::move(rpl),
|
||||
config);
|
||||
}
|
||||
getFunction().dump();
|
||||
}
|
||||
|
||||
std::unique_ptr<OperationPass<FuncOp>> mlir::polygeist::replaceAffineCFGPass() {
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 5616a79398c7f10d92daf7d6387b195e95f2ac7e
|
||||
Subproject commit e9a3637c0ca4772aeee55cd09d98a68b19e18621
|
|
@ -2973,8 +2973,6 @@ static bool parseMLIR(const char *Argv0, std::vector<std::string> filenames,
|
|||
Clang->getHeaderSearchOpts().ResourceDir.size() == 0)
|
||||
Clang->getHeaderSearchOpts().ResourceDir =
|
||||
CompilerInvocation::GetResourcesPath(Argv0, GetExecutablePathVP);
|
||||
|
||||
llvm::errs() << " resourcedir: " << Clang->getHeaderSearchOpts().ResourceDir << "\n";
|
||||
//}
|
||||
Clang->getInvocation().getFrontendOpts().DisableFree = false;
|
||||
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
#include "mlir/IR/MLIRContext.h"
|
||||
#include "mlir/IR/OpDefinition.h"
|
||||
#include "mlir/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.h"
|
||||
#include "mlir/Target/LLVMIR/TypeTranslation.h"
|
||||
#include "mlir/Target/LLVMIR/TypeFromLLVM.h"
|
||||
#include "mlir/Target/LLVMIR/TypeToLLVM.h"
|
||||
#include "llvm/IR/DerivedTypes.h"
|
||||
|
||||
#include "polygeist/Ops.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: mlir-clang %s | FileCheck %s
|
||||
// RUN: mlir-clang %s %stdinclude | FileCheck %s
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: mlir-clang %s --function=caller | FileCheck %s
|
||||
// RUN: mlir-clang %s --function=caller %stdinclude | FileCheck %s
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
// RUN: mlir-clang %s -detect-reduction --function=kernel_nussinov | FileCheck %s
|
||||
|
||||
#define max_score(s1, s2) ((s1 >= s2) ? s1 : s2)
|
||||
|
||||
void kernel_nussinov(int n, double table[20][60]) {
|
||||
int i, j, k;
|
||||
|
||||
#pragma scop
|
||||
i =0;
|
||||
// for (j=i+1; j<_PB_N; j++) {
|
||||
j = 0;
|
||||
for (k=0; k<j; k++) {
|
||||
table[i][j] = max_score(table[i][j], table[i][k] + table[k+1][j]);
|
||||
}
|
||||
//}
|
||||
#pragma endscop
|
||||
|
||||
}
|
|
@ -9,7 +9,7 @@
|
|||
// RUN: rm -f %s.exec2 %s.execm
|
||||
|
||||
// RUN: clang %s -O3 %stdinclude %polyverify -o %s.exec1 && %s.exec1 &> %s.out1
|
||||
// RUN: mlir-clang %s %polyverify %stdinclude -detect-reduction -emit-llvm | clang -x ir - -O3 -o %s.execm && %s.execm &> %s.out2
|
||||
// RUN: mlir-clang %s %polyverify %stdinclude -detect-reduction -emit-llvm | clang -x ir - -O3 -o %s.execm -lm && %s.execm &> %s.out2
|
||||
// RUN: rm -f %s.exec1 %s.execm
|
||||
// RUN: diff %s.out1 %s.out2
|
||||
// RUN: rm -f %s.out1 %s.out2
|
||||
|
|
|
@ -157,8 +157,6 @@ int main(int argc, char **argv) {
|
|||
optPM.addPass(polygeist::createRaiseSCFToAffinePass());
|
||||
optPM.addPass(polygeist::replaceAffineCFGPass());
|
||||
}
|
||||
if (DetectReduction)
|
||||
optPM.addPass(polygeist::detectReductionPass());
|
||||
if (mlir::failed(pm.run(module))) {
|
||||
module.dump();
|
||||
return 4;
|
||||
|
@ -167,12 +165,15 @@ int main(int argc, char **argv) {
|
|||
module.dump();
|
||||
return 5;
|
||||
}
|
||||
|
||||
module.dump();
|
||||
#define optPM optPM2
|
||||
#define pm pm2
|
||||
mlir::PassManager pm(&context);
|
||||
mlir::OpPassManager &optPM = pm.nest<mlir::FuncOp>();
|
||||
|
||||
if (DetectReduction)
|
||||
optPM.addPass(polygeist::detectReductionPass());
|
||||
|
||||
optPM.addPass(mlir::createCanonicalizerPass());
|
||||
optPM.addPass(mlir::createCSEPass());
|
||||
optPM.addPass(mlir::createCanonicalizerPass());
|
||||
|
|
Loading…
Reference in New Issue