summaryrefslogtreecommitdiff
path: root/flang/lib/Optimizer/Dialect/FIROps.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang/lib/Optimizer/Dialect/FIROps.cpp')
-rw-r--r--flang/lib/Optimizer/Dialect/FIROps.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/flang/lib/Optimizer/Dialect/FIROps.cpp b/flang/lib/Optimizer/Dialect/FIROps.cpp
index 75ca738211ab..84711c540658 100644
--- a/flang/lib/Optimizer/Dialect/FIROps.cpp
+++ b/flang/lib/Optimizer/Dialect/FIROps.cpp
@@ -272,8 +272,6 @@ mlir::LogicalResult fir::AllocaOp::verify() {
mlir::Type outType = getType();
if (!mlir::isa<fir::ReferenceType>(outType))
return emitOpError("must be a !fir.ref type");
- if (fir::isa_unknown_size_box(fir::dyn_cast_ptrEleTy(outType)))
- return emitOpError("cannot allocate !fir.box of unknown rank or type");
return mlir::success();
}
@@ -1060,9 +1058,9 @@ void fir::BoxRankOp::getEffects(
llvm::SmallVectorImpl<
mlir::SideEffects::EffectInstance<mlir::MemoryEffects::Effect>>
&effects) {
- mlir::Value inputBox = getBox();
- if (fir::isBoxAddress(inputBox.getType()))
- effects.emplace_back(mlir::MemoryEffects::Read::get(), inputBox,
+ mlir::OpOperand &inputBox = getBoxMutable();
+ if (fir::isBoxAddress(inputBox.get().getType()))
+ effects.emplace_back(mlir::MemoryEffects::Read::get(), &inputBox,
mlir::SideEffects::DefaultResource::get());
}
@@ -1432,7 +1430,8 @@ bool fir::ConvertOp::canBeConverted(mlir::Type inType, mlir::Type outType) {
mlir::LogicalResult fir::ConvertOp::verify() {
if (canBeConverted(getValue().getType(), getType()))
return mlir::success();
- return emitOpError("invalid type conversion");
+ return emitOpError("invalid type conversion")
+ << getValue().getType() << " / " << getType();
}
//===----------------------------------------------------------------------===//
@@ -2902,9 +2901,9 @@ void fir::ReboxAssumedRankOp::getEffects(
llvm::SmallVectorImpl<
mlir::SideEffects::EffectInstance<mlir::MemoryEffects::Effect>>
&effects) {
- mlir::Value inputBox = getBox();
- if (fir::isBoxAddress(inputBox.getType()))
- effects.emplace_back(mlir::MemoryEffects::Read::get(), inputBox,
+ mlir::OpOperand &inputBox = getBoxMutable();
+ if (fir::isBoxAddress(inputBox.get().getType()))
+ effects.emplace_back(mlir::MemoryEffects::Read::get(), &inputBox,
mlir::SideEffects::DefaultResource::get());
}
@@ -3792,8 +3791,6 @@ void fir::StoreOp::print(mlir::OpAsmPrinter &p) {
mlir::LogicalResult fir::StoreOp::verify() {
if (getValue().getType() != fir::dyn_cast_ptrEleTy(getMemref().getType()))
return emitOpError("store value type must match memory reference type");
- if (fir::isa_unknown_size_box(getValue().getType()))
- return emitOpError("cannot store !fir.box of unknown rank or type");
return mlir::success();
}