[llvm] [IR] Add nowrap flags for trunc instruction (PR #85592)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 04:07:51 PDT 2024


================
@@ -946,6 +946,56 @@ class PossiblyNonNegInst : public CastInst {
   }
 };
 
+/// Cast Instruction that can have a nowrap flags (only trunc)
+class PossiblyNoWrapInst : public CastInst {
----------------
nikic wrote:

I'm wondering whether it wouldn't be better to just put this on `TruncInst` directly. We already have a separate instruction class for it, and I don't think there is really any benefit to also having PossiblyNoWrapInst that is effectively the same as TruncInst but not part of the same hierarchy.

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


More information about the llvm-commits mailing list