Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
flang/tools/tco/tco.cpp
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | if (emitFir) { | ||||
if (mlir::failed(passPipeline.addToPipeline(pm, errorHandler))) | if (mlir::failed(passPipeline.addToPipeline(pm, errorHandler))) | ||||
return mlir::failure(); | return mlir::failure(); | ||||
} else { | } else { | ||||
if (codeGenLLVM) { | if (codeGenLLVM) { | ||||
// Run only CodeGen passes. | // Run only CodeGen passes. | ||||
fir::createDefaultFIRCodeGenPassPipeline(pm); | fir::createDefaultFIRCodeGenPassPipeline(pm); | ||||
} else { | } else { | ||||
// Run tco with O2 by default. | // Run tco with O2 by default. | ||||
fir::createMLIRToLLVMPassPipeline(pm, llvm::OptimizationLevel::O2); | fir::createMLIRToLLVMPassPipeline(pm, false, llvm::OptimizationLevel::O2); | ||||
} | } | ||||
fir::addLLVMDialectToLLVMPass(pm, out.os()); | fir::addLLVMDialectToLLVMPass(pm, out.os()); | ||||
} | } | ||||
// run the pass manager | // run the pass manager | ||||
if (mlir::succeeded(pm.run(*owningRef))) { | if (mlir::succeeded(pm.run(*owningRef))) { | ||||
// passes ran successfully, so keep the output | // passes ran successfully, so keep the output | ||||
if ((emitFir || passPipeline.hasAnyOccurrences()) && !codeGenLLVM) | if ((emitFir || passPipeline.hasAnyOccurrences()) && !codeGenLLVM) | ||||
Show All 26 Lines |