diff options
author | Nikita Popov <npopov@redhat.com> | 2023-03-06 10:46:22 +0100 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-03-16 10:32:08 +0100 |
commit | bbfb13a5ffbccf1759ca6b75262a3ffdbe20496e (patch) | |
tree | 7b86a9e7b80e0b6684cd784606065d471f85c471 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | b293c6280d06f49c5ca7290855911341ab0bdffa (diff) | |
download | llvm-bbfb13a5ffbccf1759ca6b75262a3ffdbe20496e.zip llvm-bbfb13a5ffbccf1759ca6b75262a3ffdbe20496e.tar.gz llvm-bbfb13a5ffbccf1759ca6b75262a3ffdbe20496e.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
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<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; |