[clang] [clang][SemaOpenACC] Avoid assertion on VLA reduction operand (PR #199178)
Fan Mo via cfe-commits
cfe-commits at lists.llvm.org
Fri May 22 12:21:43 PDT 2026
w007878 wrote:
> > So a VLA here would be an extension. Of the other compilers we have access to on godbolt, NVC++ accepts (though perhaps silently ignores?), and GCC crashes.
> > So the question is whether we should reject VLAs instead. I am leaning towards that we should (See CheckReductionVarType). There isn't any reasonable IR we can generate for them. Pointers have a similar problem, but at least there is an implied "its just a single element" thing.
> > Also, your tests don't have to validate all of the reduction operations, this test doesn't depend on them. You gotta real claude in :)
> > That said, this IS missing tests for codegen in clangir mode. OpenACC
>
> All that to say: We have 2 options: 1- Just reject VLAs.
>
> 2- Keep accepting VLAs and fix this. However, this patch is incomplete as it doesn't handle lowering/lowering tests, and doesn't actually really do anything useful. Pointers can be 'null' because there is no guarantee that they can be used across the host/device. VLAs can't just be null here, there would be an expectation of values (despite it having the SAME problem as as pointers).
Hi @erichkeane , thank you so much for your quick review!
At this moment, I think the better way is to reject VLA, as there's still some work to do on the lowering and backend. I'll take some time to think about the proper handling of VLA.
Will update the PR later after work based on your suggestions. I appreciate your guidance so much!
https://github.com/llvm/llvm-project/pull/199178
More information about the cfe-commits
mailing list