Skip to content

Commit 929c0f2

Browse files
committed
Create clearFlags()
1 parent b619129 commit 929c0f2

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,8 @@ class GenericMachineInstr : public MachineInstr {
4141
}
4242

4343
void dropPoisonGeneratingFlags() {
44-
clearFlag(NoUWrap);
45-
clearFlag(NoSWrap);
46-
clearFlag(IsExact);
47-
clearFlag(Disjoint);
48-
clearFlag(NonNeg);
49-
clearFlag(FmNoNans);
50-
clearFlag(FmNoInfs);
44+
clearFlags(NoUWrap | NoSWrap | IsExact | Disjoint | NonNeg | FmNoNans |
45+
FmNoInfs);
5146
assert(!hasPoisonGeneratingFlags());
5247
}
5348
};

llvm/include/llvm/CodeGen/MachineInstr.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,12 @@ class MachineInstr
416416
Flags &= ~((uint32_t)Flag);
417417
}
418418

419+
void clearFlags(unsigned flags) {
420+
assert(isUInt<LLVM_MI_FLAGS_BITS>(flags) &&
421+
"flags to be cleared are out of range for the Flags field");
422+
Flags &= ~flags;
423+
}
424+
419425
/// Return true if MI is in a bundle (but not the first MI in a bundle).
420426
///
421427
/// A bundle looks like this before it's finalized:

0 commit comments

Comments
 (0)