From deab451e7a7f2dff42097049274637052c87eabd Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 4 Jun 2024 08:31:03 +0200 Subject: [IR] Remove support for icmp and fcmp constant expressions (#93038) Remove support for the icmp and fcmp constant expressions. This is part of: https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179 As usual, many of the updated tests will no longer test what they were originally intended to -- this is hard to preserve when constant expressions get removed, and in many cases just impossible as the existence of a specific kind of constant expression was the cause of the issue in the first place. --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index aee627b..8519796 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1495,6 +1495,8 @@ static bool isConstExprSupported(const BitcodeConstant *BC) { switch (Opcode) { case Instruction::FNeg: case Instruction::Select: + case Instruction::ICmp: + case Instruction::FCmp: return false; default: return true; @@ -1633,10 +1635,6 @@ Expected BitcodeReader::materializeValue(unsigned StartValID, case BitcodeConstant::ConstantVectorOpcode: C = ConstantVector::get(ConstOps); break; - case Instruction::ICmp: - case Instruction::FCmp: - C = ConstantExpr::getCompare(BC->Flags, ConstOps[0], ConstOps[1]); - break; case Instruction::GetElementPtr: C = ConstantExpr::getGetElementPtr( BC->SrcElemTy, ConstOps[0], ArrayRef(ConstOps).drop_front(), -- cgit v1.1