LLVM  14.0.0git
XCoreTargetTransformInfo.h
Go to the documentation of this file.
1 //===-- XCoreTargetTransformInfo.h - XCore specific TTI ---------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 /// \file
9 /// This file a TargetTransformInfo::Concept conforming object specific to the
10 /// XCore target machine. It uses the target's detailed information to
11 /// provide more precise answers to certain TTI queries, while letting the
12 /// target independent and default TTI implementations handle the rest.
13 ///
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_LIB_TARGET_XCORE_XCORETARGETTRANSFORMINFO_H
17 #define LLVM_LIB_TARGET_XCORE_XCORETARGETTRANSFORMINFO_H
18 
19 #include "XCore.h"
20 #include "XCoreTargetMachine.h"
24 
25 namespace llvm {
26 
27 class XCoreTTIImpl : public BasicTTIImplBase<XCoreTTIImpl> {
29  typedef TargetTransformInfo TTI;
30  friend BaseT;
31 
32  const XCoreSubtarget *ST;
33  const XCoreTargetLowering *TLI;
34 
35  const XCoreSubtarget *getST() const { return ST; }
36  const XCoreTargetLowering *getTLI() const { return TLI; }
37 
38 public:
39  explicit XCoreTTIImpl(const XCoreTargetMachine *TM, const Function &F)
40  : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl()),
41  TLI(ST->getTargetLowering()) {}
42 
43  unsigned getNumberOfRegisters(unsigned ClassID) const {
44  bool Vector = (ClassID == 1);
45  if (Vector) {
46  return 0;
47  }
48  return 12;
49  }
50 };
51 
52 } // end namespace llvm
53 
54 #endif
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::Function
Definition: Function.h:62
XCore.h
llvm::TargetTransformInfo
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
Definition: TargetTransformInfo.h:168
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::XCoreTargetLowering
Definition: XCoreISelLowering.h:91
llvm::TargetTransformInfoImplBase::getDataLayout
const DataLayout & getDataLayout() const
Definition: TargetTransformInfoImpl.h:48
TargetLowering.h
llvm::XCoreTargetMachine
Definition: XCoreTargetMachine.h:26
llvm::BasicTTIImplBase
Base class which can be used to help build a TTI implementation.
Definition: BasicTTIImpl.h:77
llvm::XCoreTTIImpl
Definition: XCoreTargetTransformInfo.h:27
llvm::XCoreTTIImpl::getNumberOfRegisters
unsigned getNumberOfRegisters(unsigned ClassID) const
Definition: XCoreTargetTransformInfo.h:43
getParent
static const Function * getParent(const Value *V)
Definition: BasicAliasAnalysis.cpp:890
llvm::XCoreTTIImpl::XCoreTTIImpl
XCoreTTIImpl(const XCoreTargetMachine *TM, const Function &F)
Definition: XCoreTargetTransformInfo.h:39
XCoreTargetMachine.h
Vector
So we should use XX3Form_Rcr to implement instrinsic Convert DP outs ins xscvdpsp No builtin are required Round &Convert QP DP(dword[1] is set to zero) No builtin are required Round to Quad Precision because you need to assign rounding mode in instruction Provide builtin(set f128:$vT,(int_ppc_vsx_xsrqpi f128:$vB))(set f128 yields< n x< ty > >< result > yields< ty >< result > No builtin are required Load Store Vector
Definition: README_P9.txt:497
TargetTransformInfo.h
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
BasicTTIImpl.h
llvm::XCoreSubtarget
Definition: XCoreSubtarget.h:31