[llvm] [IR] Add zext nneg flag (PR #67982)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 17 13:23:58 PDT 2023


================
@@ -692,6 +692,20 @@ class CastInst : public UnaryInstruction {
   }
 };
 
+/// Instruction that can have a nneg flag (only zext).
+class NonNegInstruction : public CastInst {
----------------
nikic wrote:

> Is this meant to mirror how we use `OverflowingBinaryOperator` now?

Yes. I guess the name is confusing in that it sounds like "an instruction with the nneg flag", while in reality this is "an instruction that may or may not have the nneg flag". A more accurate name, taking inspiration from PossiblyExactOperator, would be PossiblyNonNegInstruction. Or I guess PossiblyNonNegCastInst taking your suggestion into account.

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


More information about the llvm-commits mailing list