1 //===-- HexagonTargetTransformInfo.cpp - Hexagon specific TTI pass --------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
9 /// This file implements a TargetTransformInfo analysis pass specific to the
10 /// Hexagon target machine. It uses the target's detailed information to provide
11 /// more precise answers to certain TTI queries, while letting the target
12 /// independent and default TTI implementations handle the rest.
14 //===----------------------------------------------------------------------===//
16 #include "HexagonTargetTransformInfo.h"
17 #include "llvm/Support/Debug.h"
21 #define DEBUG_TYPE "hexagontti"
23 TargetTransformInfo::PopcntSupportKind
24 HexagonTTIImpl::getPopcntSupport(unsigned IntTyWidthInBit) const {
25 // Return Fast Hardware support as every input < 64 bits will be promoted
27 return TargetTransformInfo::PSK_FastHardware;
30 // The Hexagon target can unroll loops with run-time trip counts.
31 void HexagonTTIImpl::getUnrollingPreferences(Loop *L,
32 TTI::UnrollingPreferences &UP) {
33 UP.Runtime = UP.Partial = true;
36 unsigned HexagonTTIImpl::getNumberOfRegisters(bool vector) const {
37 return vector ? 0 : 32;