[SVE] Remove calls to getBitWidth from Analysis
authorChristopher Tetreault <ctetreau@quicinc.com>
Mon, 20 Apr 2020 20:27:06 +0000 (13:27 -0700)
committerChristopher Tetreault <ctetreau@quicinc.com>
Mon, 20 Apr 2020 20:39:45 +0000 (13:39 -0700)
Reviewers: efriedma, sdesmalen, jnspaulsson, jonpa

Reviewed By: efriedma

Subscribers: tschuett, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

llvm/include/llvm/Analysis/TargetTransformInfoImpl.h

index 35853f5..a7ce8da 100644 (file)
@@ -632,9 +632,9 @@ protected:
       // Assume unsigned elements
       isSigned = false;
 
-      // The max required size is the total vector width divided by num
-      // of elements in the vector
-      unsigned MaxRequiredSize = VT->getBitWidth() / VT->getNumElements();
+      // The max required size is the size of the vector element type
+      unsigned MaxRequiredSize =
+          VT->getElementType()->getPrimitiveSizeInBits().getFixedSize();
 
       unsigned MinRequiredSize = 0;
       for (unsigned i = 0, e = VT->getNumElements(); i < e; ++i) {