/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/XCore/XCoreTargetTransformInfo.h
Line | Count | Source (jump to first uncovered line) |
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" |
21 | | #include "llvm/Analysis/TargetTransformInfo.h" |
22 | | #include "llvm/CodeGen/BasicTTIImpl.h" |
23 | | #include "llvm/CodeGen/TargetLowering.h" |
24 | | |
25 | | namespace llvm { |
26 | | |
27 | | class XCoreTTIImpl : public BasicTTIImplBase<XCoreTTIImpl> { |
28 | | typedef BasicTTIImplBase<XCoreTTIImpl> BaseT; |
29 | | typedef TargetTransformInfo TTI; |
30 | | friend BaseT; |
31 | | |
32 | | const XCoreSubtarget *ST; |
33 | | const XCoreTargetLowering *TLI; |
34 | | |
35 | 0 | const XCoreSubtarget *getST() const { return ST; } |
36 | 26 | 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 | 1.89k | TLI(ST->getTargetLowering()) {} |
42 | | |
43 | 6 | unsigned getNumberOfRegisters(bool Vector) { |
44 | 6 | if (Vector) { |
45 | 2 | return 0; |
46 | 2 | } |
47 | 4 | return 12; |
48 | 4 | } |
49 | | }; |
50 | | |
51 | | } // end namespace llvm |
52 | | |
53 | | #endif |