This is an archive of the discontinued LLVM Phabricator instance.

[flang][hlfir] relax the strictness of intrinsic verifiers
ClosedPublic

Authored by tblah on Jun 6 2023, 4:12 AM.

Details

Summary

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).

Diff Detail

Event Timeline

tblah created this revision.Jun 6 2023, 4:12 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 6 2023, 4:12 AM
tblah requested review of this revision.Jun 6 2023, 4:12 AM
vzakhari accepted this revision.Jun 6 2023, 3:42 PM

Thank you!

This revision is now accepted and ready to land.Jun 6 2023, 3:42 PM
flang/test/Lower/HLFIR/matmul.f90
23

Should we test the generated IR? If not, at least a check for the subroutine label?

tblah updated this revision to Diff 529275.Jun 7 2023, 6:07 AM

Thanks for taking a look. The intention of that test was just to make sure the
verifier didn't return an error (which would be reflected in flang's exit code).

I have expanded it to check some of the generated IR.

tblah updated this revision to Diff 529279.Jun 7 2023, 6:23 AM

Check label in transpose test

This revision was automatically updated to reflect the committed changes.