[Mlir-commits] [mlir] [mlir][Interfaces] `LoopLikeOpInterface`: Add helper to get yielded values (PR #67305)

Matthias Springer llvmlistbot at llvm.org
Thu Oct 5 09:06:24 PDT 2023


================
@@ -1972,6 +1972,12 @@ mlir::Value fir::IterWhileOp::blockArgToSourceOp(unsigned blockArgNum) {
   return {};
 }
 
+mlir::ValueRange fir::IterWhileOp::getYieldedValues() {
+  auto *term = getRegion().front().getTerminator();
+  return getFinalValue() ? term->getOperands().drop_front()
----------------
matthias-springer wrote:

Yes that's correct.  (There is similar code in the op verifier: `auto opResults = getFinalValue() ? getResults().drop_front() : getResults();`)

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


More information about the Mlir-commits mailing list