[llvm] [GlobalISel] Introduce `G_POISON` (PR #127825)

Mateusz Sokół via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 22 07:17:01 PDT 2025


================
@@ -2736,13 +2737,26 @@ bool CombinerHelper::matchAnyExplicitUseIsUndef(MachineInstr &MI) const {
   });
 }
 
+bool CombinerHelper::matchAnyExplicitUseIsPoison(MachineInstr &MI) const {
+  return any_of(MI.explicit_uses(), [this](const MachineOperand &MO) {
+    return MO.isReg() && getOpcodeDef(TargetOpcode::G_POISON, MO.getReg(), MRI);
+  });
+}
+
 bool CombinerHelper::matchAllExplicitUsesAreUndef(MachineInstr &MI) const {
   return all_of(MI.explicit_uses(), [this](const MachineOperand &MO) {
     return !MO.isReg() ||
            getOpcodeDef(TargetOpcode::G_IMPLICIT_DEF, MO.getReg(), MRI);
----------------
mtsokol wrote:

Done!

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


More information about the llvm-commits mailing list