OSDN Git Service

[SVE] Remove bad call to VectorType::getNumElements() from HeapProfiler
authorChristopher Tetreault <ctetreau@quicinc.com>
Thu, 27 Aug 2020 19:04:39 +0000 (12:04 -0700)
committerChristopher Tetreault <ctetreau@quicinc.com>
Thu, 27 Aug 2020 19:16:00 +0000 (12:16 -0700)
Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D86727

llvm/lib/Transforms/Instrumentation/HeapProfiler.cpp

index 16abe3a..6372dfd 100644 (file)
@@ -414,8 +414,8 @@ void HeapProfiler::instrumentMaskedLoadOrStore(const DataLayout &DL,
                                                Value *Addr, unsigned Alignment,
                                                uint32_t TypeSize,
                                                bool IsWrite) {
-  auto *VTy =
-      cast<VectorType>(cast<PointerType>(Addr->getType())->getElementType());
+  auto *VTy = cast<FixedVectorType>(
+      cast<PointerType>(Addr->getType())->getElementType());
   uint64_t ElemTypeSize = DL.getTypeStoreSizeInBits(VTy->getScalarType());
   unsigned Num = VTy->getNumElements();
   auto *Zero = ConstantInt::get(IntptrTy, 0);