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
12 lines
527 B
LLVM
12 lines
527 B
LLVM
; RUN: opt < %s -cost-model -analyze -mtriple=systemz-unknown -mcpu=z13 | FileCheck %s
|
|
|
|
; Test that the cost heuristic for a folded load works also for a pointer operand.
|
|
define void @fun0(i64* %lhs, i64** %rhs_ptr) {
|
|
%rhs = load i64*, i64** %rhs_ptr
|
|
%c = icmp eq i64* %lhs, %rhs
|
|
ret void
|
|
; CHECK: Printing analysis 'Cost Model Analysis' for function 'fun0':
|
|
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %rhs = load
|
|
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %c = icmp
|
|
}
|