[clang] [llvm] [AMDGPU][clang][CodeGen][opt] Add late-resolved feature identifying predicates (PR #134016)

Alex Voicu via llvm-commits llvm-commits at lists.llvm.org
Wed May 7 16:56:23 PDT 2025


https://github.com/AlexVlx commented:

> A side question, is it legal to use the builtin in unstructured control flow, like here: https://godbolt.org/z/no7Kzv19r ? Note, if the answer is "no", then enforcing the builtin to initialize something would (probably) automatically prevent this case, as clang would error out with:
> ```
> error: cannot jump from this goto statement to its label
> note: jump bypasses variable initialization
> ``` 

Many thanks for asking this, I had completely ignored this scenario! I've added handling for this which is symmetric with what we already do for `if constexpr` or `if available`; indeed, the answer to your question was "no":)


https://github.com/llvm/llvm-project/pull/134016


More information about the llvm-commits mailing list