This is an archive of the discontinued LLVM Phabricator instance.

[C++4OpenCL] Fix ICE with invalid use of half
ClosedPublic

Authored by olestrohm on May 26 2021, 8:48 AM.

Details

Summary

Because half is limited to the cl_khr_fp16 extension being enabled, DefaultLvalueConversion can fail when it's not enabled.
Because of this the original assumption that it will never return an error is wrong.

This is fixed by checking for an error and returning early if there is one, instead of assuming that DefaultLvalueConversion is infallible.

Fixes: PR47976

Diff Detail

Event Timeline

olestrohm created this revision.May 26 2021, 8:48 AM
olestrohm requested review of this revision.May 26 2021, 8:48 AM
Anastasia accepted this revision.May 27 2021, 4:19 AM

LGTM! Thanks

Yeah I think this is the only case where DefaultLvalueConversion exits with an error at present.

This revision is now accepted and ready to land.May 27 2021, 4:19 AM
This revision was landed with ongoing or failed builds.Jun 1 2021, 5:43 AM
This revision was automatically updated to reflect the committed changes.