[llvm] 56e4888 - [SVE] Remove calls to getBitWidth from Analysis

Christopher Tetreault via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 20 13:40:00 PDT 2020


Author: Christopher Tetreault
Date: 2020-04-20T13:39:45-07:00
New Revision: 56e4888627b3109eba9de192af6b7c19b74509c2

URL: https://github.com/llvm/llvm-project/commit/56e4888627b3109eba9de192af6b7c19b74509c2
DIFF: https://github.com/llvm/llvm-project/commit/56e4888627b3109eba9de192af6b7c19b74509c2.diff

LOG: [SVE] Remove calls to getBitWidth from Analysis

Reviewers: efriedma, sdesmalen, jnspaulsson, jonpa

Reviewed By: efriedma

Subscribers: tschuett, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/TargetTransformInfoImpl.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
index 35853f540b6c..a7ce8da5a068 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
@@ -632,9 +632,9 @@ class TargetTransformInfoImplBase {
       // 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) {


        


More information about the llvm-commits mailing list