spirv-opt: Where possible make code agnostic of opencl/vulkan debuginfo (#4385)

Co-authored-by: baldurk <baldurk@baldurk.org>
diff --git a/source/opt/aggressive_dead_code_elim_pass.cpp b/source/opt/aggressive_dead_code_elim_pass.cpp
index 8c248b3..90d30e9 100644
--- a/source/opt/aggressive_dead_code_elim_pass.cpp
+++ b/source/opt/aggressive_dead_code_elim_pass.cpp
@@ -474,14 +474,13 @@
         ProcessLoad(func, varId);
       }
       // If DebugDeclare, process as load of variable
-    } else if (liveInst->GetOpenCL100DebugOpcode() ==
-               OpenCLDebugInfo100DebugDeclare) {
+    } else if (liveInst->GetCommonDebugOpcode() ==
+               CommonDebugInfoDebugDeclare) {
       uint32_t varId =
           liveInst->GetSingleWordOperand(kDebugDeclareOperandVariableIndex);
       ProcessLoad(func, varId);
       // If DebugValue with Deref, process as load of variable
-    } else if (liveInst->GetOpenCL100DebugOpcode() ==
-               OpenCLDebugInfo100DebugValue) {
+    } else if (liveInst->GetCommonDebugOpcode() == CommonDebugInfoDebugValue) {
       uint32_t varId = context()
                            ->get_debug_info_mgr()
                            ->GetVariableIdOfDebugValueUsedForDeclare(liveInst);
@@ -652,7 +651,7 @@
   // For each DebugInfo GlobalVariable keep all operands except the Variable.
   // Later, if the variable is dead, we will set the operand to DebugInfoNone.
   for (auto& dbg : get_module()->ext_inst_debuginfo()) {
-    if (dbg.GetOpenCL100DebugOpcode() != OpenCLDebugInfo100DebugGlobalVariable)
+    if (dbg.GetCommonDebugOpcode() != CommonDebugInfoDebugGlobalVariable)
       continue;
     dbg.ForEachInId([this](const uint32_t* iid) {
       Instruction* inInst = get_def_use_mgr()->GetDef(*iid);
@@ -877,8 +876,7 @@
     if (!IsDead(&dbg)) continue;
     // Save GlobalVariable if its variable is live, otherwise null out variable
     // index
-    if (dbg.GetOpenCL100DebugOpcode() ==
-        OpenCLDebugInfo100DebugGlobalVariable) {
+    if (dbg.GetCommonDebugOpcode() == CommonDebugInfoDebugGlobalVariable) {
       auto var_id = dbg.GetSingleWordOperand(kGlobalVariableVariableIndex);
       Instruction* var_inst = get_def_use_mgr()->GetDef(var_id);
       if (!IsDead(var_inst)) continue;
diff --git a/source/opt/copy_prop_arrays.cpp b/source/opt/copy_prop_arrays.cpp
index 67a97b6..f505d8a 100644
--- a/source/opt/copy_prop_arrays.cpp
+++ b/source/opt/copy_prop_arrays.cpp
@@ -29,10 +29,10 @@
 const uint32_t kTypePointerStorageClassInIdx = 0;
 const uint32_t kTypePointerPointeeInIdx = 1;
 
-bool IsOpenCL100DebugDeclareOrValue(Instruction* di) {
-  auto dbg_opcode = di->GetOpenCL100DebugOpcode();
-  return dbg_opcode == OpenCLDebugInfo100DebugDeclare ||
-         dbg_opcode == OpenCLDebugInfo100DebugValue;
+bool IsDebugDeclareOrValue(Instruction* di) {
+  auto dbg_opcode = di->GetCommonDebugOpcode();
+  return dbg_opcode == CommonDebugInfoDebugDeclare ||
+         dbg_opcode == CommonDebugInfoDebugValue;
 }
 
 }  // namespace
@@ -194,7 +194,7 @@
           return ptr_inst->opcode() == SpvOpVariable &&
                  store_inst->GetSingleWordInOperand(kStorePointerInOperand) ==
                      ptr_inst->result_id();
-        } else if (IsOpenCL100DebugDeclareOrValue(use)) {
+        } else if (IsDebugDeclareOrValue(use)) {
           return true;
         }
         // Some other instruction.  Be conservative.
@@ -500,7 +500,7 @@
                                                        const_mgr,
                                                        type](Instruction* use,
                                                              uint32_t) {
-    if (IsOpenCL100DebugDeclareOrValue(use)) return true;
+    if (IsDebugDeclareOrValue(use)) return true;
 
     switch (use->opcode()) {
       case SpvOpLoad: {
@@ -592,9 +592,9 @@
     Instruction* use = pair.first;
     uint32_t index = pair.second;
 
-    if (use->IsOpenCL100DebugInstr()) {
-      switch (use->GetOpenCL100DebugOpcode()) {
-        case OpenCLDebugInfo100DebugDeclare: {
+    if (use->IsCommonDebugInstr()) {
+      switch (use->GetCommonDebugOpcode()) {
+        case CommonDebugInfoDebugDeclare: {
           if (new_ptr_inst->opcode() == SpvOpVariable ||
               new_ptr_inst->opcode() == SpvOpFunctionParameter) {
             context()->ForgetUses(use);
@@ -608,9 +608,8 @@
             context()->ForgetUses(use);
 
             // Change DebugDeclare to DebugValue.
-            use->SetOperand(
-                index - 2,
-                {static_cast<uint32_t>(OpenCLDebugInfo100DebugValue)});
+            use->SetOperand(index - 2,
+                            {static_cast<uint32_t>(CommonDebugInfoDebugValue)});
             use->SetOperand(index, {new_ptr_inst->result_id()});
 
             // Add Deref operation.
@@ -625,7 +624,7 @@
           }
           break;
         }
-        case OpenCLDebugInfo100DebugValue:
+        case CommonDebugInfoDebugValue:
           context()->ForgetUses(use);
           use->SetOperand(index, {new_ptr_inst->result_id()});
           context()->AnalyzeUses(use);
diff --git a/source/opt/dead_insert_elim_pass.cpp b/source/opt/dead_insert_elim_pass.cpp
index 46f4f12..fb5c163 100644
--- a/source/opt/dead_insert_elim_pass.cpp
+++ b/source/opt/dead_insert_elim_pass.cpp
@@ -196,7 +196,7 @@
       }
       const uint32_t id = ii->result_id();
       get_def_use_mgr()->ForEachUser(id, [&ii, this](Instruction* user) {
-        if (user->IsOpenCL100DebugInstr()) return;
+        if (user->IsCommonDebugInstr()) return;
         switch (user->opcode()) {
           case SpvOpCompositeInsert:
           case SpvOpPhi:
diff --git a/source/opt/inline_pass.cpp b/source/opt/inline_pass.cpp
index 8159ebf..ce3bf7f 100644
--- a/source/opt/inline_pass.cpp
+++ b/source/opt/inline_pass.cpp
@@ -158,8 +158,8 @@
   auto callee_block_itr = calleeFn->begin();
   auto callee_var_itr = callee_block_itr->begin();
   while (callee_var_itr->opcode() == SpvOp::SpvOpVariable ||
-         callee_var_itr->GetOpenCL100DebugOpcode() ==
-             OpenCLDebugInfo100DebugDeclare) {
+         callee_var_itr->GetCommonDebugOpcode() ==
+             CommonDebugInfoDebugDeclare) {
     if (callee_var_itr->opcode() != SpvOp::SpvOpVariable) {
       ++callee_var_itr;
       continue;
@@ -300,8 +300,7 @@
     UptrVectorIterator<BasicBlock> callee_first_block_itr) {
   auto callee_itr = callee_first_block_itr->begin();
   while (callee_itr->opcode() == SpvOp::SpvOpVariable ||
-         callee_itr->GetOpenCL100DebugOpcode() ==
-             OpenCLDebugInfo100DebugDeclare) {
+         callee_itr->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare) {
     if (callee_itr->opcode() == SpvOp::SpvOpVariable &&
         callee_itr->NumInOperands() == 2) {
       assert(callee2caller.count(callee_itr->result_id()) &&
@@ -315,8 +314,7 @@
                context()->get_debug_info_mgr()->BuildDebugScope(
                    callee_itr->GetDebugScope(), inlined_at_ctx));
     }
-    if (callee_itr->GetOpenCL100DebugOpcode() ==
-        OpenCLDebugInfo100DebugDeclare) {
+    if (callee_itr->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare) {
       InlineSingleInstruction(
           callee2caller, new_blk_ptr->get(), &*callee_itr,
           context()->get_debug_info_mgr()->BuildDebugInlinedAtChain(
diff --git a/source/opt/instruction.cpp b/source/opt/instruction.cpp
index f93ad01..e07fd62 100644
--- a/source/opt/instruction.cpp
+++ b/source/opt/instruction.cpp
@@ -985,10 +985,10 @@
                           uint32_t ext_set,
                           std::vector<uint32_t>* binary) const {
   uint32_t num_words = kDebugScopeNumWords;
-  OpenCLDebugInfo100Instructions dbg_opcode = OpenCLDebugInfo100DebugScope;
+  CommonDebugInfoInstructions dbg_opcode = CommonDebugInfoDebugScope;
   if (GetLexicalScope() == kNoDebugScope) {
     num_words = kDebugNoScopeNumWords;
-    dbg_opcode = OpenCLDebugInfo100DebugNoScope;
+    dbg_opcode = CommonDebugInfoDebugNoScope;
   } else if (GetInlinedAt() == kNoInlinedAt) {
     num_words = kDebugScopeNumWordsWithoutInlinedAt;
   }
diff --git a/source/opt/ir_context.cpp b/source/opt/ir_context.cpp
index 74f3878..9087346 100644
--- a/source/opt/ir_context.cpp
+++ b/source/opt/ir_context.cpp
@@ -30,7 +30,8 @@
 static const int kEntryPointInterfaceInIdx = 3;
 static const int kEntryPointFunctionIdInIdx = 1;
 
-// Constants for OpenCL.DebugInfo.100 extension instructions.
+// Constants for OpenCL.DebugInfo.100 / NonSemantic.Vulkan.DebugInfo.100
+// extension instructions.
 static const uint32_t kDebugFunctionOperandFunctionIndex = 13;
 static const uint32_t kDebugGlobalVariableOperandVariableIndex = 11;
 
@@ -437,8 +438,7 @@
   if (opcode == SpvOpVariable || IsConstantInst(opcode)) {
     for (auto it = module()->ext_inst_debuginfo_begin();
          it != module()->ext_inst_debuginfo_end(); ++it) {
-      if (it->GetOpenCL100DebugOpcode() !=
-          OpenCLDebugInfo100DebugGlobalVariable)
+      if (it->GetCommonDebugOpcode() != CommonDebugInfoDebugGlobalVariable)
         continue;
       auto& operand = it->GetOperand(kDebugGlobalVariableOperandVariableIndex);
       if (operand.words[0] == id) {
diff --git a/source/opt/ir_context.h b/source/opt/ir_context.h
index f5f38a6..3b89d85 100644
--- a/source/opt/ir_context.h
+++ b/source/opt/ir_context.h
@@ -190,8 +190,8 @@
   inline IteratorRange<Module::const_inst_iterator> debugs3() const;
 
   // Iterators for debug info instructions (excluding OpLine & OpNoLine)
-  // contained in this module.  These are OpExtInst for OpenCL.DebugInfo.100
-  // or DebugInfo extension placed between section 9 and 10.
+  // contained in this module.  These are OpExtInst for DebugInfo extension
+  // placed between section 9 and 10.
   inline Module::inst_iterator ext_inst_debuginfo_begin();
   inline Module::inst_iterator ext_inst_debuginfo_end();
   inline IteratorRange<Module::inst_iterator> ext_inst_debuginfo();
diff --git a/source/opt/ir_loader.cpp b/source/opt/ir_loader.cpp
index e443ebb..77f90f1 100644
--- a/source/opt/ir_loader.cpp
+++ b/source/opt/ir_loader.cpp
@@ -53,10 +53,12 @@
   // struct DebugScope.
   if (opcode == SpvOpExtInst && spvExtInstIsDebugInfo(inst->ext_inst_type)) {
     const uint32_t ext_inst_index = inst->words[kExtInstSetIndex];
-    if (inst->ext_inst_type == SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100) {
-      const OpenCLDebugInfo100Instructions ext_inst_key =
-          OpenCLDebugInfo100Instructions(ext_inst_index);
-      if (ext_inst_key == OpenCLDebugInfo100DebugScope) {
+    if (inst->ext_inst_type == SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100 ||
+        inst->ext_inst_type ==
+            SPV_EXT_INST_TYPE_NONSEMANTIC_VULKAN_DEBUGINFO_100) {
+      const CommonDebugInfoInstructions ext_inst_key =
+          CommonDebugInfoInstructions(ext_inst_index);
+      if (ext_inst_key == CommonDebugInfoDebugScope) {
         uint32_t inlined_at = 0;
         if (inst->num_words > kInlinedAtIndex)
           inlined_at = inst->words[kInlinedAtIndex];
@@ -65,7 +67,7 @@
         module()->SetContainsDebugInfo();
         return true;
       }
-      if (ext_inst_key == OpenCLDebugInfo100DebugNoScope) {
+      if (ext_inst_key == CommonDebugInfoDebugNoScope) {
         last_dbg_scope_ = DebugScope(kNoDebugScope, kNoInlinedAt);
         module()->SetContainsDebugInfo();
         return true;
diff --git a/source/opt/local_access_chain_convert_pass.cpp b/source/opt/local_access_chain_convert_pass.cpp
index 5485c03..e8dbdfc 100644
--- a/source/opt/local_access_chain_convert_pass.cpp
+++ b/source/opt/local_access_chain_convert_pass.cpp
@@ -184,8 +184,8 @@
 bool LocalAccessChainConvertPass::HasOnlySupportedRefs(uint32_t ptrId) {
   if (supported_ref_ptrs_.find(ptrId) != supported_ref_ptrs_.end()) return true;
   if (get_def_use_mgr()->WhileEachUser(ptrId, [this](Instruction* user) {
-        if (user->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugValue ||
-            user->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugDeclare) {
+        if (user->GetCommonDebugOpcode() == CommonDebugInfoDebugValue ||
+            user->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare) {
           return true;
         }
         SpvOp op = user->opcode();
diff --git a/source/opt/local_single_block_elim_pass.cpp b/source/opt/local_single_block_elim_pass.cpp
index a964c4c..a742e3b 100644
--- a/source/opt/local_single_block_elim_pass.cpp
+++ b/source/opt/local_single_block_elim_pass.cpp
@@ -31,9 +31,9 @@
 bool LocalSingleBlockLoadStoreElimPass::HasOnlySupportedRefs(uint32_t ptrId) {
   if (supported_ref_ptrs_.find(ptrId) != supported_ref_ptrs_.end()) return true;
   if (get_def_use_mgr()->WhileEachUser(ptrId, [this](Instruction* user) {
-        auto dbg_op = user->GetOpenCL100DebugOpcode();
-        if (dbg_op == OpenCLDebugInfo100DebugDeclare ||
-            dbg_op == OpenCLDebugInfo100DebugValue) {
+        auto dbg_op = user->GetCommonDebugOpcode();
+        if (dbg_op == CommonDebugInfoDebugDeclare ||
+            dbg_op == CommonDebugInfoDebugValue) {
           return true;
         }
         SpvOp op = user->opcode();
diff --git a/source/opt/local_single_store_elim_pass.cpp b/source/opt/local_single_store_elim_pass.cpp
index f3864a8..9701d10 100644
--- a/source/opt/local_single_store_elim_pass.cpp
+++ b/source/opt/local_single_store_elim_pass.cpp
@@ -224,9 +224,9 @@
       case SpvOpCopyObject:
         break;
       case SpvOpExtInst: {
-        auto dbg_op = user->GetOpenCL100DebugOpcode();
-        if (dbg_op == OpenCLDebugInfo100DebugDeclare ||
-            dbg_op == OpenCLDebugInfo100DebugValue) {
+        auto dbg_op = user->GetCommonDebugOpcode();
+        if (dbg_op == CommonDebugInfoDebugDeclare ||
+            dbg_op == CommonDebugInfoDebugValue) {
           break;
         }
         return nullptr;
@@ -293,9 +293,9 @@
   bool modified = false;
   for (Instruction* use : uses) {
     if (use->opcode() == SpvOpStore) continue;
-    auto dbg_op = use->GetOpenCL100DebugOpcode();
-    if (dbg_op == OpenCLDebugInfo100DebugDeclare ||
-        dbg_op == OpenCLDebugInfo100DebugValue)
+    auto dbg_op = use->GetCommonDebugOpcode();
+    if (dbg_op == CommonDebugInfoDebugDeclare ||
+        dbg_op == CommonDebugInfoDebugValue)
       continue;
     if (use->opcode() == SpvOpLoad &&
         dominator_analysis->Dominates(store_inst, use)) {
diff --git a/source/opt/mem_pass.cpp b/source/opt/mem_pass.cpp
index 5738798..72442a9 100644
--- a/source/opt/mem_pass.cpp
+++ b/source/opt/mem_pass.cpp
@@ -20,7 +20,6 @@
 #include <set>
 #include <vector>
 
-#include "OpenCLDebugInfo100.h"
 #include "source/cfa.h"
 #include "source/opt/basic_block.h"
 #include "source/opt/dominator_analysis.h"
@@ -226,9 +225,9 @@
 
 bool MemPass::HasOnlySupportedRefs(uint32_t varId) {
   return get_def_use_mgr()->WhileEachUser(varId, [this](Instruction* user) {
-    auto dbg_op = user->GetOpenCL100DebugOpcode();
-    if (dbg_op == OpenCLDebugInfo100DebugDeclare ||
-        dbg_op == OpenCLDebugInfo100DebugValue) {
+    auto dbg_op = user->GetCommonDebugOpcode();
+    if (dbg_op == CommonDebugInfoDebugDeclare ||
+        dbg_op == CommonDebugInfoDebugValue) {
       return true;
     }
     SpvOp op = user->opcode();
diff --git a/source/opt/module.h b/source/opt/module.h
index d609b60..43b55ae 100644
--- a/source/opt/module.h
+++ b/source/opt/module.h
@@ -103,8 +103,8 @@
   // This is due to decision by the SPIR Working Group, pending publication.
   inline void AddDebug3Inst(std::unique_ptr<Instruction> d);
 
-  // Appends a debug info extension (OpenCL.DebugInfo.100 or DebugInfo)
-  // instruction to this module.
+  // Appends a debug info extension (OpenCL.DebugInfo.100,
+  // NonSemantic.Vulkan.DebugInfo.100, or DebugInfo) instruction to this module.
   inline void AddExtInstDebugInfo(std::unique_ptr<Instruction> d);
 
   // Appends an annotation instruction to this module.
@@ -192,8 +192,8 @@
   inline IteratorRange<const_inst_iterator> debugs3() const;
 
   // Iterators for debug info instructions (excluding OpLine & OpNoLine)
-  // contained in this module.  These are OpExtInst for OpenCL.DebugInfo.100
-  // or DebugInfo extension placed between section 9 and 10.
+  // contained in this module.  These are OpExtInst for DebugInfo extension
+  // placed between section 9 and 10.
   inline inst_iterator ext_inst_debuginfo_begin();
   inline inst_iterator ext_inst_debuginfo_end();
   inline IteratorRange<inst_iterator> ext_inst_debuginfo();
diff --git a/source/opt/private_to_local_pass.cpp b/source/opt/private_to_local_pass.cpp
index dd6cbbd..12a226d 100644
--- a/source/opt/private_to_local_pass.cpp
+++ b/source/opt/private_to_local_pass.cpp
@@ -157,8 +157,7 @@
 bool PrivateToLocalPass::IsValidUse(const Instruction* inst) const {
   // The cases in this switch have to match the cases in |UpdateUse|.
   // If we don't know how to update it, it is not valid.
-  if (inst->GetOpenCL100DebugOpcode() ==
-      OpenCLDebugInfo100DebugGlobalVariable) {
+  if (inst->GetCommonDebugOpcode() == CommonDebugInfoDebugGlobalVariable) {
     return true;
   }
   switch (inst->opcode()) {
@@ -183,8 +182,7 @@
   // The cases in this switch have to match the cases in |IsValidUse|.  If we
   // don't think it is valid, the optimization will not view the variable as a
   // candidate, and therefore the use will not be updated.
-  if (inst->GetOpenCL100DebugOpcode() ==
-      OpenCLDebugInfo100DebugGlobalVariable) {
+  if (inst->GetCommonDebugOpcode() == CommonDebugInfoDebugGlobalVariable) {
     context()->get_debug_info_mgr()->ConvertDebugGlobalToLocalVariable(inst,
                                                                        user);
     return true;
diff --git a/source/opt/reduce_load_size.cpp b/source/opt/reduce_load_size.cpp
index c58adf4..87d2c4c 100644
--- a/source/opt/reduce_load_size.cpp
+++ b/source/opt/reduce_load_size.cpp
@@ -139,7 +139,7 @@
 
   all_elements_used =
       !def_use_mgr->WhileEachUser(op_inst, [&elements_used](Instruction* use) {
-        if (use->IsOpenCL100DebugInstr()) return true;
+        if (use->IsCommonDebugInstr()) return true;
         if (use->opcode() != SpvOpCompositeExtract ||
             use->NumInOperands() == 1) {
           return false;
diff --git a/source/opt/scalar_replacement_pass.cpp b/source/opt/scalar_replacement_pass.cpp
index 4d47bdd..8adca7b 100644
--- a/source/opt/scalar_replacement_pass.cpp
+++ b/source/opt/scalar_replacement_pass.cpp
@@ -83,14 +83,14 @@
   std::vector<Instruction*> dead;
   bool replaced_all_uses = get_def_use_mgr()->WhileEachUser(
       inst, [this, &replacements, &dead](Instruction* user) {
-        if (user->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugDeclare) {
+        if (user->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare) {
           if (ReplaceWholeDebugDeclare(user, replacements)) {
             dead.push_back(user);
             return true;
           }
           return false;
         }
-        if (user->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugValue) {
+        if (user->GetCommonDebugOpcode() == CommonDebugInfoDebugValue) {
           if (ReplaceWholeDebugValue(user, replacements)) {
             dead.push_back(user);
             return true;
@@ -504,7 +504,7 @@
     }
   }
 
-  // Update the OpenCL.DebugInfo.100 debug information.
+  // Update the DebugInfo debug information.
   inst->UpdateDebugInfoFrom(varInst);
 
   replacements->push_back(inst);
@@ -791,8 +791,8 @@
   get_def_use_mgr()->ForEachUse(inst, [this, max_legal_index, stats, &ok](
                                           const Instruction* user,
                                           uint32_t index) {
-    if (user->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugDeclare ||
-        user->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugValue) {
+    if (user->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare ||
+        user->GetCommonDebugOpcode() == CommonDebugInfoDebugValue) {
       // TODO: include num_partial_accesses if it uses Fragment operation or
       // DebugValue has Indexes operand.
       stats->num_full_accesses++;
diff --git a/source/opt/value_number_table.cpp b/source/opt/value_number_table.cpp
index 32d6de9..5271e3f 100644
--- a/source/opt/value_number_table.cpp
+++ b/source/opt/value_number_table.cpp
@@ -50,7 +50,7 @@
   // OpSampledImage and OpImage must remain in the same basic block in which
   // they are used, because of this we will assign each one it own value number.
   if (!context()->IsCombinatorInstruction(inst) &&
-      !inst->IsOpenCL100DebugInstr()) {
+      !inst->IsCommonDebugInstr()) {
     value = TakeNextValueNumber();
     id_to_value_[inst->result_id()] = value;
     return value;
diff --git a/source/opt/vector_dce.cpp b/source/opt/vector_dce.cpp
index 14a55c1..3c9f944 100644
--- a/source/opt/vector_dce.cpp
+++ b/source/opt/vector_dce.cpp
@@ -52,7 +52,7 @@
   // components are live because of arbitrary nesting of structs.
   function->ForEachInst(
       [&work_list, this, live_components](Instruction* current_inst) {
-        if (current_inst->IsOpenCL100DebugInstr()) {
+        if (current_inst->IsCommonDebugInstr()) {
           return;
         }
         if (!HasVectorOrScalarResult(current_inst) ||
@@ -394,7 +394,7 @@
     Instruction* composite, std::vector<Instruction*>* dead_dbg_value) {
   context()->get_def_use_mgr()->ForEachUser(
       composite, [&dead_dbg_value](Instruction* use) {
-        if (use->GetOpenCL100DebugOpcode() == OpenCLDebugInfo100DebugValue)
+        if (use->GetCommonDebugOpcode() == CommonDebugInfoDebugValue)
           dead_dbg_value->push_back(use);
       });
 }