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

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 10:24:26 PDT 2023


================
@@ -4892,10 +4893,14 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
         }
       } else {
         auto CastOp = (Instruction::CastOps)Opc;
+
         if (!CastInst::castIsValid(CastOp, Op, ResTy))
           return error("Invalid cast");
         I = CastInst::Create(CastOp, Op, ResTy);
       }
+      if (OpNum < Record.size() && isa<NonNegInstruction>(I) &&
+          (Record[OpNum] & (1 << bitc::NNI_NON_NEG)))
----------------
goldsteinn wrote:

nit: think `bitc:NNI_NON_NEG` can just be `1 << bitc::NNI_NON_NEG` (as opposed to the log). All the uses I see are as the mask and that seems to fit the pattern of other enums better as well.

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


More information about the llvm-commits mailing list