[clang] [llvm] [IR] Add getelementptr nusw and nuw flags (PR #90824)

via cfe-commits cfe-commits at lists.llvm.org
Thu May 2 10:29:17 PDT 2024


================
@@ -1699,8 +1701,12 @@ Expected<Value *> BitcodeReader::materializeValue(unsigned StartValID,
         I = GetElementPtrInst::Create(BC->SrcElemTy, Ops[0],
                                       ArrayRef(Ops).drop_front(), "constexpr",
                                       InsertBB);
-        if (BC->Flags)
+        if (BC->Flags & (1 << bitc::GEP_INBOUNDS))
           cast<GetElementPtrInst>(I)->setIsInBounds();
+        if (BC->Flags & (1 << bitc::GEP_NUSW))
----------------
goldsteinn wrote:

likewise elsewhere.

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


More information about the cfe-commits mailing list