From bbfb13a5ffbccf1759ca6b75262a3ffdbe20496e Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 6 Mar 2023 10:46:22 +0100 Subject: [ConstExpr] Remove select constant expression This removes the select constant expression, as part of https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179. Uses of this expressions have already been removed in advance, so this just removes related infrastructure and updates tests. Differential Revision: https://reviews.llvm.org/D145382 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 11 +++++++---- 1 file changed, 7 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 dd75542..6461624 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1417,7 +1417,13 @@ static bool isConstExprSupported(const BitcodeConstant *BC) { if (Opcode == Instruction::GetElementPtr) return ConstantExpr::isSupportedGetElementPtr(BC->SrcElemTy); - return Opcode != Instruction::FNeg; + switch (Opcode) { + case Instruction::FNeg: + case Instruction::Select: + return false; + default: + return true; + } } Expected BitcodeReader::materializeValue(unsigned StartValID, @@ -1549,9 +1555,6 @@ Expected BitcodeReader::materializeValue(unsigned StartValID, ArrayRef(ConstOps).drop_front(), BC->Flags, BC->getInRangeIndex()); break; - case Instruction::Select: - C = ConstantExpr::getSelect(ConstOps[0], ConstOps[1], ConstOps[2]); - break; case Instruction::ExtractElement: C = ConstantExpr::getExtractElement(ConstOps[0], ConstOps[1]); break; -- cgit v1.1