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

Matthias Springer via flang-commits flang-commits at lists.llvm.org
Thu Oct 5 09:06:22 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 flang-commits mailing list