diff --git a/compiler/src/iree/compiler/Preprocessing/Common/MakeSingleDispatchForFunction.cpp b/compiler/src/iree/compiler/Preprocessing/Common/MakeSingleDispatchForFunction.cpp index 727f3f3af2e3..24b4ddd9312c 100644 --- a/compiler/src/iree/compiler/Preprocessing/Common/MakeSingleDispatchForFunction.cpp +++ b/compiler/src/iree/compiler/Preprocessing/Common/MakeSingleDispatchForFunction.cpp @@ -128,7 +128,7 @@ void MakeSingleDispatchForFunctionPass::runOnOperation() { for (auto result : results) { auto shapedType = dyn_cast(result.getType()); - if (!shapedType.hasStaticShape()) { + if (!shapedType || !shapedType.hasStaticShape()) { emitError(result.getLoc()) << "unhandled dynamic dimensions for created dispatch region"; return signalPassFailure();