[llvm] [SPIR-V] Move ASSIGN_TYPE generation to PostLegalizer (PR #169696)

Steven Perron via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 1 09:10:34 PST 2025


================
@@ -425,52 +425,21 @@ static void setInsertPtAfterDef(MachineIRBuilder &MIB, MachineInstr *Def) {
 }
 
 namespace llvm {
-void insertAssignInstr(Register Reg, Type *Ty, SPIRVType *SpvType,
-                       SPIRVGlobalRegistry *GR, MachineIRBuilder &MIB,
-                       MachineRegisterInfo &MRI) {
+void updateRegType(Register Reg, Type *Ty, SPIRVType *SpvType,
+                   SPIRVGlobalRegistry *GR, MachineIRBuilder &MIB,
+                   MachineRegisterInfo &MRI) {
   assert((Ty || SpvType) && "Either LLVM or SPIRV type is expected.");
   MachineInstr *Def = MRI.getVRegDef(Reg);
   setInsertPtAfterDef(MIB, Def);
----------------
s-perron wrote:

This is still required. The spir-v type uses the insertion point to get the basic block. This line asserts, if we do not set the insertion point:

https://github.com/llvm/llvm-project/blob/5c2601563789a232a9d0575c95edacdc2c25a97d/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp#L274

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


More information about the llvm-commits mailing list