[PATCH] D75722: [mlir][Linalg] Implement padding for linalg.conv and lowering to loops.
Han-Chung Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 12 23:19:38 PDT 2020
hanchung added inline comments.
================
Comment at: mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp:189
+ ValueHandle zeroIndex = std_constant_index(0);
+ SmallVector<ValueHandle, 8> conds;
+ SmallVector<ValueHandle, 8> clampedImIdx;
----------------
mehdi_amini wrote:
> Do you need a vector here? Seems like you're only every using a single value (the last one) at a given time.
Yes, I need a vector here. The reason is that a ValueHandle can only be captured once.
================
Comment at: mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp:229
+ ValueHandle readInput = im(clampedImIdx);
+ return std_select(conds.back(), zero, readInput);
+ }
----------------
mehdi_amini wrote:
> What is the guarantee that `conds` isn't empty here?
In conv op, I think it will never happen. However, I updated the logic a bit and it looks simpler to me. Now it contains a true value in the beginning, so it's guarantee that `conds` isn't empty at all.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75722/new/
https://reviews.llvm.org/D75722
More information about the llvm-commits
mailing list