1 //===-- SystemZTargetTransformInfo.h - SystemZ-specific TTI ---------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETTRANSFORMINFO_H
11 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETTRANSFORMINFO_H
13 #include "SystemZTargetMachine.h"
14 #include "llvm/Analysis/TargetTransformInfo.h"
15 #include "llvm/CodeGen/BasicTTIImpl.h"
19 class SystemZTTIImpl : public BasicTTIImplBase<SystemZTTIImpl> {
20 typedef BasicTTIImplBase<SystemZTTIImpl> BaseT;
21 typedef TargetTransformInfo TTI;
24 const SystemZSubtarget *ST;
25 const SystemZTargetLowering *TLI;
27 const SystemZSubtarget *getST() const { return ST; }
28 const SystemZTargetLowering *getTLI() const { return TLI; }
31 explicit SystemZTTIImpl(const SystemZTargetMachine *TM, const Function &F)
32 : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)),
33 TLI(ST->getTargetLowering()) {}
35 /// \name Scalar TTI Implementations
38 int getIntImmCost(const APInt &Imm, Type *Ty);
40 int getIntImmCost(unsigned Opcode, unsigned Idx, const APInt &Imm, Type *Ty);
41 int getIntImmCost(Intrinsic::ID IID, unsigned Idx, const APInt &Imm,
44 TTI::PopcntSupportKind getPopcntSupport(unsigned TyWidth);
46 void getUnrollingPreferences(Loop *L, TTI::UnrollingPreferences &UP);
50 /// \name Vector TTI Implementations
53 unsigned getNumberOfRegisters(bool Vector);
54 unsigned getRegisterBitWidth(bool Vector);
59 } // end namespace llvm