[llvm] [IR] Add `samesign` flag to icmp instruction (PR #111419)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 13 12:02:20 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:
You can't unconditionally read this, you need to check the record length first. See how the IsFP case for FMF is handled above.
This is the cause of the test failures.
https://github.com/llvm/llvm-project/pull/111419
More information about the llvm-commits
mailing list