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

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 18 12:23:18 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:

Okay to keep as log then (although I'd say preferably all would be changed to be the mask), but then can you cast `1` to the proper shift width. Otherwise just feels like bug waiting to happen.

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


More information about the llvm-commits mailing list