[PATCH] D77526: [MLIR] Change return type of ParallelOp::getInductionVars to ValueRange.
Alexander Belyaev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 6 00:29:52 PDT 2020
pifon2a created this revision.
Herald added subscribers: llvm-commits, grosul1, Joonsoo, liufengdb, lucyrfox, mgester, arpith-jacob, csigg, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar, rriddle, mehdi_amini.
Herald added a reviewer: nicolasvasilache.
Herald added a reviewer: herhut.
Herald added a project: LLVM.
pifon2a edited the summary of this revision.
pifon2a edited reviewers, added: bkramer; removed: nicolasvasilache.
Herald added a reviewer: nicolasvasilache.
Also remove getNumInductionVars(), since there is getNumLoops().
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D77526
Files:
mlir/include/mlir/Dialect/LoopOps/LoopOps.td
mlir/lib/Dialect/GPU/Transforms/ParallelLoopMapper.cpp
Index: mlir/lib/Dialect/GPU/Transforms/ParallelLoopMapper.cpp
===================================================================
--- mlir/lib/Dialect/GPU/Transforms/ParallelLoopMapper.cpp
+++ mlir/lib/Dialect/GPU/Transforms/ParallelLoopMapper.cpp
@@ -130,8 +130,8 @@
MLIRContext *ctx = parallelOp.getContext();
Builder b(ctx);
SmallVector<ParallelLoopDimMapping, 4> attrs;
- attrs.reserve(parallelOp.getNumInductionVars());
- for (int i = 0, e = parallelOp.getNumInductionVars(); i < e; ++i) {
+ attrs.reserve(parallelOp.getNumLoops());
+ for (int i = 0, e = parallelOp.getNumLoops(); i < e; ++i) {
attrs.push_back(getParallelLoopDimMappingAttr(
getHardwareIdForMapping(mappingLevel, i), b.getDimIdentityMap(),
b.getDimIdentityMap()));
Index: mlir/include/mlir/Dialect/LoopOps/LoopOps.td
===================================================================
--- mlir/include/mlir/Dialect/LoopOps/LoopOps.td
+++ mlir/include/mlir/Dialect/LoopOps/LoopOps.td
@@ -310,10 +310,7 @@
let extraClassDeclaration = [{
Block *getBody() { return ®ion().front(); }
- unsigned getNumInductionVars() {
- return getBody()->getNumArguments();
- }
- Block::BlockArgListType getInductionVars() {
+ ValueRange getInductionVars() {
return getBody()->getArguments();
}
unsigned getNumLoops() { return step().size(); }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77526.255230.patch
Type: text/x-patch
Size: 1378 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200406/253c3aa9/attachment.bin>
More information about the llvm-commits
mailing list