[PATCH] D77261: Clean up usages of asserting vector getters in Type
Christopher Tetreault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 2 11:56:04 PDT 2020
ctetreau updated this revision to Diff 254581.
ctetreau added a comment.
update to mention that this is NFC
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77261/new/
https://reviews.llvm.org/D77261
Files:
llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
llvm/lib/Transforms/Scalar/Scalarizer.cpp
Index: llvm/lib/Transforms/Scalar/Scalarizer.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/Scalarizer.cpp
+++ llvm/lib/Transforms/Scalar/Scalarizer.cpp
@@ -252,7 +252,7 @@
PtrTy = dyn_cast<PointerType>(Ty);
if (PtrTy)
Ty = PtrTy->getElementType();
- Size = Ty->getVectorNumElements();
+ Size = cast<VectorType>(Ty)->getNumElements();
if (!CachePtr)
Tmp.resize(Size, nullptr);
else if (CachePtr->empty())
@@ -269,7 +269,7 @@
return CV[I];
IRBuilder<> Builder(BB, BBI);
if (PtrTy) {
- Type *ElTy = PtrTy->getElementType()->getVectorElementType();
+ Type *ElTy = cast<VectorType>(PtrTy->getElementType())->getElementType();
if (!CV[0]) {
Type *NewPtrTy = PointerType::get(ElTy, PtrTy->getAddressSpace());
CV[0] = Builder.CreateBitCast(V, NewPtrTy, V->getName() + ".i0");
@@ -852,10 +852,10 @@
if (!Op->use_empty()) {
// The value is still needed, so recreate it using a series of
// InsertElements.
- Type *Ty = Op->getType();
+ auto *Ty = cast<VectorType>(Op->getType());
Value *Res = UndefValue::get(Ty);
BasicBlock *BB = Op->getParent();
- unsigned Count = Ty->getVectorNumElements();
+ unsigned Count = Ty->getNumElements();
IRBuilder<> Builder(Op);
if (isa<PHINode>(Op))
Builder.SetInsertPoint(BB, BB->getFirstInsertionPt());
Index: llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -2631,9 +2631,11 @@
unsigned VF = 0;
for (unsigned i = 0; i < I.getNumOperands(); i++)
if (I.getOperand(i)->getType()->isVectorTy()) {
- assert(VF == 0 ||
- VF == I.getOperand(i)->getType()->getVectorNumElements());
- VF = I.getOperand(i)->getType()->getVectorNumElements();
+ assert(
+ VF == 0 ||
+ VF ==
+ cast<VectorType>(I.getOperand(i)->getType())->getNumElements());
+ VF = cast<VectorType>(I.getOperand(i)->getType())->getNumElements();
}
// It's the vector to scalar traversal through the pointer operand which
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77261.254581.patch
Type: text/x-patch
Size: 2301 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200402/9a993f3c/attachment.bin>
More information about the llvm-commits
mailing list