[SystemZ] Take better care when computing needed vector registers in TTI.
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Wed, 10 Oct 2018 07:36:27 +0000 (07:36 +0000)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Wed, 10 Oct 2018 07:36:27 +0000 (07:36 +0000)
commit2c8b33770c0c4cff75c4cb60d0daebfcf624ab15
treebd9fc92b0d5b6d499f04ce0e4ec7395557adcd21
parent40dc63e1f0928ee31ae30390e6b03a6c79dc178c
[SystemZ]  Take better care when computing needed vector registers in TTI.

A new function getNumVectorRegs() is better to use for the number of needed
vector registers instead of getNumberOfParts(). This is to make sure that the
number of vector registers (and typically operations) required for a vector
type is accurate.

getNumberOfParts() which was previously used works by splitting the vector
type until it is legal gives incorrect results for types with a non
power of two number of elements (rare).

A new static function getScalarSizeInBits() that also checks for a pointer
type and returns 64U for it since otherwise it gets a value of 0). Used in a
few places where Ty may be pointer.

Review: Ulrich Weigand
llvm-svn: 344115
llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
llvm/test/Analysis/CostModel/SystemZ/load-ptr-cmp-fold.ll [new file with mode: 0644]
llvm/test/Analysis/CostModel/SystemZ/numvectorregs.ll [new file with mode: 0644]