[llvm] [IR] `select` should reject token-like types (PR #219162)

Sameer Sahasrabuddhe via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 03:40:32 PDT 2026


ssahasra wrote:

> This should be checked here instead:
> 
> https://github.com/llvm/llvm-project/blob/e21fc4d872d8e8c791bae8631e2e60eda5414fb0/llvm/lib/IR/Instructions.cpp#L109-L110

Yeah that's what I originally did, but ran into a test failure on DirectX. See the second half of the commit description: some DirectX tests have invalid Phi and Select instructions, and disable the verifier. So I shaped my change to fit in that same scheme. The alternative is to break the one test that is modified in this PR.

Not sure why it's possible to create a PhiNode, but SelectInst provides a stricter check.

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


More information about the llvm-commits mailing list