f9be7a7afd
The translation to LLVM IR used to construct sequential constants by recurring down to individual elements, creating constant values for them, and wrapping them into aggregate constants in post-order. This is highly inefficient for large constants with known data such as DenseElementsAttr. Use LLVM's ConstantData for the innermost dimension instead. LLVM does seem to support data constants for nested sequential constants so the outer dimensions are still handled recursively. Nevertheless, this speeds up the translation of large constants with equal dimensions by up to 30x. Users are advised to rewrite large constants to use flat types before translating to LLVM IR if more efficiency in translation is necessary. This is not done automatically as the translation is not aware of the expectations of the overall compilation flow about type changes and indexing, in particular for global constants with external linkage. Reviewed By: silvas Differential Revision: https://reviews.llvm.org/D109152 |
||
---|---|---|
.. | ||
Cpp | ||
LLVMIR | ||
SPIRV | ||
CMakeLists.txt |