[PATCH] D77707: [mlir] Eliminate the remaining usages of cl::opt instead of PassOption.

Uday Bondhugula via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 7 23:22:50 PDT 2020


bondhugula accepted this revision.
bondhugula added inline comments.
This revision is now accepted and ready to land.


================
Comment at: mlir/include/mlir/Dialect/Affine/Passes.td:54
+  let options = [
+    Option<"cacheSize", "cache-size", "uint64_t", /*default=*/"512",
+           "Set size of cache to tile for in KiB">,
----------------
This should be changed to cacheSizeInKiB but I can do it. 


================
Comment at: mlir/include/mlir/Pass/PassOptions.h:45
 
+    /// Return if this option has any value assigned to it.
+    bool hasValue() const { return optHasValue; }
----------------
-> Returns true if ...


================
Comment at: mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp:332
   // Check how many times larger the cache size is when compared to footprint.
+  uint64_t cacheSizeBytes = cacheSize * 1024;
   uint64_t excessFactor = llvm::divideCeil(fp.getValue(), cacheSizeBytes);
----------------
cacheSize should be changed to cacheSizeInKiB - but I can do it in another revision. 


================
Comment at: mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp:162
       unrollFactor == -1 ? None : Optional<unsigned>(unrollFactor),
-      unrollFull == -1 ? None : Optional<bool>(unrollFull), getUnrollFactor);
+      unrollFull == -1 ? false : unrollFull, getUnrollFactor);
 }
----------------
unrollFull can be bool? If not, this check can be (unrollFull != -1) instead of ternary.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77707/new/

https://reviews.llvm.org/D77707





More information about the llvm-commits mailing list