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

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 17 13:01:13 PDT 2023


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

Is this meant to mirror how we use `OverflowingBinaryOperator` now?
But I'd say if there is even a change we might expand this, keeping the class makes sense but would leave it's name as `NonNegCastInstruction` for now. The refactor to rename `NonNegCastInstruction` -> `NonNegInstruction` will probably be cheaper than if we skip it entirely.
I guess when I made the comment I wasn't thinking the flag may be applied to other instructions, which makes me less opposed to the current name.

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


More information about the llvm-commits mailing list