forked from OSchip/llvm-project
[mlir] Use value_or (NFC)
This commit is contained in:
parent
620ca754e3
commit
2789c4f51c
|
@ -205,8 +205,7 @@ struct AllocaOpLowering : public AllocLikeOpLLVMLowering {
|
|||
auto elementPtrType = this->getElementPtrType(allocaOp.getType());
|
||||
|
||||
auto allocatedElementPtr = rewriter.create<LLVM::AllocaOp>(
|
||||
loc, elementPtrType, sizeBytes,
|
||||
allocaOp.getAlignment() ? *allocaOp.getAlignment() : 0);
|
||||
loc, elementPtrType, sizeBytes, allocaOp.getAlignment().value_or(0));
|
||||
|
||||
return std::make_tuple(allocatedElementPtr, allocatedElementPtr);
|
||||
}
|
||||
|
|
|
@ -426,7 +426,7 @@ struct NVGPUAsyncWaitLowering
|
|||
matchAndRewrite(nvgpu::DeviceAsyncWaitOp op, OpAdaptor adaptor,
|
||||
ConversionPatternRewriter &rewriter) const override {
|
||||
// If numGroup is not present pick 0 as a conservative correct value.
|
||||
int32_t numGroups = adaptor.getNumGroups() ? *adaptor.getNumGroups() : 0;
|
||||
int32_t numGroups = adaptor.getNumGroups().value_or(0);
|
||||
rewriter.create<NVVM::CpAsyncWaitGroupOp>(op.getLoc(), numGroups);
|
||||
rewriter.eraseOp(op);
|
||||
return success();
|
||||
|
|
Loading…
Reference in New Issue