[Mlir-commits] [mlir] Reimplementing target description concept using DLTI attribute (PR #92138)
Renato Golin
llvmlistbot at llvm.org
Tue May 14 10:23:32 PDT 2024
================
@@ -59,6 +75,41 @@ struct Canonicalizer : public impl::CanonicalizerBase<Canonicalizer> {
return success();
}
void runOnOperation() override {
+ Operation *op = getOperation();
+ uint32_t cpuID = 0;
+
+ if (isa<ModuleOp>(op)) {
+ if (std::optional<int64_t> v =
+ DataLayout(llvm::dyn_cast<ModuleOp>(*op))
+ .getCanonicalizerMaxIterations(cpuID)) {
+ config.maxIterations = *v;
+ }
+ } else {
+ ModuleOp moduleOp = op->getParentOfType<ModuleOp>();
+ if (std::optional<int64_t> v =
+ DataLayout(moduleOp).getCanonicalizerMaxIterations(cpuID)) {
+ config.maxIterations = *v;
+ }
+ }
+
+ if (isa<ModuleOp>(op)) {
+ if (std::optional<int64_t> v =
+ DataLayout(llvm::dyn_cast<ModuleOp>(*op))
+ .getCanonicalizerMaxNumRewrites(cpuID)) {
+ config.maxNumRewrites = *v;
+ }
+ } else {
+ ModuleOp moduleOp = op->getParentOfType<ModuleOp>();
+ if (std::optional<int64_t> v =
+ DataLayout(moduleOp).getCanonicalizerMaxNumRewrites(cpuID)) {
+ config.maxNumRewrites = *v;
+ }
+ }
+ LLVM_DEBUG(llvm::dbgs() << "[CostModel] Canonicalizer MaxIterations (new):"
----------------
rengolin wrote:
This is still here. We don't want any pass information here, just target info.
https://github.com/llvm/llvm-project/pull/92138
More information about the Mlir-commits
mailing list