This is an archive of the discontinued LLVM Phabricator instance.

[mlir][SPIRVToLLVM] Add pass option to emit opaque-pointers
ClosedPublic

Authored by zero9178 on Feb 13 2023, 3:45 AM.

Details

Summary

Part of https://discourse.llvm.org/t/rfc-switching-the-llvm-dialect-and-dialect-lowerings-to-opaque-pointers/68179

This patch adds the pass option and required changes to the patterns to support the emission of LLVM IR opaque pointers. Given how close SPIRV semantics are to LLVM IR semantics this boils down to just a few changes:

  • Making sure that GEP and alloca are built with the explicit base pointer type
  • creating opaque pointers instead of typed pointers if requested
  • omitting pointer to pointer bitcasts

Diff Detail

Event Timeline

zero9178 created this revision.Feb 13 2023, 3:45 AM
zero9178 requested review of this revision.Feb 13 2023, 3:45 AM
antiagainst accepted this revision.Feb 13 2023, 10:07 AM

Nice, thanks!

This revision is now accepted and ready to land.Feb 13 2023, 10:07 AM
kuhar accepted this revision.Feb 13 2023, 11:56 AM