diff --git a/mlir/include/mlir/Dialect/SCF/IR/SCF.h b/mlir/include/mlir/Dialect/SCF/IR/SCF.h --- a/mlir/include/mlir/Dialect/SCF/IR/SCF.h +++ b/mlir/include/mlir/Dialect/SCF/IR/SCF.h @@ -63,7 +63,11 @@ using ValueVector = std::vector; using LoopVector = std::vector; struct LoopNest { - ResultRange getResults() { return loops.front().getResults(); } + ValueRange getResults() { + if (loops.empty()) + return llvm::None; + return loops.front().getResults(); + } LoopVector loops; };