aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2024-06-04 08:31:03 +0200
committerGitHub <noreply@github.com>2024-06-04 08:31:03 +0200
commitdeab451e7a7f2dff42097049274637052c87eabd (patch)
tree5a261b1bbbdcb0e3c7c732eb4a6d1cc187743dbf /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent46672c1dc3272adda838caa87bf3fb17411986fb (diff)
downloadllvm-deab451e7a7f2dff42097049274637052c87eabd.zip
llvm-deab451e7a7f2dff42097049274637052c87eabd.tar.gz
llvm-deab451e7a7f2dff42097049274637052c87eabd.tar.bz2
[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.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp6
1 files changed, 2 insertions, 4 deletions
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<Value *> 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(),