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

via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 10:27:12 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:

nit: this could be `else if`.

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


More information about the llvm-commits mailing list