[PATCH] D77269: Clean up usages of asserting vector getters in Type
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 3 13:36:05 PDT 2020
efriedma added inline comments.
================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:212
return VectorType::get(ArgTy->getScalarType(),
- DstTy->getVectorNumElements());
+ cast<VectorType>(DstTy)->getElementCount());
};
----------------
Please don't mix in semantic changes.
================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:689
assert(Factor >= 2 && "Invalid interleave factor");
- assert(isa<VectorType>(VecTy) && "Expect a vector type");
+ auto *VecVTy = dyn_cast<VectorType>(VecTy);
+ assert(VecVTy && "Expect a vector type");
----------------
The assertion text isn't useful; just cast<>
================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:908
+ auto *VTy = dyn_cast<VectorType>(Ty);
+ assert(VTy && "Expected Ty to be a vector type");
unsigned ScalarBits = Ty->getScalarSizeInBits();
----------------
The assertion text isn't useful; just cast<>
================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h:183
// power of 2 > 1.
if (isa<VectorType>(DataType)) {
+ unsigned NumElements = cast<VectorType>(DataType)->getNumElements();
----------------
dyn_cast
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77269/new/
https://reviews.llvm.org/D77269
More information about the llvm-commits
mailing list