diff options
| author | River Riddle <riverriddle@google.com> | 2019-01-26 12:40:12 -0800 |
|---|---|---|
| committer | jpienaar <jpienaar@google.com> | 2019-03-29 15:40:23 -0700 |
| commit | 36babbd7815519db5d26f55695fa3ec500997bcd (patch) | |
| tree | 9686f3f296ff2d849ffb2f69434e50b4e6fce901 /mlir/lib/Parser/Parser.cpp | |
| parent | 0e7a8a9027c5f5862c3c78f41c777ba2930f9b23 (diff) | |
| download | bcm5719-llvm-36babbd7815519db5d26f55695fa3ec500997bcd.tar.gz bcm5719-llvm-36babbd7815519db5d26f55695fa3ec500997bcd.zip | |
Change the ForInst induction variable to be a block argument of the body instead of the ForInst itself. This is a necessary step in converting ForInst into an operation.
PiperOrigin-RevId: 231064139
Diffstat (limited to 'mlir/lib/Parser/Parser.cpp')
| -rw-r--r-- | mlir/lib/Parser/Parser.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mlir/lib/Parser/Parser.cpp b/mlir/lib/Parser/Parser.cpp index ecb7fbc779e..c477ad1bbc5 100644 --- a/mlir/lib/Parser/Parser.cpp +++ b/mlir/lib/Parser/Parser.cpp @@ -3201,7 +3201,8 @@ ParseResult FunctionParser::parseForInst() { ubOperands, ubMap, step); // Create SSA value definition for the induction variable. - if (addDefinition({inductionVariableName, 0, loc}, forInst)) + if (addDefinition({inductionVariableName, 0, loc}, + forInst->getInductionVar())) return ParseFailure; // Try to parse the optional trailing location. @@ -3347,7 +3348,7 @@ ParseResult FunctionParser::parseBound(SmallVectorImpl<Value *> &operands, // Create an identity map using dim id for an induction variable and // symbol otherwise. This representation is optimized for storage. // Analysis passes may expand it into a multi-dimensional map if desired. - if (isa<ForInst>(operands[0])) + if (isForInductionVar(operands[0])) map = builder.getDimIdentityMap(); else map = builder.getSymbolIdentityMap(); |

