This is an archive of the discontinued LLVM Phabricator instance.

[mlir] harden result type verification in llvm.call
ClosedPublic

Authored by ftynse on Jul 28 2021, 1:23 AM.

Details

Summary

The verifier of the llvm.call operation was not checking for mismatches between
the number of operation results and the number of results in the signature of
the callee. Furthermore, it was possible to construct an llvm.call operation
producing an SSA value of !llvm.void type, which should not exist. Add the
verification and treat !llvm.void result type as absence of call results.
Update the GPU conversions to LLVM that were mistakenly assuming that it was
fine for llvm.call to produce values of !llvm.void type and ensure these calls
do not produce results.

Diff Detail

Event Timeline

ftynse created this revision.Jul 28 2021, 1:23 AM
ftynse requested review of this revision.Jul 28 2021, 1:23 AM
mehdi_amini accepted this revision.Jul 28 2021, 9:12 AM

Thanks!

This revision is now accepted and ready to land.Jul 28 2021, 9:12 AM
This revision was automatically updated to reflect the committed changes.