diff options
author | Paul Walker <paul.walker@arm.com> | 2023-02-27 20:16:07 +0000 |
---|---|---|
committer | Paul Walker <paul.walker@arm.com> | 2023-03-14 16:48:33 +0000 |
commit | 62e46f262158e2a6ea9c1c458f52633bb40a8590 (patch) | |
tree | 23dccb894f8248c32b6fac7f5db287c3a040cb32 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | fdda602c04e43f7be8820996d3161abb71bec67b (diff) | |
download | llvm-62e46f262158e2a6ea9c1c458f52633bb40a8590.zip llvm-62e46f262158e2a6ea9c1c458f52633bb40a8590.tar.gz llvm-62e46f262158e2a6ea9c1c458f52633bb40a8590.tar.bz2 |
[LLVM] Remove support for constant scalable vector GEPs.
This work has fallen out from D134648 as a requirement to loosen
the "constness" of vscale.
Differential Revision: https://reviews.llvm.org/D145404
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 2c1f195..dd75542 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1399,7 +1399,9 @@ unsigned BitcodeReader::getVirtualTypeID(Type *Ty, return TypeID; } -static bool isConstExprSupported(uint8_t Opcode) { +static bool isConstExprSupported(const BitcodeConstant *BC) { + uint8_t Opcode = BC->Opcode; + // These are not real constant expressions, always consider them supported. if (Opcode >= BitcodeConstant::FirstSpecialOpcode) return true; @@ -1412,6 +1414,9 @@ static bool isConstExprSupported(uint8_t Opcode) { if (Instruction::isBinaryOp(Opcode)) return ConstantExpr::isSupportedBinOp(Opcode); + if (Opcode == Instruction::GetElementPtr) + return ConstantExpr::isSupportedGetElementPtr(BC->SrcElemTy); + return Opcode != Instruction::FNeg; } @@ -1467,7 +1472,7 @@ Expected<Value *> BitcodeReader::materializeValue(unsigned StartValID, ConstOps.push_back(C); // Materialize as constant expression if possible. - if (isConstExprSupported(BC->Opcode) && ConstOps.size() == Ops.size()) { + if (isConstExprSupported(BC) && ConstOps.size() == Ops.size()) { Constant *C; if (Instruction::isCast(BC->Opcode)) { C = UpgradeBitCastExpr(BC->Opcode, ConstOps[0], BC->getType()); |