[llvm] [GlobalIsel] Combine freeze (PR #93239)

Thorsten Schütt via llvm-commits llvm-commits at lists.llvm.org
Sat May 25 10:42:19 PDT 2024


================
@@ -1745,18 +1778,55 @@ static bool canCreateUndefOrPoison(Register Reg, const MachineRegisterInfo &MRI,
                                    UndefPoisonKind Kind) {
   MachineInstr *RegDef = MRI.getVRegDef(Reg);
 
-  if (auto *GMI = dyn_cast<GenericMachineInstr>(RegDef)) {
-    if (ConsiderFlagsAndMetadata && includesPoison(Kind) &&
-        GMI->hasPoisonGeneratingFlags())
-      return true;
-  } else {
-    // Conservatively return true.
-    return true;
-  }
----------------
tschuett wrote:

The IRTranslator only attaches flags to Gisel Instructions aka `GenericMachineInstr`. The test is only about poison generating flags resp. annotations. Sure an AARCH64 div instruction can generate poison by division by 0, but it has no poison generating flags.

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


More information about the llvm-commits mailing list