[llvm] [IR] Add `samesign` flag to icmp instruction (PR #111419)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 13 13:37:16 PDT 2024


================
@@ -5482,6 +5482,8 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
         if (!CmpInst::isIntPredicate(PredVal))
           return error("Invalid icmp predicate");
         I = new ICmpInst(PredVal, LHS, RHS);
+        if (Record[OpNum] & (1 << bitc::PSSI_SAME_SIGN))
+          cast<ICmpInst>(I)->setSameSign(true);
----------------
nikic wrote:

The bitcode writer only appends the flags record if there are flags, so the bitcode reader needs to check the number of records to determine whether there are any flags.

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


More information about the llvm-commits mailing list