[llvm] [SPIRV] Add a `SPIRVTypeInst` type with some guardrails (PR #179947)

Juan Manuel Martinez CaamaƱo via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 10 10:46:59 PST 2026


jmmartinez wrote:

> I really like this idea of trying to add guardrails to fix some of the nonsense we have today, my only comment is on the name, I'm not sure adding `Inst` make it clearer, if I was new to the codebase and saw `SPIRVType` and `SPIRVTypeInst` I would probably assume they were totally different tings. Maybe we could have the name explain what it's trying to do, like `StrictSPIRVType` or `VerifiedSPIRVType`, or something. I don't think my suggestions are good either but I wonder if something along those lines fits better

Since https://github.com/llvm/llvm-project/pull/180721 was filed, I don't think that both types would live together enough for us to have to use very different names for them.

I've added a comment on top of `SPIRVType` to discourage its use.

```cpp
/// @deprecated Use SPIRVTypeInstead
/// SPIRVType is supposed to represent a MachineInstr that defines a SPIRV Type
/// (e.g. an OpTypeInt intruction). It is misused in several places and we're
/// getting rid of it.
using SPIRVType = const MachineInstr;
```

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


More information about the llvm-commits mailing list