This is an archive of the discontinued LLVM Phabricator instance.

[mlir][spirv] NFC: Serialize all operands together if possible
ClosedPublic

Authored by antiagainst on May 5 2020, 1:43 PM.

Details

Summary

SPIR-V ops can mix operands and attributes in the definition. These
operands and attributes are serialized in the exact order of the definition
to match SPIR-V binary format requirements. It can cause excessive
generated code bloat because we are emitting code to handle each
operand/attribute separately. We can probe first to check whether all
the operands are ahead of attributes. Then we can serialize all operands
together.

This removes ~1000 lines of code from the generated inc file.

Depends On D79444

Diff Detail

Event Timeline

antiagainst created this revision.May 5 2020, 1:43 PM
antiagainst retitled this revision from [mlir][spirv] Serialize all operands together if possible to [mlir][spirv] NFC: Serialize all operands together if possible.
antiagainst edited the summary of this revision. (Show Details)May 5 2020, 1:47 PM
mravishankar accepted this revision.May 5 2020, 4:36 PM

Ah, thats nice. Simple change saves compilation time. Thanks!

This revision is now accepted and ready to land.May 5 2020, 4:36 PM
This revision was automatically updated to reflect the committed changes.
rriddle added inline comments.May 27 2020, 11:55 AM
mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp
546

std::any_of?