From e4a4122eb6768b69640173b4c32fd88de4547227 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 3 Nov 2023 10:46:07 +0100 Subject: [IR] Remove zext and sext constant expressions (#71040) Remove support for zext and sext constant expressions. All places creating them have been removed beforehand, so this just removes the APIs and uses of these constant expressions in tests. There is some additional cleanup that can be done on top of this, e.g. we can remove the ZExtInst vs ZExtOperator footgun. This is part of https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179. --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 3 +++ 1 file changed, 3 insertions(+) (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 747968b..1c92da5a 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1394,6 +1394,9 @@ static bool isConstExprSupported(const BitcodeConstant *BC) { if (Instruction::isBinaryOp(Opcode)) return ConstantExpr::isSupportedBinOp(Opcode); + if (Instruction::isCast(Opcode)) + return ConstantExpr::isSupportedCastOp(Opcode); + if (Opcode == Instruction::GetElementPtr) return ConstantExpr::isSupportedGetElementPtr(BC->SrcElemTy); -- cgit v1.1