Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Support/RISCVVIntrinsicUtils.cpp | ||
---|---|---|
819 | Keep as assert? |
clang/lib/Support/RISCVVIntrinsicUtils.cpp | ||
---|---|---|
819 | computeType already has an assertion guarding it, which is why the condition is removed here. |
clang/lib/Support/RISCVVIntrinsicUtils.cpp | ||
---|---|---|
737 | Could maybe merge these into a single case body and use math to compute NF? |
FYI after this change:
Building CXX object tools/lldb/sou...luginTypeSystemClang.dir/TypeSystemClang.cpp.o /home/david.spickett/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:4843:13: warning: 225 enumeration values not handled in switch: 'RvvInt8mf8x2', 'RvvInt8mf8x3', 'RvvInt8mf8x4'... [-Wswitch] switch (llvm::cast<clang::BuiltinType>(qual_type)->getKind()) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lldb doesn't do anything with RVV yet, so you can likely just add all the names to the existing block of RVV stuff that just breaks at the end.
This might be the cause to a crash I'm observing and that bisect pointed to.
Reproducer:
$ touch t.c # empty file $ clang -cc1 -triple riscv64 -w -emit-pch -o test.pch t.c $ clang -cc1 -triple riscv64 -w -x c -include-pch test.pch -ast-dump-all /dev/null
Warning (and possibly the error you got) should be fixed now through https://reviews.llvm.org/D152922.
Sorry @eopXD I confused everyone by linking the clang issue with that of lldb and they are unrelated. Apologies.
Can you check if clang crashes for you?
I am seeing messages related to builtin type, but they do not seem related to RVV builtin types.
$ touch t.c $ clang -cc1 -triple riscv64 -w -emit-pch -o test.pch t.c $ clang -cc1 -triple riscv64 -w -x c -include-pch test.pch -ast-dump-all /dev/null TranslationUnitDecl 0x60f3f88 <<invalid sloc>> <invalid sloc> <undeserialized declarations> |-TypedefDecl 0x60f4b78 <<invalid sloc>> <invalid sloc> implicit __int128_t '__int128' | `-BuiltinType 0x60f4520 '__int128' |-TypedefDecl 0x60f4be8 <<invalid sloc>> <invalid sloc> implicit __uint128_t 'unsigned __int128' | `-BuiltinType 0x60f4540 'unsigned __int128' |-TypedefDecl 0x60f4ae8 <<invalid sloc>> <invalid sloc> implicit __NSConstantString 'struct __NSConstantString_tag' | `-RecordType 0x60f48c0 'struct __NSConstantString_tag' imported | `-Record 0x60f4828 '__NSConstantString_tag' `-TypedefDecl 0x60f4c58 <<invalid sloc>> <invalid sloc> implicit __builtin_va_list 'void *' `-PointerType 0x60f47a0 'void *' `-BuiltinType 0x60f3fe0 'void'
Can you check if clang crashes for you?
I am seeing messages related to builtin type, but they do not seem related to RVV builtin types.
$ touch t.c $ clang -cc1 -triple riscv64 -w -emit-pch -o test.pch t.c $ clang -cc1 -triple riscv64 -w -x c -include-pch test.pch -ast-dump-all /dev/null TranslationUnitDecl 0x60f3f88 <<invalid sloc>> <invalid sloc> <undeserialized declarations> |-TypedefDecl 0x60f4b78 <<invalid sloc>> <invalid sloc> implicit __int128_t '__int128' | `-BuiltinType 0x60f4520 '__int128' |-TypedefDecl 0x60f4be8 <<invalid sloc>> <invalid sloc> implicit __uint128_t 'unsigned __int128' | `-BuiltinType 0x60f4540 'unsigned __int128' |-TypedefDecl 0x60f4ae8 <<invalid sloc>> <invalid sloc> implicit __NSConstantString 'struct __NSConstantString_tag' | `-RecordType 0x60f48c0 'struct __NSConstantString_tag' imported | `-Record 0x60f4828 '__NSConstantString_tag' `-TypedefDecl 0x60f4c58 <<invalid sloc>> <invalid sloc> implicit __builtin_va_list 'void *' `-PointerType 0x60f47a0 'void *' `-BuiltinType 0x60f3fe0 'void'
Thanks @eopXD.
What I've seen is that the test stops crashing for me if I disable all the types starting from line 218 in file clang/include/clang/Basic/RISCVVTypes.def.
When it doesn't crash, in my case all the registered RVV types are shown in the output
TranslationUnitDecl 0x14647eb8 <<invalid sloc>> <invalid sloc> <undeserialized declarations> |-TypedefDecl 0x14649e00 <<invalid sloc>> <invalid sloc> implicit __int128_t '__int128' | `-BuiltinType 0x14648480 '__int128' |-TypedefDecl 0x14649e70 <<invalid sloc>> <invalid sloc> implicit __uint128_t 'unsigned __int128' | `-BuiltinType 0x146484a0 'unsigned __int128' |-TypedefDecl 0x14649d68 <<invalid sloc>> <invalid sloc> implicit __NSConstantString 'struct __NSConstantString_tag' | `-RecordType 0x14649b40 'struct __NSConstantString_tag' imported | `-Record 0x14649aa0 '__NSConstantString_tag' |-TypedefDecl 0x14649ed0 <<invalid sloc>> <invalid sloc> imported implicit __rvv_int8mf8_t '__rvv_int8mf8_t' | `-BuiltinType 0x14648640 '__rvv_int8mf8_t' |-TypedefDecl 0x14649f58 <<invalid sloc>> <invalid sloc> imported implicit __rvv_int8mf4_t '__rvv_int8mf4_t' | `-BuiltinType 0x14648660 '__rvv_int8mf4_t' |-TypedefDecl 0x14649fe0 <<invalid sloc>> <invalid sloc> imported implicit __rvv_int8mf2_t '__rvv_int8mf2_t' | `-BuiltinType 0x14648680 '__rvv_int8mf2_t' |-TypedefDecl 0x1464a068 <<invalid sloc>> <invalid sloc> imported implicit __rvv_int8m1_t '__rvv_int8m1_t' | `-BuiltinType 0x146486a0 '__rvv_int8m1_t' |-TypedefDecl 0x1464a0f0 <<invalid sloc>> <invalid sloc> imported implicit __rvv_int8m2_t '__rvv_int8m2_t' | `-BuiltinType 0x146486c0 '__rvv_int8m2_t' |-TypedefDecl 0x1464a178 <<invalid sloc>> <invalid sloc> imported implicit __rvv_int8m4_t '__rvv_int8m4_t' …
Curious that you don't observe this. I'll keep investigating.
It looks like we need to increase NUM_PREDEF_TYPE_IDS. Let's continue the discussion on D153111
Blank line before the start of each section