[flang][hlfir] relax the strictness of intrinsic verifiers
authorTom Eccles <tom.eccles@arm.com>
Fri, 2 Jun 2023 16:53:20 +0000 (16:53 +0000)
committerTom Eccles <tom.eccles@arm.com>
Wed, 7 Jun 2023 14:36:14 +0000 (14:36 +0000)
commit89227b670dcf60f1a7e75f57de8f88bad430d5c8
tree7d0bba9dd6f3256f464daf34300ea6398b9815f5
parent6efb2afc9fdf7ae48e7423123df0776b3fade8fd
[flang][hlfir] relax the strictness of intrinsic verifiers

The verifiers for hlfir.matmul and hlfir.transpose try to ensure that
the shape of the result value makes sense given the shapes of the input
argument(s).

It there are some cases in the gfortran tests where lowering knows a bit
more about shape information than (HL)FIR. I think the cases here will be
solved when hlfir.shape_meet is implemented.

But in the meantime, and to improve robustness, I've relaxed the
verifier to allow the return type to have more precise shape information
than can be deduced from the argument type(s).

Differential Revision: https://reviews.llvm.org/D152254
flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
flang/test/Lower/HLFIR/matmul.f90
flang/test/Lower/HLFIR/transpose.f90