From 8226d599ff21bd65be0f004648b4651894d00af1 Mon Sep 17 00:00:00 2001 From: Christopher Tetreault Date: Tue, 14 Apr 2020 13:46:27 -0700 Subject: [PATCH] [SVE] Remove calls to getBitWidth from Transforms Reviewers: efriedma, sdesmalen, spatel, eugenis, chandlerc Reviewed By: efriedma Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77896 --- llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | 2 +- llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | 3 ++- llvm/lib/Transforms/Utils/FunctionComparator.cpp | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index b1e41e7..b6f01d3 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -2071,7 +2071,7 @@ Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) { Value *V = LHS; unsigned MaskElems = Mask.size(); VectorType *SrcTy = cast(V->getType()); - unsigned VecBitWidth = SrcTy->getBitWidth(); + unsigned VecBitWidth = SrcTy->getPrimitiveSizeInBits().getFixedSize(); unsigned SrcElemBitWidth = DL.getTypeSizeInBits(SrcTy->getElementType()); assert(SrcElemBitWidth && "vector elements must have a bitwidth"); unsigned SrcNumElems = SrcTy->getNumElements(); diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index bb47c15..3de7fbf 100644 --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -1395,7 +1395,8 @@ struct MemorySanitizerVisitor : public InstVisitor { /// Flatten a vector type. Type *getShadowTyNoVec(Type *ty) { if (VectorType *vt = dyn_cast(ty)) - return IntegerType::get(*MS.C, vt->getBitWidth()); + return IntegerType::get(*MS.C, + vt->getPrimitiveSizeInBits().getFixedSize()); return ty; } diff --git a/llvm/lib/Transforms/Utils/FunctionComparator.cpp b/llvm/lib/Transforms/Utils/FunctionComparator.cpp index 760a2cf..b1de642 100644 --- a/llvm/lib/Transforms/Utils/FunctionComparator.cpp +++ b/llvm/lib/Transforms/Utils/FunctionComparator.cpp @@ -227,9 +227,9 @@ int FunctionComparator::cmpConstants(const Constant *L, unsigned TyRWidth = 0; if (auto *VecTyL = dyn_cast(TyL)) - TyLWidth = VecTyL->getBitWidth(); + TyLWidth = VecTyL->getPrimitiveSizeInBits().getFixedSize(); if (auto *VecTyR = dyn_cast(TyR)) - TyRWidth = VecTyR->getBitWidth(); + TyRWidth = VecTyR->getPrimitiveSizeInBits().getFixedSize(); if (TyLWidth != TyRWidth) return cmpNumbers(TyLWidth, TyRWidth); -- 2.7.4