[llvm] [SPIRV] Enable DCE in instruction selection and update tests (PR #168428)

Nathan Gauër via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 11:22:34 PST 2025


================
@@ -223,14 +224,37 @@ SPIRVType *SPIRVGlobalRegistry::getOpTypeVoid(MachineIRBuilder &MIRBuilder) {
 }
 
 void SPIRVGlobalRegistry::invalidateMachineInstr(MachineInstr *MI) {
-  // TODO:
-  // - review other data structure wrt. possible issues related to removal
-  //   of a machine instruction during instruction selection.
+  // Other maps that may hold MachineInstr*:
+  // - VRegToTypeMap: Clearing would require a linear search. If we are deleting
----------------
Keenuts wrote:

Expensive check this assumption?

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


More information about the llvm-commits mailing list