Skip to content

Commit 4ab4992

Browse files
committed
remove new over-assertive assert
I added an assert that prevents ExprType to be "trivial types" (i32, f32, ...) but that actually breaks existing lowering code that generate as_expr + associate patterns to create temporaries: https://github.com/llvm/llvm-project/blob/03b5f8f0f0d10c412842ed04b90e2217cf071218/flang/lib/Lower/ConvertCall.cpp#L1271 ``` subroutine trivial_as_expr(i) integer, optional :: i interface subroutine foo(j) integer, optional, value :: j end subroutine end interface call foo(i) end subroutine ``` This is unrelated to this patch, so leave it like this (it is not even a functional problem).
1 parent 2002996 commit 4ab4992

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

flang/lib/Optimizer/HLFIR/IR/HLFIRDialect.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,6 @@ mlir::Type hlfir::getExprType(mlir::Type variableType) {
220220
hlfir::ExprType::Shape typeShape;
221221
bool isPolymorphic = fir::isPolymorphicType(variableType);
222222
mlir::Type type = getFortranElementOrSequenceType(variableType);
223-
assert(!fir::isa_trivial(type) &&
224-
"numerical and logical scalar should not be wrapped in hlfir.expr");
225223
if (auto seqType = mlir::dyn_cast<fir::SequenceType>(type)) {
226224
assert(!seqType.hasUnknownShape() && "assumed-rank cannot be expressions");
227225
typeShape.append(seqType.getShape().begin(), seqType.getShape().end());

0 commit comments

Comments
 (0)