This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Fix name mangling for LMUL!=1 vector types with attribute(rvv_vector_bits)
ClosedPublic

Authored by craig.topper on Jun 23 2023, 12:51 PM.

Details

Summary

We were always printing "m1", we need to calculate the correct LMUL instead.

Diff Detail

Event Timeline

craig.topper created this revision.Jun 23 2023, 12:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2023, 12:51 PM
craig.topper requested review of this revision.Jun 23 2023, 12:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2023, 12:51 PM
Herald added a subscriber: wangpc. · View Herald Transcript
aaron.ballman added a subscriber: rjmccall.
aaron.ballman added inline comments.
clang/lib/AST/ItaniumMangle.cpp
3882

CC @rjmccall for ABI review -- naïve, possibly dumb question: shouldn't we be using the vendor extended builtin type encoding for this sort of thing? (https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangle.builtin-type)

craig.topper added inline comments.Jul 10 2023, 1:29 PM
clang/lib/AST/ItaniumMangle.cpp
3882

I copied what SVE did and changed to use __RVV_VLSI as the name.

Here's the text from ACLE

14.2.6.3.5 C++ mangling of fixed-length SVE types Let VLST be a valid C++ type:

VLAT __attribute__((arm_sve_vector_bits(N)))

for some SVE vector type or SVE predicate type VLAT. VLST is mangled in the same way as a template:

template<typename, unsigned> struct __SVE_VLS;
with the arguments:
__SVE_VLS<VLAT, N>

For example:

#if __ARM_FEATURE_SVE_BITS==512
// Mangled as 9__SVE_VLSIu11__SVInt32_tLj512EE
typedef svint32_t vec __attribute__((arm_sve_vector_bits(512)));
// Mangled as 9__SVE_VLSIu10__SVBool_tLj512EE
typedef svbool_t pred __attribute__((arm_sve_vector_bits(512)));
#endif
This revision is now accepted and ready to land.Jul 11 2023, 6:05 AM