Fix build against llvm yet another time
MODIFY
llvm_util/llvm2alive.cpp
llvm_util/llvm2alive.cpp
@@ -573,7 +573,8 @@ end:
assert(!isa<llvm::ScalableVectorType>(opvty));
vector<llvm::Constant *> offsets;
- for (unsigned i = 0; i < opvty->getElementCount().Min; ++i) {
+ for (unsigned i = 0; i < opvty->getElementCount().getKnownMinValue();
+ ++i) {
llvm::Constant *constofs = nullptr;
if (auto cdv = dyn_cast<llvm::ConstantDataVector>(I.getOperand())) {
constofs = cdv->getElementAsConstant(i);

MODIFY
llvm_util/utils.cpp
llvm_util/utils.cpp
@@ -157,7 +157,7 @@ Type* llvm_type2alive(const llvm::Type *ty) {
auto &cache = type_cache[ty];
if (!cache) {
auto vty = cast<llvm::VectorType>(ty);
- auto elems = vty->getElementCount().Min;
+ auto elems = vty->getElementCount().getKnownMinValue();
auto ety = llvm_type2alive(vty->getElementType());
if (!ety || elems > 128)
return nullptr;

MODIFY
tools/alive-tv.cpp
tools/alive-tv.cpp
@@ -238,12 +238,14 @@ static int cmpTypes(llvm::Type *TyL, llvm::Type *TyR,
case llvm::Type::FixedVectorTyID: {
auto *STyL = llvm::cast<llvm::VectorType>(TyL);
auto *STyR = llvm::cast<llvm::VectorType>(TyR);
- if (STyL->getElementCount().Scalable != STyR->getElementCount().Scalable)
- return cmpNumbers(STyL->getElementCount().Scalable,
- STyR->getElementCount().Scalable);
- if (STyL->getElementCount().Min != STyR->getElementCount().Min)
- return cmpNumbers(STyL->getElementCount().Min,
- STyR->getElementCount().Min);
+ if (STyL->getElementCount().isScalable() !=
+ STyR->getElementCount().isScalable())
+ return cmpNumbers(STyL->getElementCount().isScalable(),
+ STyR->getElementCount().isScalable());
+ if (STyL->getElementCount().getKnownMinValue() !=
+ STyR->getElementCount().getKnownMinValue())
+ return cmpNumbers(STyL->getElementCount().getKnownMinValue(),
+ STyR->getElementCount().getKnownMinValue());
return cmpTypes(STyL->getElementType(), STyR->getElementType(), FnL, FnR);
}
}

Fix build against llvm yet another time (#474)