[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
This commit is contained in:
Nikita Popov
2023-03-06 10:46:22 +01:00
parent b293c6280d
commit bbfb13a5ff
38 changed files with 108 additions and 307 deletions

View File

@@ -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<Value *> BitcodeReader::materializeValue(unsigned StartValID,
@@ -1549,9 +1555,6 @@ Expected<Value *> 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;