[Mlir-commits] [mlir] [mlir][sparse] add canonicalization patterns for IterateOp. (PR #95569)

Aart Bik llvmlistbot at llvm.org
Fri Jun 14 10:08:26 PDT 2024


================
@@ -1601,6 +1601,13 @@ def IterateOp : SparseTensor_Op<"iterate",
     BlockArgument getIterator() {
       return getRegion().getArguments().front();
     }
+    std::optional<BlockArgument> getLvlCrd(Level lvl) {
+      if (getCrdUsedLvls()[lvl]) {
+        uint64_t mask = (1 << lvl) - 1;
----------------
aartbik wrote:

I think this needs to be

 (static_cast<uint64_t>(0x01u) << lvls)

to make sure the first shift happens in 64-bit prec

https://github.com/llvm/llvm-project/pull/95569


More information about the Mlir-commits mailing list