[BACKEND] Still run llvm-opt but set optLevel to 0 to avoid the abs(float) bug (#1339)

https://github.com/openai/triton/issues/1337
This commit is contained in:
Keren Zhou
2023-03-14 15:38:57 -04:00
committed by GitHub
parent 6a8634e2a7
commit da0b0bfde6

View File

@@ -260,6 +260,15 @@ translateLLVMToLLVMIR(llvm::LLVMContext *llvmContext, mlir::ModuleOp module) {
return nullptr;
}
auto optPipeline = mlir::makeOptimizingTransformer(
/*optLevel=*/0, /*sizeLevel=*/0,
/*targetMachine=*/nullptr);
if (auto err = optPipeline(llvmModule.get())) {
llvm::errs() << "Failed to optimize LLVM IR " << err << "\n";
return nullptr;
}
for (auto &func : llvmModule->functions()) {
auto it = nvvmMetadata.find(func.getName());
if (it != nvvmMetadata.end())