We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ca10ef commit f1718a9Copy full SHA for f1718a9
mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
@@ -105,8 +105,11 @@ struct AllocaOpLowering : public AllocLikeOpLLVMLowering {
105
auto allocaOp = cast<memref::AllocaOp>(op);
106
auto elementType =
107
typeConverter->convertType(allocaOp.getType().getElementType());
108
- unsigned addrSpace =
109
- *getTypeConverter()->getMemRefAddressSpace(allocaOp.getType());
+ FailureOr<unsigned> maybeAddressSpace =
+ getTypeConverter()->getMemRefAddressSpace(allocaOp.getType());
110
+ if (failed(maybeAddressSpace))
111
+ return std::make_tuple(Value(), Value());
112
+ unsigned addrSpace = *maybeAddressSpace;
113
auto elementPtrType =
114
LLVM::LLVMPointerType::get(rewriter.getContext(), addrSpace);
115
0 commit comments