[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
This commit is contained in:
Paul Walker
2023-02-27 20:16:07 +00:00
parent fdda602c04
commit 62e46f2621
13 changed files with 37 additions and 80 deletions

View File

@@ -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());