[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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user