Commit ff772a7b by Nicolas Capens Committed by Nicolas Capens

Don't use deprecated llvm::Type::getVectorNumElements()

Use llvm::VectorType::getNumElements() instead by casting to the expected subtype. Bug: b/152339534 Change-Id: I29d2b8d60872f6f4eff4ae2bb38d1738515d11dc Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/44068 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
parent 068611f0
...@@ -420,7 +420,7 @@ llvm::Value *createGather(llvm::Value *base, llvm::Type *elTy, llvm::Value *offs ...@@ -420,7 +420,7 @@ llvm::Value *createGather(llvm::Value *base, llvm::Type *elTy, llvm::Value *offs
ASSERT(offsets->getType()->isVectorTy()); ASSERT(offsets->getType()->isVectorTy());
ASSERT(mask->getType()->isVectorTy()); ASSERT(mask->getType()->isVectorTy());
auto numEls = mask->getType()->getVectorNumElements(); auto numEls = llvm::cast<llvm::VectorType>(mask->getType())->getNumElements();
auto i1Ty = ::llvm::Type::getInt1Ty(jit->context); auto i1Ty = ::llvm::Type::getInt1Ty(jit->context);
auto i32Ty = ::llvm::Type::getInt32Ty(jit->context); auto i32Ty = ::llvm::Type::getInt32Ty(jit->context);
auto i8Ty = ::llvm::Type::getInt8Ty(jit->context); auto i8Ty = ::llvm::Type::getInt8Ty(jit->context);
...@@ -445,13 +445,13 @@ void createScatter(llvm::Value *base, llvm::Value *val, llvm::Value *offsets, ll ...@@ -445,13 +445,13 @@ void createScatter(llvm::Value *base, llvm::Value *val, llvm::Value *offsets, ll
ASSERT(offsets->getType()->isVectorTy()); ASSERT(offsets->getType()->isVectorTy());
ASSERT(mask->getType()->isVectorTy()); ASSERT(mask->getType()->isVectorTy());
auto numEls = mask->getType()->getVectorNumElements(); auto numEls = llvm::cast<llvm::VectorType>(mask->getType())->getNumElements();
auto i1Ty = ::llvm::Type::getInt1Ty(jit->context); auto i1Ty = ::llvm::Type::getInt1Ty(jit->context);
auto i32Ty = ::llvm::Type::getInt32Ty(jit->context); auto i32Ty = ::llvm::Type::getInt32Ty(jit->context);
auto i8Ty = ::llvm::Type::getInt8Ty(jit->context); auto i8Ty = ::llvm::Type::getInt8Ty(jit->context);
auto i8PtrTy = i8Ty->getPointerTo(); auto i8PtrTy = i8Ty->getPointerTo();
auto elVecTy = val->getType(); auto elVecTy = val->getType();
auto elTy = elVecTy->getVectorElementType(); auto elTy = llvm::cast<llvm::VectorType>(elVecTy)->getElementType();
auto elPtrTy = elTy->getPointerTo(); auto elPtrTy = elTy->getPointerTo();
auto elPtrVecTy = ::llvm::VectorType::get(elPtrTy, numEls); auto elPtrVecTy = ::llvm::VectorType::get(elPtrTy, numEls);
auto i8Base = jit->builder->CreatePointerCast(base, i8PtrTy); auto i8Base = jit->builder->CreatePointerCast(base, i8PtrTy);
...@@ -1133,7 +1133,7 @@ Value *Nucleus::createMaskedLoad(Value *ptr, Type *elTy, Value *mask, unsigned i ...@@ -1133,7 +1133,7 @@ Value *Nucleus::createMaskedLoad(Value *ptr, Type *elTy, Value *mask, unsigned i
ASSERT(V(ptr)->getType()->isPointerTy()); ASSERT(V(ptr)->getType()->isPointerTy());
ASSERT(V(mask)->getType()->isVectorTy()); ASSERT(V(mask)->getType()->isVectorTy());
auto numEls = V(mask)->getType()->getVectorNumElements(); auto numEls = llvm::cast<llvm::VectorType>(V(mask)->getType())->getNumElements();
auto i1Ty = ::llvm::Type::getInt1Ty(jit->context); auto i1Ty = ::llvm::Type::getInt1Ty(jit->context);
auto i32Ty = ::llvm::Type::getInt32Ty(jit->context); auto i32Ty = ::llvm::Type::getInt32Ty(jit->context);
auto elVecTy = ::llvm::VectorType::get(T(elTy), numEls); auto elVecTy = ::llvm::VectorType::get(T(elTy), numEls);
...@@ -1153,7 +1153,7 @@ void Nucleus::createMaskedStore(Value *ptr, Value *val, Value *mask, unsigned in ...@@ -1153,7 +1153,7 @@ void Nucleus::createMaskedStore(Value *ptr, Value *val, Value *mask, unsigned in
ASSERT(V(val)->getType()->isVectorTy()); ASSERT(V(val)->getType()->isVectorTy());
ASSERT(V(mask)->getType()->isVectorTy()); ASSERT(V(mask)->getType()->isVectorTy());
auto numEls = V(mask)->getType()->getVectorNumElements(); auto numEls = llvm::cast<llvm::VectorType>(V(mask)->getType())->getNumElements();
auto i1Ty = ::llvm::Type::getInt1Ty(jit->context); auto i1Ty = ::llvm::Type::getInt1Ty(jit->context);
auto i32Ty = ::llvm::Type::getInt32Ty(jit->context); auto i32Ty = ::llvm::Type::getInt32Ty(jit->context);
auto elVecTy = V(val)->getType(); auto elVecTy = V(val)->getType();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment