[PATCH] D150371: TargetExtType: Use a schema-based abbreviation in bitcode
Nicolai Hähnle via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 11 07:38:05 PDT 2023
nhaehnle created this revision.
nhaehnle added reviewers: jcranmer, jdoerfert, nikic, jsilvanus, Flakebi.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
nhaehnle requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
The encoding of the structured data used in target types is quite
verbose, and most of its contents are redundant as they encode the
symbols that act as keys of the structured data fields (e.g., "layout")
as well as the self-description of the value types.
By defining an abbreviation that contains all this information as
literals, the overhead is amortized over multiple target types.
The main challenge of this change is the fact that the Array encoding
can only appear once in an abbreviation, at the end, but target types
need two arrays. Define a new ExtArray encoding that avoids this
limitation. Since the encoding space for the encoding itself is rather
tight (3 bits), this extended array encoding allows tuples inside of
arrays as a precautionary extension. This feature is not used at this
time, but it seems rather likely that it will become useful in the
future.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D150371
Files:
llvm/docs/BitCodeFormat.rst
llvm/include/llvm/Bitstream/BitCodes.h
llvm/include/llvm/Bitstream/BitstreamWriter.h
llvm/include/llvm/IR/TargetExtType.h
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/lib/Bitstream/Reader/BitstreamReader.cpp
llvm/lib/IR/Type.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150371.521311.patch
Type: text/x-patch
Size: 14048 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230511/c1f1ce9a/attachment.bin>
More information about the llvm-commits
mailing list