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/IR/Value.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/IR/Value.cpp')
| -rw-r--r-- | mlir/lib/IR/Value.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mlir/lib/IR/Value.cpp b/mlir/lib/IR/Value.cpp index a2cb9910ab8..6418b062dc1 100644 --- a/mlir/lib/IR/Value.cpp +++ b/mlir/lib/IR/Value.cpp @@ -35,8 +35,6 @@ Function *Value::getFunction() { return cast<BlockArgument>(this)->getFunction(); case Value::Kind::InstResult: return getDefiningInst()->getFunction(); - case Value::Kind::ForInst: - return cast<ForInst>(this)->getFunction(); } } @@ -83,3 +81,9 @@ Function *BlockArgument::getFunction() { return owner->getFunction(); return nullptr; } + +/// Returns if the current argument is a function argument. +bool BlockArgument::isFunctionArgument() const { + auto *containingFn = getFunction(); + return containingFn && &containingFn->front() == getOwner(); +} |

