[PATCH] D153510: [Clang] Check type support for local variable declaration

2023-06-23 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:8780 } + if (T->isRVVType()) +checkRVVTypeSupport(T, NewVD->getLocation(), cast(CurContext)); Add a blank line before this to separate it from SVE Repository: rG LLVM Github

[PATCH] D153510: [Clang] Check type support for local variable declaration

2023-06-23 Thread Yueh-Ting (eop) Chen via Phabricator via cfe-commits
eopXD updated this revision to Diff 534025. eopXD added a comment. Rebase to latest main. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153510/new/ https://reviews.llvm.org/D153510 Files: clang/include/clang/Sema/Sema.h

[PATCH] D153510: [Clang] Check type support for local variable declaration

2023-06-23 Thread Yueh-Ting (eop) Chen via Phabricator via cfe-commits
eopXD updated this revision to Diff 533961. eopXD added a comment. Extract RVV type check as a separate function as Craig has commented. Add test case from Aaron's comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153510/new/

[PATCH] D153510: [Clang] Check type support for local variable declaration

2023-06-22 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:8773 + + checkTypeSupport(T, NewVD->getLocation(), cast(CurContext)); } This feels heavy handed for not RISC-V vector types. Can we put the RISC-V code from checkTypeSupport in a

[PATCH] D153510: [Clang] Check type support for local variable declaration

2023-06-22 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added a comment. @aaron.ballman The backend crashes at -O0 when scalable vector variables are declared because the stack frame code doesn't expect to see them when the vector extension isn't enabled. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D153510: [Clang] Check type support for local variable declaration

2023-06-22 Thread Yueh-Ting (eop) Chen via Phabricator via cfe-commits
eopXD added a comment. In D153510#4440784 , @aaron.ballman wrote: > This checking already happens when the declaration is actually *used*, so I > question whether we need to do the check at all (declared but unused > variables seem like an edge case

[PATCH] D153510: [Clang] Check type support for local variable declaration

2023-06-22 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. This checking already happens when the declaration is actually *used*, so I question whether we need to do the check at all (declared but unused variables seem like an edge case to me): https://godbolt.org/z/e4Y8qKMrW What is the behavior of the example I linked

[PATCH] D153510: [Clang] Check type support for local variable declaration

2023-06-22 Thread Yueh-Ting (eop) Chen via Phabricator via cfe-commits
eopXD created this revision. eopXD added reviewers: craig.topper, aaron.ballman. Herald added subscribers: luke, frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal,