[llvm] [GISel][CombinerHelper] Push freeze through non-poison-producing operands (PR #90618)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon May 20 05:05:26 PDT 2024
================
@@ -34,6 +34,22 @@ class GenericMachineInstr : public MachineInstr {
static bool classof(const MachineInstr *MI) {
return isPreISelGenericOpcode(MI->getOpcode());
}
+
+ bool hasPoisonGeneratingFlags() const {
+ return getFlags() & (NoUWrap | NoSWrap | IsExact | Disjoint | NonNeg |
+ FmNoNans | FmNoInfs);
+ }
+
+ void dropPoisonGeneratingFlags() {
+ clearFlag(NoUWrap);
+ clearFlag(NoSWrap);
+ clearFlag(IsExact);
+ clearFlag(Disjoint);
+ clearFlag(NonNeg);
+ clearFlag(FmNoNans);
+ clearFlag(FmNoInfs);
----------------
arsenm wrote:
You can add a clearFlags to MachineInstr to bulk clear flags
https://github.com/llvm/llvm-project/pull/90618
More information about the llvm-commits
mailing list