LLVM  3.7.0
SystemZTargetTransformInfo.h
Go to the documentation of this file.
1 //===-- SystemZTargetTransformInfo.h - SystemZ-specific TTI ---------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETTRANSFORMINFO_H
11 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETTRANSFORMINFO_H
12 
13 #include "SystemZTargetMachine.h"
16 
17 namespace llvm {
18 
19 class SystemZTTIImpl : public BasicTTIImplBase<SystemZTTIImpl> {
21  typedef TargetTransformInfo TTI;
22  friend BaseT;
23 
24  const SystemZSubtarget *ST;
25  const SystemZTargetLowering *TLI;
26 
27  const SystemZSubtarget *getST() const { return ST; }
28  const SystemZTargetLowering *getTLI() const { return TLI; }
29 
30 public:
32  : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)),
33  TLI(ST->getTargetLowering()) {}
34 
35  // Provide value semantics. MSVC requires that we spell all of these out.
37  : BaseT(static_cast<const BaseT &>(Arg)), ST(Arg.ST), TLI(Arg.TLI) {}
39  : BaseT(std::move(static_cast<BaseT &>(Arg))), ST(std::move(Arg.ST)),
40  TLI(std::move(Arg.TLI)) {}
41 
42  /// \name Scalar TTI Implementations
43  /// @{
44 
45  unsigned getIntImmCost(const APInt &Imm, Type *Ty);
46 
47  unsigned getIntImmCost(unsigned Opcode, unsigned Idx, const APInt &Imm,
48  Type *Ty);
49  unsigned getIntImmCost(Intrinsic::ID IID, unsigned Idx, const APInt &Imm,
50  Type *Ty);
51 
52  TTI::PopcntSupportKind getPopcntSupport(unsigned TyWidth);
53 
54  /// @}
55 
56  /// \name Vector TTI Implementations
57  /// @{
58 
59  unsigned getNumberOfRegisters(bool Vector);
60  unsigned getRegisterBitWidth(bool Vector);
61 
62  /// @}
63 };
64 
65 } // end namespace llvm
66 
67 #endif
SystemZTTIImpl(SystemZTTIImpl &&Arg)
F(f)
Base class which can be used to help build a TTI implementation.
Definition: BasicTTIImpl.h:40
TTI::PopcntSupportKind getPopcntSupport(unsigned TyWidth)
unsigned getNumberOfRegisters(bool Vector)
PopcntSupportKind
Flags indicating the kind of support for population count.
unsigned getIntImmCost(const APInt &Imm, Type *Ty)
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:45
This file provides a helper that implements much of the TTI interface in terms of the target-independ...
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
unsigned getRegisterBitWidth(bool Vector)
SystemZTTIImpl(const SystemZTargetMachine *TM, Function &F)
Class for arbitrary precision integers.
Definition: APInt.h:73
const DataLayout & getDataLayout() const
SystemZTTIImpl(const SystemZTTIImpl &Arg)
aarch64 promote const
static const Function * getParent(const Value *V)
This pass exposes codegen information to IR-level passes.