This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add better invalid argument warnings when folding with host runtime
AcceptedPublic

Authored by jeanPerier on Jan 10 2022, 5:52 AM.

Details

Summary

Currently, folding was emitting "invalid argument on intrinsic function"
when folding numerical intrinsics with the host runtime like acos(200.).

Add a way to register custom argument checks before folding with the
host runtime. If this checks emit warnings, the default message (that
came from the capture of floating point signals from the math library
call) is skipped.

Arguments range/value checks are added for acos, asin, atan2, mod,
gamma, log_gamma, bessel_y0, bessel_y1, and the elemental bessel_yn.

Diff Detail

Event Timeline

jeanPerier created this revision.Jan 10 2022, 5:52 AM
jeanPerier requested review of this revision.Jan 10 2022, 5:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 10 2022, 5:52 AM
klausler accepted this revision.Jan 10 2022, 8:53 AM

Please check that failed Windows build to see whether it's related to this change.

This revision is now accepted and ready to land.Jan 10 2022, 8:53 AM

Blank line change to test if bot failure is reproducible.

Windows fix attempt: try changing the way the lambda is capturing
the folder since the windows crash seems to be about an invalid
memory reference when the code runs the folder with an check wrapper.

Human reviewers, please ignore and sorry for the noise.
Still testing what can cause crash on windows.
Trying to simplify context message logic since the crash seems to only fire
when folding invalid user code (otherwise folding02.f90should also fail).