Coverage Report

Created: 2018-11-16 02:38

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/CodeGen/BasicTTIImpl.h
Line
Count
Source (jump to first uncovered line)
1
//===- BasicTTIImpl.h -------------------------------------------*- C++ -*-===//
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
/// \file
11
/// This file provides a helper that implements much of the TTI interface in
12
/// terms of the target-independent code generator and TargetLowering
13
/// interfaces.
14
//
15
//===----------------------------------------------------------------------===//
16
17
#ifndef LLVM_CODEGEN_BASICTTIIMPL_H
18
#define LLVM_CODEGEN_BASICTTIIMPL_H
19
20
#include "llvm/ADT/APInt.h"
21
#include "llvm/ADT/ArrayRef.h"
22
#include "llvm/ADT/BitVector.h"
23
#include "llvm/ADT/SmallPtrSet.h"
24
#include "llvm/ADT/SmallVector.h"
25
#include "llvm/Analysis/LoopInfo.h"
26
#include "llvm/Analysis/TargetTransformInfo.h"
27
#include "llvm/Analysis/TargetTransformInfoImpl.h"
28
#include "llvm/CodeGen/ISDOpcodes.h"
29
#include "llvm/CodeGen/TargetLowering.h"
30
#include "llvm/CodeGen/TargetSubtargetInfo.h"
31
#include "llvm/CodeGen/ValueTypes.h"
32
#include "llvm/IR/BasicBlock.h"
33
#include "llvm/IR/CallSite.h"
34
#include "llvm/IR/Constant.h"
35
#include "llvm/IR/Constants.h"
36
#include "llvm/IR/DataLayout.h"
37
#include "llvm/IR/DerivedTypes.h"
38
#include "llvm/IR/InstrTypes.h"
39
#include "llvm/IR/Instruction.h"
40
#include "llvm/IR/Instructions.h"
41
#include "llvm/IR/Intrinsics.h"
42
#include "llvm/IR/Operator.h"
43
#include "llvm/IR/Type.h"
44
#include "llvm/IR/Value.h"
45
#include "llvm/MC/MCSchedule.h"
46
#include "llvm/Support/Casting.h"
47
#include "llvm/Support/CommandLine.h"
48
#include "llvm/Support/ErrorHandling.h"
49
#include "llvm/Support/MachineValueType.h"
50
#include "llvm/Support/MathExtras.h"
51
#include <algorithm>
52
#include <cassert>
53
#include <cstdint>
54
#include <limits>
55
#include <utility>
56
57
namespace llvm {
58
59
class Function;
60
class GlobalValue;
61
class LLVMContext;
62
class ScalarEvolution;
63
class SCEV;
64
class TargetMachine;
65
66
extern cl::opt<unsigned> PartialUnrollingThreshold;
67
68
/// Base class which can be used to help build a TTI implementation.
69
///
70
/// This class provides as much implementation of the TTI interface as is
71
/// possible using the target independent parts of the code generator.
72
///
73
/// In order to subclass it, your class must implement a getST() method to
74
/// return the subtarget, and a getTLI() method to return the target lowering.
75
/// We need these methods implemented in the derived class so that this class
76
/// doesn't have to duplicate storage for them.
77
template <typename T>
78
class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
79
private:
80
  using BaseT = TargetTransformInfoImplCRTPBase<T>;
81
  using TTI = TargetTransformInfo;
82
83
  /// Estimate a cost of Broadcast as an extract and sequence of insert
84
  /// operations.
85
47
  unsigned getBroadcastShuffleOverhead(Type *Ty) {
86
47
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
87
47
    unsigned Cost = 0;
88
47
    // Broadcast cost is equal to the cost of extracting the zero'th element
89
47
    // plus the cost of inserting it into every element of the result vector.
90
47
    Cost += static_cast<T *>(this)->getVectorInstrCost(
91
47
        Instruction::ExtractElement, Ty, 0);
92
47
93
141
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i94
) {
94
94
      Cost += static_cast<T *>(this)->getVectorInstrCost(
95
94
          Instruction::InsertElement, Ty, i);
96
94
    }
97
47
    return Cost;
98
47
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getBroadcastShuffleOverhead(llvm::Type*)
Line
Count
Source
85
2
  unsigned getBroadcastShuffleOverhead(Type *Ty) {
86
2
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
87
2
    unsigned Cost = 0;
88
2
    // Broadcast cost is equal to the cost of extracting the zero'th element
89
2
    // plus the cost of inserting it into every element of the result vector.
90
2
    Cost += static_cast<T *>(this)->getVectorInstrCost(
91
2
        Instruction::ExtractElement, Ty, 0);
92
2
93
6
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i4
) {
94
4
      Cost += static_cast<T *>(this)->getVectorInstrCost(
95
4
          Instruction::InsertElement, Ty, i);
96
4
    }
97
2
    return Cost;
98
2
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getBroadcastShuffleOverhead(llvm::Type*)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getBroadcastShuffleOverhead(llvm::Type*)
Line
Count
Source
85
2
  unsigned getBroadcastShuffleOverhead(Type *Ty) {
86
2
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
87
2
    unsigned Cost = 0;
88
2
    // Broadcast cost is equal to the cost of extracting the zero'th element
89
2
    // plus the cost of inserting it into every element of the result vector.
90
2
    Cost += static_cast<T *>(this)->getVectorInstrCost(
91
2
        Instruction::ExtractElement, Ty, 0);
92
2
93
6
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i4
) {
94
4
      Cost += static_cast<T *>(this)->getVectorInstrCost(
95
4
          Instruction::InsertElement, Ty, i);
96
4
    }
97
2
    return Cost;
98
2
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getBroadcastShuffleOverhead(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getBroadcastShuffleOverhead(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getBroadcastShuffleOverhead(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getBroadcastShuffleOverhead(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getBroadcastShuffleOverhead(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getBroadcastShuffleOverhead(llvm::Type*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getBroadcastShuffleOverhead(llvm::Type*)
Line
Count
Source
85
43
  unsigned getBroadcastShuffleOverhead(Type *Ty) {
86
43
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
87
43
    unsigned Cost = 0;
88
43
    // Broadcast cost is equal to the cost of extracting the zero'th element
89
43
    // plus the cost of inserting it into every element of the result vector.
90
43
    Cost += static_cast<T *>(this)->getVectorInstrCost(
91
43
        Instruction::ExtractElement, Ty, 0);
92
43
93
129
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i86
) {
94
86
      Cost += static_cast<T *>(this)->getVectorInstrCost(
95
86
          Instruction::InsertElement, Ty, i);
96
86
    }
97
43
    return Cost;
98
43
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getBroadcastShuffleOverhead(llvm::Type*)
99
100
  /// Estimate a cost of shuffle as a sequence of extract and insert
101
  /// operations.
102
3.47k
  unsigned getPermuteShuffleOverhead(Type *Ty) {
103
3.47k
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
104
3.47k
    unsigned Cost = 0;
105
3.47k
    // Shuffle cost is equal to the cost of extracting element from its argument
106
3.47k
    // plus the cost of inserting them onto the result vector.
107
3.47k
108
3.47k
    // e.g. <4 x float> has a mask of <0,5,2,7> i.e we need to extract from
109
3.47k
    // index 0 of first vector, index 1 of second vector,index 2 of first
110
3.47k
    // vector and finally index 3 of second vector and insert them at index
111
3.47k
    // <0,1,2,3> of result vector.
112
19.6k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i16.2k
) {
113
16.2k
      Cost += static_cast<T *>(this)
114
16.2k
                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
115
16.2k
      Cost += static_cast<T *>(this)
116
16.2k
                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
117
16.2k
    }
118
3.47k
    return Cost;
119
3.47k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Line
Count
Source
102
3.00k
  unsigned getPermuteShuffleOverhead(Type *Ty) {
103
3.00k
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
104
3.00k
    unsigned Cost = 0;
105
3.00k
    // Shuffle cost is equal to the cost of extracting element from its argument
106
3.00k
    // plus the cost of inserting them onto the result vector.
107
3.00k
108
3.00k
    // e.g. <4 x float> has a mask of <0,5,2,7> i.e we need to extract from
109
3.00k
    // index 0 of first vector, index 1 of second vector,index 2 of first
110
3.00k
    // vector and finally index 3 of second vector and insert them at index
111
3.00k
    // <0,1,2,3> of result vector.
112
16.7k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i13.7k
) {
113
13.7k
      Cost += static_cast<T *>(this)
114
13.7k
                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
115
13.7k
      Cost += static_cast<T *>(this)
116
13.7k
                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
117
13.7k
    }
118
3.00k
    return Cost;
119
3.00k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Line
Count
Source
102
54
  unsigned getPermuteShuffleOverhead(Type *Ty) {
103
54
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
104
54
    unsigned Cost = 0;
105
54
    // Shuffle cost is equal to the cost of extracting element from its argument
106
54
    // plus the cost of inserting them onto the result vector.
107
54
108
54
    // e.g. <4 x float> has a mask of <0,5,2,7> i.e we need to extract from
109
54
    // index 0 of first vector, index 1 of second vector,index 2 of first
110
54
    // vector and finally index 3 of second vector and insert them at index
111
54
    // <0,1,2,3> of result vector.
112
254
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i200
) {
113
200
      Cost += static_cast<T *>(this)
114
200
                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
115
200
      Cost += static_cast<T *>(this)
116
200
                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
117
200
    }
118
54
    return Cost;
119
54
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Line
Count
Source
102
96
  unsigned getPermuteShuffleOverhead(Type *Ty) {
103
96
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
104
96
    unsigned Cost = 0;
105
96
    // Shuffle cost is equal to the cost of extracting element from its argument
106
96
    // plus the cost of inserting them onto the result vector.
107
96
108
96
    // e.g. <4 x float> has a mask of <0,5,2,7> i.e we need to extract from
109
96
    // index 0 of first vector, index 1 of second vector,index 2 of first
110
96
    // vector and finally index 3 of second vector and insert them at index
111
96
    // <0,1,2,3> of result vector.
112
480
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i384
) {
113
384
      Cost += static_cast<T *>(this)
114
384
                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
115
384
      Cost += static_cast<T *>(this)
116
384
                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
117
384
    }
118
96
    return Cost;
119
96
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Line
Count
Source
102
322
  unsigned getPermuteShuffleOverhead(Type *Ty) {
103
322
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
104
322
    unsigned Cost = 0;
105
322
    // Shuffle cost is equal to the cost of extracting element from its argument
106
322
    // plus the cost of inserting them onto the result vector.
107
322
108
322
    // e.g. <4 x float> has a mask of <0,5,2,7> i.e we need to extract from
109
322
    // index 0 of first vector, index 1 of second vector,index 2 of first
110
322
    // vector and finally index 3 of second vector and insert them at index
111
322
    // <0,1,2,3> of result vector.
112
2.21k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i1.89k
) {
113
1.89k
      Cost += static_cast<T *>(this)
114
1.89k
                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
115
1.89k
      Cost += static_cast<T *>(this)
116
1.89k
                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
117
1.89k
    }
118
322
    return Cost;
119
322
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
120
121
  /// Estimate a cost of subvector extraction as a sequence of extract and
122
  /// insert operations.
123
4.41k
  unsigned getExtractSubvectorOverhead(Type *Ty, int Index, Type *SubTy) {
124
4.41k
    assert(Ty && Ty->isVectorTy() && SubTy && SubTy->isVectorTy() &&
125
4.41k
           "Can only extract subvectors from vectors");
126
4.41k
    int NumSubElts = SubTy->getVectorNumElements();
127
4.41k
    assert((Index + NumSubElts) <= (int)Ty->getVectorNumElements() &&
128
4.41k
           "SK_ExtractSubvector index out of range");
129
4.41k
130
4.41k
    unsigned Cost = 0;
131
4.41k
    // Subvector extraction cost is equal to the cost of extracting element from
132
4.41k
    // the source type plus the cost of inserting them into the result vector
133
4.41k
    // type.
134
17.8k
    for (int i = 0; i != NumSubElts; 
++i13.4k
) {
135
13.4k
      Cost += static_cast<T *>(this)->getVectorInstrCost(
136
13.4k
          Instruction::ExtractElement, Ty, i + Index);
137
13.4k
      Cost += static_cast<T *>(this)->getVectorInstrCost(
138
13.4k
          Instruction::InsertElement, SubTy, i);
139
13.4k
    }
140
4.41k
    return Cost;
141
4.41k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getExtractSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Line
Count
Source
123
4.37k
  unsigned getExtractSubvectorOverhead(Type *Ty, int Index, Type *SubTy) {
124
4.37k
    assert(Ty && Ty->isVectorTy() && SubTy && SubTy->isVectorTy() &&
125
4.37k
           "Can only extract subvectors from vectors");
126
4.37k
    int NumSubElts = SubTy->getVectorNumElements();
127
4.37k
    assert((Index + NumSubElts) <= (int)Ty->getVectorNumElements() &&
128
4.37k
           "SK_ExtractSubvector index out of range");
129
4.37k
130
4.37k
    unsigned Cost = 0;
131
4.37k
    // Subvector extraction cost is equal to the cost of extracting element from
132
4.37k
    // the source type plus the cost of inserting them into the result vector
133
4.37k
    // type.
134
17.6k
    for (int i = 0; i != NumSubElts; 
++i13.2k
) {
135
13.2k
      Cost += static_cast<T *>(this)->getVectorInstrCost(
136
13.2k
          Instruction::ExtractElement, Ty, i + Index);
137
13.2k
      Cost += static_cast<T *>(this)->getVectorInstrCost(
138
13.2k
          Instruction::InsertElement, SubTy, i);
139
13.2k
    }
140
4.37k
    return Cost;
141
4.37k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getExtractSubvectorOverhead(llvm::Type*, int, llvm::Type*)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getExtractSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Line
Count
Source
123
25
  unsigned getExtractSubvectorOverhead(Type *Ty, int Index, Type *SubTy) {
124
25
    assert(Ty && Ty->isVectorTy() && SubTy && SubTy->isVectorTy() &&
125
25
           "Can only extract subvectors from vectors");
126
25
    int NumSubElts = SubTy->getVectorNumElements();
127
25
    assert((Index + NumSubElts) <= (int)Ty->getVectorNumElements() &&
128
25
           "SK_ExtractSubvector index out of range");
129
25
130
25
    unsigned Cost = 0;
131
25
    // Subvector extraction cost is equal to the cost of extracting element from
132
25
    // the source type plus the cost of inserting them into the result vector
133
25
    // type.
134
141
    for (int i = 0; i != NumSubElts; 
++i116
) {
135
116
      Cost += static_cast<T *>(this)->getVectorInstrCost(
136
116
          Instruction::ExtractElement, Ty, i + Index);
137
116
      Cost += static_cast<T *>(this)->getVectorInstrCost(
138
116
          Instruction::InsertElement, SubTy, i);
139
116
    }
140
25
    return Cost;
141
25
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getExtractSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getExtractSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getExtractSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getExtractSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getExtractSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getExtractSubvectorOverhead(llvm::Type*, int, llvm::Type*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getExtractSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Line
Count
Source
123
12
  unsigned getExtractSubvectorOverhead(Type *Ty, int Index, Type *SubTy) {
124
12
    assert(Ty && Ty->isVectorTy() && SubTy && SubTy->isVectorTy() &&
125
12
           "Can only extract subvectors from vectors");
126
12
    int NumSubElts = SubTy->getVectorNumElements();
127
12
    assert((Index + NumSubElts) <= (int)Ty->getVectorNumElements() &&
128
12
           "SK_ExtractSubvector index out of range");
129
12
130
12
    unsigned Cost = 0;
131
12
    // Subvector extraction cost is equal to the cost of extracting element from
132
12
    // the source type plus the cost of inserting them into the result vector
133
12
    // type.
134
60
    for (int i = 0; i != NumSubElts; 
++i48
) {
135
48
      Cost += static_cast<T *>(this)->getVectorInstrCost(
136
48
          Instruction::ExtractElement, Ty, i + Index);
137
48
      Cost += static_cast<T *>(this)->getVectorInstrCost(
138
48
          Instruction::InsertElement, SubTy, i);
139
48
    }
140
12
    return Cost;
141
12
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getExtractSubvectorOverhead(llvm::Type*, int, llvm::Type*)
142
143
  /// Estimate a cost of subvector insertion as a sequence of extract and
144
  /// insert operations.
145
17
  unsigned getInsertSubvectorOverhead(Type *Ty, int Index, Type *SubTy) {
146
17
    assert(Ty && Ty->isVectorTy() && SubTy && SubTy->isVectorTy() &&
147
17
           "Can only insert subvectors into vectors");
148
17
    int NumSubElts = SubTy->getVectorNumElements();
149
17
    assert((Index + NumSubElts) <= (int)Ty->getVectorNumElements() &&
150
17
           "SK_InsertSubvector index out of range");
151
17
152
17
    unsigned Cost = 0;
153
17
    // Subvector insertion cost is equal to the cost of extracting element from
154
17
    // the source type plus the cost of inserting them into the result vector
155
17
    // type.
156
51
    for (int i = 0; i != NumSubElts; 
++i34
) {
157
34
      Cost += static_cast<T *>(this)->getVectorInstrCost(
158
34
          Instruction::ExtractElement, SubTy, i);
159
34
      Cost += static_cast<T *>(this)->getVectorInstrCost(
160
34
          Instruction::InsertElement, Ty, i + Index);
161
34
    }
162
17
    return Cost;
163
17
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getInsertSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getInsertSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getInsertSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getInsertSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getInsertSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getInsertSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getInsertSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getInsertSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getInsertSubvectorOverhead(llvm::Type*, int, llvm::Type*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getInsertSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Line
Count
Source
145
17
  unsigned getInsertSubvectorOverhead(Type *Ty, int Index, Type *SubTy) {
146
17
    assert(Ty && Ty->isVectorTy() && SubTy && SubTy->isVectorTy() &&
147
17
           "Can only insert subvectors into vectors");
148
17
    int NumSubElts = SubTy->getVectorNumElements();
149
17
    assert((Index + NumSubElts) <= (int)Ty->getVectorNumElements() &&
150
17
           "SK_InsertSubvector index out of range");
151
17
152
17
    unsigned Cost = 0;
153
17
    // Subvector insertion cost is equal to the cost of extracting element from
154
17
    // the source type plus the cost of inserting them into the result vector
155
17
    // type.
156
51
    for (int i = 0; i != NumSubElts; 
++i34
) {
157
34
      Cost += static_cast<T *>(this)->getVectorInstrCost(
158
34
          Instruction::ExtractElement, SubTy, i);
159
34
      Cost += static_cast<T *>(this)->getVectorInstrCost(
160
34
          Instruction::InsertElement, Ty, i + Index);
161
34
    }
162
17
    return Cost;
163
17
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getInsertSubvectorOverhead(llvm::Type*, int, llvm::Type*)
164
165
  /// Local query method delegates up to T which *must* implement this!
166
388k
  const TargetSubtargetInfo *getST() const {
167
388k
    return static_cast<const T *>(this)->getST();
168
388k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getST() const
Line
Count
Source
166
358k
  const TargetSubtargetInfo *getST() const {
167
358k
    return static_cast<const T *>(this)->getST();
168
358k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getST() const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getST() const
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getST() const
Line
Count
Source
166
6.77k
  const TargetSubtargetInfo *getST() const {
167
6.77k
    return static_cast<const T *>(this)->getST();
168
6.77k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getST() const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getST() const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getST() const
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getST() const
Line
Count
Source
166
2
  const TargetSubtargetInfo *getST() const {
167
2
    return static_cast<const T *>(this)->getST();
168
2
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getST() const
Line
Count
Source
166
528
  const TargetSubtargetInfo *getST() const {
167
528
    return static_cast<const T *>(this)->getST();
168
528
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getST() const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getST() const
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getST() const
Line
Count
Source
166
23.0k
  const TargetSubtargetInfo *getST() const {
167
23.0k
    return static_cast<const T *>(this)->getST();
168
23.0k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getST() const
169
170
  /// Local query method delegates up to T which *must* implement this!
171
100M
  const TargetLoweringBase *getTLI() const {
172
100M
    return static_cast<const T *>(this)->getTLI();
173
100M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getTLI() const
Line
Count
Source
171
91.3M
  const TargetLoweringBase *getTLI() const {
172
91.3M
    return static_cast<const T *>(this)->getTLI();
173
91.3M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getTLI() const
Line
Count
Source
171
2.92k
  const TargetLoweringBase *getTLI() const {
172
2.92k
    return static_cast<const T *>(this)->getTLI();
173
2.92k
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getTLI() const
Line
Count
Source
171
61.0k
  const TargetLoweringBase *getTLI() const {
172
61.0k
    return static_cast<const T *>(this)->getTLI();
173
61.0k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getTLI() const
Line
Count
Source
171
1.29M
  const TargetLoweringBase *getTLI() const {
172
1.29M
    return static_cast<const T *>(this)->getTLI();
173
1.29M
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getTLI() const
Line
Count
Source
171
42.3k
  const TargetLoweringBase *getTLI() const {
172
42.3k
    return static_cast<const T *>(this)->getTLI();
173
42.3k
  }
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getTLI() const
Line
Count
Source
171
44
  const TargetLoweringBase *getTLI() const {
172
44
    return static_cast<const T *>(this)->getTLI();
173
44
  }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getTLI() const
Line
Count
Source
171
455
  const TargetLoweringBase *getTLI() const {
172
455
    return static_cast<const T *>(this)->getTLI();
173
455
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getTLI() const
Line
Count
Source
171
1.21k
  const TargetLoweringBase *getTLI() const {
172
1.21k
    return static_cast<const T *>(this)->getTLI();
173
1.21k
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getTLI() const
Line
Count
Source
171
59.0k
  const TargetLoweringBase *getTLI() const {
172
59.0k
    return static_cast<const T *>(this)->getTLI();
173
59.0k
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getTLI() const
Line
Count
Source
171
8.46k
  const TargetLoweringBase *getTLI() const {
172
8.46k
    return static_cast<const T *>(this)->getTLI();
173
8.46k
  }
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getTLI() const
Line
Count
Source
171
284
  const TargetLoweringBase *getTLI() const {
172
284
    return static_cast<const T *>(this)->getTLI();
173
284
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getTLI() const
Line
Count
Source
171
7.67M
  const TargetLoweringBase *getTLI() const {
172
7.67M
    return static_cast<const T *>(this)->getTLI();
173
7.67M
  }
llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getTLI() const
Line
Count
Source
171
10
  const TargetLoweringBase *getTLI() const {
172
10
    return static_cast<const T *>(this)->getTLI();
173
10
  }
174
175
7.96k
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
176
7.96k
    switch (M) {
177
7.96k
      case TTI::MIM_Unindexed:
178
0
        return ISD::UNINDEXED;
179
7.96k
      case TTI::MIM_PreInc:
180
0
        return ISD::PRE_INC;
181
7.96k
      case TTI::MIM_PreDec:
182
0
        return ISD::PRE_DEC;
183
7.96k
      case TTI::MIM_PostInc:
184
7.96k
        return ISD::POST_INC;
185
7.96k
      case TTI::MIM_PostDec:
186
0
        return ISD::POST_DEC;
187
0
    }
188
0
    llvm_unreachable("Unexpected MemIndexedMode");
189
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Line
Count
Source
175
7.96k
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
176
7.96k
    switch (M) {
177
7.96k
      case TTI::MIM_Unindexed:
178
0
        return ISD::UNINDEXED;
179
7.96k
      case TTI::MIM_PreInc:
180
0
        return ISD::PRE_INC;
181
7.96k
      case TTI::MIM_PreDec:
182
0
        return ISD::PRE_DEC;
183
7.96k
      case TTI::MIM_PostInc:
184
7.96k
        return ISD::POST_INC;
185
7.96k
      case TTI::MIM_PostDec:
186
0
        return ISD::POST_DEC;
187
0
    }
188
0
    llvm_unreachable("Unexpected MemIndexedMode");
189
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
190
191
protected:
192
  explicit BasicTTIImplBase(const TargetMachine *TM, const DataLayout &DL)
193
15.7M
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
193
11.5M
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
193
38.0k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::AMDGPUTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
193
440k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
193
402k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
193
598k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
193
30.2k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
193
627
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
193
18.9k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
193
83.1k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
193
78.2k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
193
28.6k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
193
2.40M
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
193
1.87k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
193
92.7k
      : BaseT(DL) {}
194
195
  using TargetTransformInfoImplBase::DL;
196
197
public:
198
  /// \name Scalar TTI Implementations
199
  /// @{
200
  bool allowsMisalignedMemoryAccesses(LLVMContext &Context,
201
                                      unsigned BitWidth, unsigned AddressSpace,
202
8.50k
                                      unsigned Alignment, bool *Fast) const {
203
8.50k
    EVT E = EVT::getIntegerVT(Context, BitWidth);
204
8.50k
    return getTLI()->allowsMisalignedMemoryAccesses(E, AddressSpace, Alignment, Fast);
205
8.50k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
Line
Count
Source
202
118
                                      unsigned Alignment, bool *Fast) const {
203
118
    EVT E = EVT::getIntegerVT(Context, BitWidth);
204
118
    return getTLI()->allowsMisalignedMemoryAccesses(E, AddressSpace, Alignment, Fast);
205
118
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
Line
Count
Source
202
8.34k
                                      unsigned Alignment, bool *Fast) const {
203
8.34k
    EVT E = EVT::getIntegerVT(Context, BitWidth);
204
8.34k
    return getTLI()->allowsMisalignedMemoryAccesses(E, AddressSpace, Alignment, Fast);
205
8.34k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
Line
Count
Source
202
21
                                      unsigned Alignment, bool *Fast) const {
203
21
    EVT E = EVT::getIntegerVT(Context, BitWidth);
204
21
    return getTLI()->allowsMisalignedMemoryAccesses(E, AddressSpace, Alignment, Fast);
205
21
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
Line
Count
Source
202
24
                                      unsigned Alignment, bool *Fast) const {
203
24
    EVT E = EVT::getIntegerVT(Context, BitWidth);
204
24
    return getTLI()->allowsMisalignedMemoryAccesses(E, AddressSpace, Alignment, Fast);
205
24
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
206
207
461k
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::hasBranchDivergence()
Line
Count
Source
207
356k
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::hasBranchDivergence()
Line
Count
Source
207
2.45k
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::hasBranchDivergence()
Line
Count
Source
207
21.9k
  bool hasBranchDivergence() { return false; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::hasBranchDivergence()
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::hasBranchDivergence()
Line
Count
Source
207
45
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::hasBranchDivergence()
Line
Count
Source
207
74
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::hasBranchDivergence()
Line
Count
Source
207
1.60k
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::hasBranchDivergence()
Line
Count
Source
207
167
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::hasBranchDivergence()
Line
Count
Source
207
78.7k
  bool hasBranchDivergence() { return false; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::hasBranchDivergence()
208
209
0
  bool isSourceOfDivergence(const Value *V) { return false; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isSourceOfDivergence(llvm::Value const*)
210
211
28
  bool isAlwaysUniform(const Value *V) { return false; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isAlwaysUniform(llvm::Value const*)
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isAlwaysUniform(llvm::Value const*)
Line
Count
Source
211
28
  bool isAlwaysUniform(const Value *V) { return false; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isAlwaysUniform(llvm::Value const*)
212
213
2.37k
  unsigned getFlatAddressSpace() {
214
2.37k
    // Return an invalid address space.
215
2.37k
    return -1;
216
2.37k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getFlatAddressSpace()
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getFlatAddressSpace()
Line
Count
Source
213
2.37k
  unsigned getFlatAddressSpace() {
214
2.37k
    // Return an invalid address space.
215
2.37k
    return -1;
216
2.37k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getFlatAddressSpace()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getFlatAddressSpace()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getFlatAddressSpace()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getFlatAddressSpace()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getFlatAddressSpace()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getFlatAddressSpace()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getFlatAddressSpace()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getFlatAddressSpace()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getFlatAddressSpace()
217
218
2.62M
  bool isLegalAddImmediate(int64_t imm) {
219
2.62M
    return getTLI()->isLegalAddImmediate(imm);
220
2.62M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
2.55M
  bool isLegalAddImmediate(int64_t imm) {
219
2.55M
    return getTLI()->isLegalAddImmediate(imm);
220
2.55M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
14
  bool isLegalAddImmediate(int64_t imm) {
219
14
    return getTLI()->isLegalAddImmediate(imm);
220
14
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
306
  bool isLegalAddImmediate(int64_t imm) {
219
306
    return getTLI()->isLegalAddImmediate(imm);
220
306
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
23.9k
  bool isLegalAddImmediate(int64_t imm) {
219
23.9k
    return getTLI()->isLegalAddImmediate(imm);
220
23.9k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
1.20k
  bool isLegalAddImmediate(int64_t imm) {
219
1.20k
    return getTLI()->isLegalAddImmediate(imm);
220
1.20k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isLegalAddImmediate(long long)
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
5
  bool isLegalAddImmediate(int64_t imm) {
219
5
    return getTLI()->isLegalAddImmediate(imm);
220
5
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
19
  bool isLegalAddImmediate(int64_t imm) {
219
19
    return getTLI()->isLegalAddImmediate(imm);
220
19
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
2.76k
  bool isLegalAddImmediate(int64_t imm) {
219
2.76k
    return getTLI()->isLegalAddImmediate(imm);
220
2.76k
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
21
  bool isLegalAddImmediate(int64_t imm) {
219
21
    return getTLI()->isLegalAddImmediate(imm);
220
21
  }
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
16
  bool isLegalAddImmediate(int64_t imm) {
219
16
    return getTLI()->isLegalAddImmediate(imm);
220
16
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
36.7k
  bool isLegalAddImmediate(int64_t imm) {
219
36.7k
    return getTLI()->isLegalAddImmediate(imm);
220
36.7k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isLegalAddImmediate(long long)
221
222
537k
  bool isLegalICmpImmediate(int64_t imm) {
223
537k
    return getTLI()->isLegalICmpImmediate(imm);
224
537k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
222
451k
  bool isLegalICmpImmediate(int64_t imm) {
223
451k
    return getTLI()->isLegalICmpImmediate(imm);
224
451k
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
222
74
  bool isLegalICmpImmediate(int64_t imm) {
223
74
    return getTLI()->isLegalICmpImmediate(imm);
224
74
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
222
470
  bool isLegalICmpImmediate(int64_t imm) {
223
470
    return getTLI()->isLegalICmpImmediate(imm);
224
470
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
222
11.5k
  bool isLegalICmpImmediate(int64_t imm) {
223
11.5k
    return getTLI()->isLegalICmpImmediate(imm);
224
11.5k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
222
1.26k
  bool isLegalICmpImmediate(int64_t imm) {
223
1.26k
    return getTLI()->isLegalICmpImmediate(imm);
224
1.26k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isLegalICmpImmediate(long long)
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
222
22
  bool isLegalICmpImmediate(int64_t imm) {
223
22
    return getTLI()->isLegalICmpImmediate(imm);
224
22
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
222
48
  bool isLegalICmpImmediate(int64_t imm) {
223
48
    return getTLI()->isLegalICmpImmediate(imm);
224
48
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
222
2.78k
  bool isLegalICmpImmediate(int64_t imm) {
223
2.78k
    return getTLI()->isLegalICmpImmediate(imm);
224
2.78k
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
222
222
  bool isLegalICmpImmediate(int64_t imm) {
223
222
    return getTLI()->isLegalICmpImmediate(imm);
224
222
  }
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
222
50
  bool isLegalICmpImmediate(int64_t imm) {
223
50
    return getTLI()->isLegalICmpImmediate(imm);
224
50
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
222
69.5k
  bool isLegalICmpImmediate(int64_t imm) {
223
69.5k
    return getTLI()->isLegalICmpImmediate(imm);
224
69.5k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isLegalICmpImmediate(long long)
225
226
  bool isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset,
227
                             bool HasBaseReg, int64_t Scale,
228
58.4M
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
58.4M
    TargetLoweringBase::AddrMode AM;
230
58.4M
    AM.BaseGV = BaseGV;
231
58.4M
    AM.BaseOffs = BaseOffset;
232
58.4M
    AM.HasBaseReg = HasBaseReg;
233
58.4M
    AM.Scale = Scale;
234
58.4M
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
58.4M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
53.4M
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
53.4M
    TargetLoweringBase::AddrMode AM;
230
53.4M
    AM.BaseGV = BaseGV;
231
53.4M
    AM.BaseOffs = BaseOffset;
232
53.4M
    AM.HasBaseReg = HasBaseReg;
233
53.4M
    AM.Scale = Scale;
234
53.4M
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
53.4M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
2.36k
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
2.36k
    TargetLoweringBase::AddrMode AM;
230
2.36k
    AM.BaseGV = BaseGV;
231
2.36k
    AM.BaseOffs = BaseOffset;
232
2.36k
    AM.HasBaseReg = HasBaseReg;
233
2.36k
    AM.Scale = Scale;
234
2.36k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
2.36k
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
43.3k
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
43.3k
    TargetLoweringBase::AddrMode AM;
230
43.3k
    AM.BaseGV = BaseGV;
231
43.3k
    AM.BaseOffs = BaseOffset;
232
43.3k
    AM.HasBaseReg = HasBaseReg;
233
43.3k
    AM.Scale = Scale;
234
43.3k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
43.3k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
459k
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
459k
    TargetLoweringBase::AddrMode AM;
230
459k
    AM.BaseGV = BaseGV;
231
459k
    AM.BaseOffs = BaseOffset;
232
459k
    AM.HasBaseReg = HasBaseReg;
233
459k
    AM.Scale = Scale;
234
459k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
459k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
23.1k
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
23.1k
    TargetLoweringBase::AddrMode AM;
230
23.1k
    AM.BaseGV = BaseGV;
231
23.1k
    AM.BaseOffs = BaseOffset;
232
23.1k
    AM.HasBaseReg = HasBaseReg;
233
23.1k
    AM.Scale = Scale;
234
23.1k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
23.1k
  }
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
32
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
32
    TargetLoweringBase::AddrMode AM;
230
32
    AM.BaseGV = BaseGV;
231
32
    AM.BaseOffs = BaseOffset;
232
32
    AM.HasBaseReg = HasBaseReg;
233
32
    AM.Scale = Scale;
234
32
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
32
  }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
333
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
333
    TargetLoweringBase::AddrMode AM;
230
333
    AM.BaseGV = BaseGV;
231
333
    AM.BaseOffs = BaseOffset;
232
333
    AM.HasBaseReg = HasBaseReg;
233
333
    AM.Scale = Scale;
234
333
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
333
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
881
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
881
    TargetLoweringBase::AddrMode AM;
230
881
    AM.BaseGV = BaseGV;
231
881
    AM.BaseOffs = BaseOffset;
232
881
    AM.HasBaseReg = HasBaseReg;
233
881
    AM.Scale = Scale;
234
881
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
881
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
39.2k
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
39.2k
    TargetLoweringBase::AddrMode AM;
230
39.2k
    AM.BaseGV = BaseGV;
231
39.2k
    AM.BaseOffs = BaseOffset;
232
39.2k
    AM.HasBaseReg = HasBaseReg;
233
39.2k
    AM.Scale = Scale;
234
39.2k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
39.2k
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
4.13k
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
4.13k
    TargetLoweringBase::AddrMode AM;
230
4.13k
    AM.BaseGV = BaseGV;
231
4.13k
    AM.BaseOffs = BaseOffset;
232
4.13k
    AM.HasBaseReg = HasBaseReg;
233
4.13k
    AM.Scale = Scale;
234
4.13k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
4.13k
  }
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
142
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
142
    TargetLoweringBase::AddrMode AM;
230
142
    AM.BaseGV = BaseGV;
231
142
    AM.BaseOffs = BaseOffset;
232
142
    AM.HasBaseReg = HasBaseReg;
233
142
    AM.Scale = Scale;
234
142
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
142
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
4.34M
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
4.34M
    TargetLoweringBase::AddrMode AM;
230
4.34M
    AM.BaseGV = BaseGV;
231
4.34M
    AM.BaseOffs = BaseOffset;
232
4.34M
    AM.HasBaseReg = HasBaseReg;
233
4.34M
    AM.Scale = Scale;
234
4.34M
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
4.34M
  }
llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
10
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
10
    TargetLoweringBase::AddrMode AM;
230
10
    AM.BaseGV = BaseGV;
231
10
    AM.BaseOffs = BaseOffset;
232
10
    AM.HasBaseReg = HasBaseReg;
233
10
    AM.Scale = Scale;
234
10
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
10
  }
236
237
  bool isIndexedLoadLegal(TTI::MemIndexedMode M, Type *Ty,
238
7.96k
                          const DataLayout &DL) const {
239
7.96k
    EVT VT = getTLI()->getValueType(DL, Ty);
240
7.96k
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
241
7.96k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
238
7.96k
                          const DataLayout &DL) const {
239
7.96k
    EVT VT = getTLI()->getValueType(DL, Ty);
240
7.96k
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
241
7.96k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
242
243
  bool isIndexedStoreLegal(TTI::MemIndexedMode M, Type *Ty,
244
0
                           const DataLayout &DL) const {
245
0
    EVT VT = getTLI()->getValueType(DL, Ty);
246
0
    return getTLI()->isIndexedStoreLegal(getISDIndexedMode(M), VT);
247
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
248
249
4.04M
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
4.04M
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
4.04M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
3.97M
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
3.97M
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
3.97M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
74
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
74
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
74
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
868
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
868
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
868
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
60.2k
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
60.2k
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
60.2k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
4.51k
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
4.51k
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
4.51k
  }
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
28
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
28
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
28
  }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
142
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
142
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
142
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
130
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
130
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
130
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
4.12k
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
4.12k
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
4.12k
  }
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
112
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
112
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
112
  }
llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
2
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
2
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
2
  }
252
253
  int getScalingFactorCost(Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset,
254
5.91M
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
255
5.91M
    TargetLoweringBase::AddrMode AM;
256
5.91M
    AM.BaseGV = BaseGV;
257
5.91M
    AM.BaseOffs = BaseOffset;
258
5.91M
    AM.HasBaseReg = HasBaseReg;
259
5.91M
    AM.Scale = Scale;
260
5.91M
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
261
5.91M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
254
5.12M
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
255
5.12M
    TargetLoweringBase::AddrMode AM;
256
5.12M
    AM.BaseGV = BaseGV;
257
5.12M
    AM.BaseOffs = BaseOffset;
258
5.12M
    AM.HasBaseReg = HasBaseReg;
259
5.12M
    AM.Scale = Scale;
260
5.12M
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
261
5.12M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
254
10
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
255
10
    TargetLoweringBase::AddrMode AM;
256
10
    AM.BaseGV = BaseGV;
257
10
    AM.BaseOffs = BaseOffset;
258
10
    AM.HasBaseReg = HasBaseReg;
259
10
    AM.Scale = Scale;
260
10
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
261
10
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
254
434
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
255
434
    TargetLoweringBase::AddrMode AM;
256
434
    AM.BaseGV = BaseGV;
257
434
    AM.BaseOffs = BaseOffset;
258
434
    AM.HasBaseReg = HasBaseReg;
259
434
    AM.Scale = Scale;
260
434
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
261
434
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
254
64.6k
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
255
64.6k
    TargetLoweringBase::AddrMode AM;
256
64.6k
    AM.BaseGV = BaseGV;
257
64.6k
    AM.BaseOffs = BaseOffset;
258
64.6k
    AM.HasBaseReg = HasBaseReg;
259
64.6k
    AM.Scale = Scale;
260
64.6k
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
261
64.6k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
254
4
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
255
4
    TargetLoweringBase::AddrMode AM;
256
4
    AM.BaseGV = BaseGV;
257
4
    AM.BaseOffs = BaseOffset;
258
4
    AM.HasBaseReg = HasBaseReg;
259
4
    AM.Scale = Scale;
260
4
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
261
4
  }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
254
14
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
255
14
    TargetLoweringBase::AddrMode AM;
256
14
    AM.BaseGV = BaseGV;
257
14
    AM.BaseOffs = BaseOffset;
258
14
    AM.HasBaseReg = HasBaseReg;
259
14
    AM.Scale = Scale;
260
14
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
261
14
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
254
6.52k
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
255
6.52k
    TargetLoweringBase::AddrMode AM;
256
6.52k
    AM.BaseGV = BaseGV;
257
6.52k
    AM.BaseOffs = BaseOffset;
258
6.52k
    AM.HasBaseReg = HasBaseReg;
259
6.52k
    AM.Scale = Scale;
260
6.52k
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
261
6.52k
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
254
662
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
255
662
    TargetLoweringBase::AddrMode AM;
256
662
    AM.BaseGV = BaseGV;
257
662
    AM.BaseOffs = BaseOffset;
258
662
    AM.HasBaseReg = HasBaseReg;
259
662
    AM.Scale = Scale;
260
662
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
261
662
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
254
715k
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
255
715k
    TargetLoweringBase::AddrMode AM;
256
715k
    AM.BaseGV = BaseGV;
257
715k
    AM.BaseOffs = BaseOffset;
258
715k
    AM.HasBaseReg = HasBaseReg;
259
715k
    AM.Scale = Scale;
260
715k
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
261
715k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
262
263
1.46M
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
1.46M
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
1.46M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
263
1.43M
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
1.43M
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
1.43M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
263
26
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
26
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
26
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
263
449
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
449
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
449
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
263
3.76k
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
3.76k
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
3.76k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
263
443
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
443
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
443
  }
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
263
8
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
8
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
8
  }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
263
65
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
65
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
65
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
263
97
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
97
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
97
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
263
1.65k
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
1.65k
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
1.65k
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
263
209
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
209
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
209
  }
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
263
76
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
76
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
76
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
263
22.4k
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
22.4k
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
22.4k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
266
267
128k
  bool isProfitableToHoist(Instruction *I) {
268
128k
    return getTLI()->isProfitableToHoist(I);
269
128k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isProfitableToHoist(llvm::Instruction*)
Line
Count
Source
267
82.2k
  bool isProfitableToHoist(Instruction *I) {
268
82.2k
    return getTLI()->isProfitableToHoist(I);
269
82.2k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isProfitableToHoist(llvm::Instruction*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isProfitableToHoist(llvm::Instruction*)
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isProfitableToHoist(llvm::Instruction*)
Line
Count
Source
267
8.88k
  bool isProfitableToHoist(Instruction *I) {
268
8.88k
    return getTLI()->isProfitableToHoist(I);
269
8.88k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isProfitableToHoist(llvm::Instruction*)
Line
Count
Source
267
16
  bool isProfitableToHoist(Instruction *I) {
268
16
    return getTLI()->isProfitableToHoist(I);
269
16
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isProfitableToHoist(llvm::Instruction*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isProfitableToHoist(llvm::Instruction*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isProfitableToHoist(llvm::Instruction*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isProfitableToHoist(llvm::Instruction*)
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isProfitableToHoist(llvm::Instruction*)
Line
Count
Source
267
32
  bool isProfitableToHoist(Instruction *I) {
268
32
    return getTLI()->isProfitableToHoist(I);
269
32
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isProfitableToHoist(llvm::Instruction*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isProfitableToHoist(llvm::Instruction*)
Line
Count
Source
267
36.8k
  bool isProfitableToHoist(Instruction *I) {
268
36.8k
    return getTLI()->isProfitableToHoist(I);
269
36.8k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isProfitableToHoist(llvm::Instruction*)
270
271
552
  bool useAA() const { return getST()->useAA(); }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::useAA() const
Line
Count
Source
271
35
  bool useAA() const { return getST()->useAA(); }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::useAA() const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::useAA() const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::useAA() const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::useAA() const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::useAA() const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::useAA() const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::useAA() const
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::useAA() const
Line
Count
Source
271
517
  bool useAA() const { return getST()->useAA(); }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::useAA() const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::useAA() const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::useAA() const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::useAA() const
272
273
17.8k
  bool isTypeLegal(Type *Ty) {
274
17.8k
    EVT VT = getTLI()->getValueType(DL, Ty);
275
17.8k
    return getTLI()->isTypeLegal(VT);
276
17.8k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isTypeLegal(llvm::Type*)
Line
Count
Source
273
17.0k
  bool isTypeLegal(Type *Ty) {
274
17.0k
    EVT VT = getTLI()->getValueType(DL, Ty);
275
17.0k
    return getTLI()->isTypeLegal(VT);
276
17.0k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isTypeLegal(llvm::Type*)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isTypeLegal(llvm::Type*)
Line
Count
Source
273
2
  bool isTypeLegal(Type *Ty) {
274
2
    EVT VT = getTLI()->getValueType(DL, Ty);
275
2
    return getTLI()->isTypeLegal(VT);
276
2
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isTypeLegal(llvm::Type*)
Line
Count
Source
273
149
  bool isTypeLegal(Type *Ty) {
274
149
    EVT VT = getTLI()->getValueType(DL, Ty);
275
149
    return getTLI()->isTypeLegal(VT);
276
149
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isTypeLegal(llvm::Type*)
Line
Count
Source
273
3
  bool isTypeLegal(Type *Ty) {
274
3
    EVT VT = getTLI()->getValueType(DL, Ty);
275
3
    return getTLI()->isTypeLegal(VT);
276
3
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isTypeLegal(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isTypeLegal(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isTypeLegal(llvm::Type*)
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isTypeLegal(llvm::Type*)
Line
Count
Source
273
7
  bool isTypeLegal(Type *Ty) {
274
7
    EVT VT = getTLI()->getValueType(DL, Ty);
275
7
    return getTLI()->isTypeLegal(VT);
276
7
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isTypeLegal(llvm::Type*)
Line
Count
Source
273
5
  bool isTypeLegal(Type *Ty) {
274
5
    EVT VT = getTLI()->getValueType(DL, Ty);
275
5
    return getTLI()->isTypeLegal(VT);
276
5
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isTypeLegal(llvm::Type*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isTypeLegal(llvm::Type*)
Line
Count
Source
273
624
  bool isTypeLegal(Type *Ty) {
274
624
    EVT VT = getTLI()->getValueType(DL, Ty);
275
624
    return getTLI()->isTypeLegal(VT);
276
624
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isTypeLegal(llvm::Type*)
277
278
  int getGEPCost(Type *PointeeType, const Value *Ptr,
279
6.26M
                 ArrayRef<const Value *> Operands) {
280
6.26M
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
6.26M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
279
5.65M
                 ArrayRef<const Value *> Operands) {
280
5.65M
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
5.65M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
279
1.83k
                 ArrayRef<const Value *> Operands) {
280
1.83k
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
1.83k
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
279
32.9k
                 ArrayRef<const Value *> Operands) {
280
32.9k
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
32.9k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
279
98.7k
                 ArrayRef<const Value *> Operands) {
280
98.7k
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
98.7k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
279
27
                 ArrayRef<const Value *> Operands) {
280
27
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
27
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
279
329
                 ArrayRef<const Value *> Operands) {
280
329
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
329
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
279
855
                 ArrayRef<const Value *> Operands) {
280
855
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
855
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
279
75
                 ArrayRef<const Value *> Operands) {
280
75
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
75
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
279
477k
                 ArrayRef<const Value *> Operands) {
280
477k
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
477k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
282
283
1.73M
  int getExtCost(const Instruction *I, const Value *Src) {
284
1.73M
    if (getTLI()->isExtFree(I))
285
675k
      return TargetTransformInfo::TCC_Free;
286
1.06M
287
1.06M
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)683k
)
288
987k
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
670k
        if (getTLI()->isExtLoad(LI, I, DL))
290
661k
          return TargetTransformInfo::TCC_Free;
291
399k
292
399k
    return TargetTransformInfo::TCC_Basic;
293
399k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
283
1.47M
  int getExtCost(const Instruction *I, const Value *Src) {
284
1.47M
    if (getTLI()->isExtFree(I))
285
642k
      return TargetTransformInfo::TCC_Free;
286
832k
287
832k
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)552k
)
288
758k
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
519k
        if (getTLI()->isExtLoad(LI, I, DL))
290
511k
          return TargetTransformInfo::TCC_Free;
291
320k
292
320k
    return TargetTransformInfo::TCC_Basic;
293
320k
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
283
1
  int getExtCost(const Instruction *I, const Value *Src) {
284
1
    if (getTLI()->isExtFree(I))
285
0
      return TargetTransformInfo::TCC_Free;
286
1
287
1
    if (isa<ZExtInst>(I) || isa<SExtInst>(I))
288
1
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
0
        if (getTLI()->isExtLoad(LI, I, DL))
290
0
          return TargetTransformInfo::TCC_Free;
291
1
292
1
    return TargetTransformInfo::TCC_Basic;
293
1
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
283
168
  int getExtCost(const Instruction *I, const Value *Src) {
284
168
    if (getTLI()->isExtFree(I))
285
82
      return TargetTransformInfo::TCC_Free;
286
86
287
86
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)77
)
288
86
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
34
        if (getTLI()->isExtLoad(LI, I, DL))
290
30
          return TargetTransformInfo::TCC_Free;
291
56
292
56
    return TargetTransformInfo::TCC_Basic;
293
56
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
283
85.4k
  int getExtCost(const Instruction *I, const Value *Src) {
284
85.4k
    if (getTLI()->isExtFree(I))
285
0
      return TargetTransformInfo::TCC_Free;
286
85.4k
287
85.4k
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)42.0k
)
288
85.4k
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
55.7k
        if (getTLI()->isExtLoad(LI, I, DL))
290
55.3k
          return TargetTransformInfo::TCC_Free;
291
30.1k
292
30.1k
    return TargetTransformInfo::TCC_Basic;
293
30.1k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
283
12
  int getExtCost(const Instruction *I, const Value *Src) {
284
12
    if (getTLI()->isExtFree(I))
285
0
      return TargetTransformInfo::TCC_Free;
286
12
287
12
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)2
)
288
12
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
2
        if (getTLI()->isExtLoad(LI, I, DL))
290
2
          return TargetTransformInfo::TCC_Free;
291
10
292
10
    return TargetTransformInfo::TCC_Basic;
293
10
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
283
1
  int getExtCost(const Instruction *I, const Value *Src) {
284
1
    if (getTLI()->isExtFree(I))
285
0
      return TargetTransformInfo::TCC_Free;
286
1
287
1
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)0
)
288
1
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
0
        if (getTLI()->isExtLoad(LI, I, DL))
290
0
          return TargetTransformInfo::TCC_Free;
291
1
292
1
    return TargetTransformInfo::TCC_Basic;
293
1
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
283
222
  int getExtCost(const Instruction *I, const Value *Src) {
284
222
    if (getTLI()->isExtFree(I))
285
6
      return TargetTransformInfo::TCC_Free;
286
216
287
216
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)92
)
288
216
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
112
        if (getTLI()->isExtLoad(LI, I, DL))
290
107
          return TargetTransformInfo::TCC_Free;
291
109
292
109
    return TargetTransformInfo::TCC_Basic;
293
109
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
283
17
  int getExtCost(const Instruction *I, const Value *Src) {
284
17
    if (getTLI()->isExtFree(I))
285
0
      return TargetTransformInfo::TCC_Free;
286
17
287
17
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)4
)
288
17
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
9
        if (getTLI()->isExtLoad(LI, I, DL))
290
9
          return TargetTransformInfo::TCC_Free;
291
8
292
8
    return TargetTransformInfo::TCC_Basic;
293
8
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
283
176k
  int getExtCost(const Instruction *I, const Value *Src) {
284
176k
    if (getTLI()->isExtFree(I))
285
32.7k
      return TargetTransformInfo::TCC_Free;
286
143k
287
143k
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)89.0k
)
288
143k
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
94.3k
        if (getTLI()->isExtLoad(LI, I, DL))
290
94.0k
          return TargetTransformInfo::TCC_Free;
291
49.2k
292
49.2k
    return TargetTransformInfo::TCC_Basic;
293
49.2k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
294
295
  unsigned getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,
296
4
                            ArrayRef<const Value *> Arguments) {
297
4
    return BaseT::getIntrinsicCost(IID, RetTy, Arguments);
298
4
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
296
2
                            ArrayRef<const Value *> Arguments) {
297
2
    return BaseT::getIntrinsicCost(IID, RetTy, Arguments);
298
2
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
296
2
                            ArrayRef<const Value *> Arguments) {
297
2
    return BaseT::getIntrinsicCost(IID, RetTy, Arguments);
298
2
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
299
300
  unsigned getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,
301
1.58M
                            ArrayRef<Type *> ParamTys) {
302
1.58M
    if (IID == Intrinsic::cttz) {
303
9.98k
      if (getTLI()->isCheapToSpeculateCttz())
304
4.73k
        return TargetTransformInfo::TCC_Basic;
305
5.25k
      return TargetTransformInfo::TCC_Expensive;
306
5.25k
    }
307
1.57M
308
1.57M
    if (IID == Intrinsic::ctlz) {
309
15.9k
      if (getTLI()->isCheapToSpeculateCtlz())
310
9.13k
        return TargetTransformInfo::TCC_Basic;
311
6.77k
      return TargetTransformInfo::TCC_Expensive;
312
6.77k
    }
313
1.56M
314
1.56M
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
315
1.56M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
301
1.25M
                            ArrayRef<Type *> ParamTys) {
302
1.25M
    if (IID == Intrinsic::cttz) {
303
858
      if (getTLI()->isCheapToSpeculateCttz())
304
858
        return TargetTransformInfo::TCC_Basic;
305
0
      return TargetTransformInfo::TCC_Expensive;
306
0
    }
307
1.25M
308
1.25M
    if (IID == Intrinsic::ctlz) {
309
1.82k
      if (getTLI()->isCheapToSpeculateCtlz())
310
1.82k
        return TargetTransformInfo::TCC_Basic;
311
0
      return TargetTransformInfo::TCC_Expensive;
312
0
    }
313
1.25M
314
1.25M
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
315
1.25M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
301
2
                            ArrayRef<Type *> ParamTys) {
302
2
    if (IID == Intrinsic::cttz) {
303
0
      if (getTLI()->isCheapToSpeculateCttz())
304
0
        return TargetTransformInfo::TCC_Basic;
305
0
      return TargetTransformInfo::TCC_Expensive;
306
0
    }
307
2
308
2
    if (IID == Intrinsic::ctlz) {
309
0
      if (getTLI()->isCheapToSpeculateCtlz())
310
0
        return TargetTransformInfo::TCC_Basic;
311
0
      return TargetTransformInfo::TCC_Expensive;
312
0
    }
313
2
314
2
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
315
2
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
301
806
                            ArrayRef<Type *> ParamTys) {
302
806
    if (IID == Intrinsic::cttz) {
303
12
      if (getTLI()->isCheapToSpeculateCttz())
304
12
        return TargetTransformInfo::TCC_Basic;
305
0
      return TargetTransformInfo::TCC_Expensive;
306
0
    }
307
794
308
794
    if (IID == Intrinsic::ctlz) {
309
12
      if (getTLI()->isCheapToSpeculateCtlz())
310
12
        return TargetTransformInfo::TCC_Basic;
311
0
      return TargetTransformInfo::TCC_Expensive;
312
0
    }
313
782
314
782
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
315
782
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
301
79.1k
                            ArrayRef<Type *> ParamTys) {
302
79.1k
    if (IID == Intrinsic::cttz) {
303
2.59k
      if (getTLI()->isCheapToSpeculateCttz())
304
2.53k
        return TargetTransformInfo::TCC_Basic;
305
60
      return TargetTransformInfo::TCC_Expensive;
306
60
    }
307
76.5k
308
76.5k
    if (IID == Intrinsic::ctlz) {
309
6.58k
      if (getTLI()->isCheapToSpeculateCtlz())
310
5.98k
        return TargetTransformInfo::TCC_Basic;
311
607
      return TargetTransformInfo::TCC_Expensive;
312
607
    }
313
69.9k
314
69.9k
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
315
69.9k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
301
14
                            ArrayRef<Type *> ParamTys) {
302
14
    if (IID == Intrinsic::cttz) {
303
0
      if (getTLI()->isCheapToSpeculateCttz())
304
0
        return TargetTransformInfo::TCC_Basic;
305
0
      return TargetTransformInfo::TCC_Expensive;
306
0
    }
307
14
308
14
    if (IID == Intrinsic::ctlz) {
309
0
      if (getTLI()->isCheapToSpeculateCtlz())
310
0
        return TargetTransformInfo::TCC_Basic;
311
0
      return TargetTransformInfo::TCC_Expensive;
312
0
    }
313
14
314
14
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
315
14
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
301
5
                            ArrayRef<Type *> ParamTys) {
302
5
    if (IID == Intrinsic::cttz) {
303
1
      if (getTLI()->isCheapToSpeculateCttz())
304
1
        return TargetTransformInfo::TCC_Basic;
305
0
      return TargetTransformInfo::TCC_Expensive;
306
0
    }
307
4
308
4
    if (IID == Intrinsic::ctlz) {
309
1
      if (getTLI()->isCheapToSpeculateCtlz())
310
1
        return TargetTransformInfo::TCC_Basic;
311
0
      return TargetTransformInfo::TCC_Expensive;
312
0
    }
313
3
314
3
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
315
3
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
301
16
                            ArrayRef<Type *> ParamTys) {
302
16
    if (IID == Intrinsic::cttz) {
303
0
      if (getTLI()->isCheapToSpeculateCttz())
304
0
        return TargetTransformInfo::TCC_Basic;
305
0
      return TargetTransformInfo::TCC_Expensive;
306
0
    }
307
16
308
16
    if (IID == Intrinsic::ctlz) {
309
0
      if (getTLI()->isCheapToSpeculateCtlz())
310
0
        return TargetTransformInfo::TCC_Basic;
311
0
      return TargetTransformInfo::TCC_Expensive;
312
0
    }
313
16
314
16
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
315
16
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
301
59
                            ArrayRef<Type *> ParamTys) {
302
59
    if (IID == Intrinsic::cttz) {
303
1
      if (getTLI()->isCheapToSpeculateCttz())
304
1
        return TargetTransformInfo::TCC_Basic;
305
0
      return TargetTransformInfo::TCC_Expensive;
306
0
    }
307
58
308
58
    if (IID == Intrinsic::ctlz) {
309
1
      if (getTLI()->isCheapToSpeculateCtlz())
310
1
        return TargetTransformInfo::TCC_Basic;
311
0
      return TargetTransformInfo::TCC_Expensive;
312
0
    }
313
57
314
57
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
315
57
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
301
20
                            ArrayRef<Type *> ParamTys) {
302
20
    if (IID == Intrinsic::cttz) {
303
0
      if (getTLI()->isCheapToSpeculateCttz())
304
0
        return TargetTransformInfo::TCC_Basic;
305
0
      return TargetTransformInfo::TCC_Expensive;
306
0
    }
307
20
308
20
    if (IID == Intrinsic::ctlz) {
309
0
      if (getTLI()->isCheapToSpeculateCtlz())
310
0
        return TargetTransformInfo::TCC_Basic;
311
0
      return TargetTransformInfo::TCC_Expensive;
312
0
    }
313
20
314
20
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
315
20
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
301
249k
                            ArrayRef<Type *> ParamTys) {
302
249k
    if (IID == Intrinsic::cttz) {
303
6.52k
      if (getTLI()->isCheapToSpeculateCttz())
304
1.32k
        return TargetTransformInfo::TCC_Basic;
305
5.19k
      return TargetTransformInfo::TCC_Expensive;
306
5.19k
    }
307
242k
308
242k
    if (IID == Intrinsic::ctlz) {
309
7.48k
      if (getTLI()->isCheapToSpeculateCtlz())
310
1.32k
        return TargetTransformInfo::TCC_Basic;
311
6.16k
      return TargetTransformInfo::TCC_Expensive;
312
6.16k
    }
313
235k
314
235k
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
315
235k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
316
317
  unsigned getEstimatedNumberOfCaseClusters(const SwitchInst &SI,
318
44.3k
                                            unsigned &JumpTableSize) {
319
44.3k
    /// Try to find the estimated number of clusters. Note that the number of
320
44.3k
    /// clusters identified in this function could be different from the actural
321
44.3k
    /// numbers found in lowering. This function ignore switches that are
322
44.3k
    /// lowered with a mix of jump table / bit test / BTree. This function was
323
44.3k
    /// initially intended to be used when estimating the cost of switch in
324
44.3k
    /// inline cost heuristic, but it's a generic cost model to be used in other
325
44.3k
    /// places (e.g., in loop unrolling).
326
44.3k
    unsigned N = SI.getNumCases();
327
44.3k
    const TargetLoweringBase *TLI = getTLI();
328
44.3k
    const DataLayout &DL = this->getDataLayout();
329
44.3k
330
44.3k
    JumpTableSize = 0;
331
44.3k
    bool IsJTAllowed = TLI->areJTsAllowed(SI.getParent()->getParent());
332
44.3k
333
44.3k
    // Early exit if both a jump table and bit test are not allowed.
334
44.3k
    if (N < 1 || (!IsJTAllowed && 
DL.getIndexSizeInBits(0u) < N0
))
335
0
      return N;
336
44.3k
337
44.3k
    APInt MaxCaseVal = SI.case_begin()->getCaseValue()->getValue();
338
44.3k
    APInt MinCaseVal = MaxCaseVal;
339
406k
    for (auto CI : SI.cases()) {
340
406k
      const APInt &CaseVal = CI.getCaseValue()->getValue();
341
406k
      if (CaseVal.sgt(MaxCaseVal))
342
82.7k
        MaxCaseVal = CaseVal;
343
406k
      if (CaseVal.slt(MinCaseVal))
344
41.8k
        MinCaseVal = CaseVal;
345
406k
    }
346
44.3k
347
44.3k
    // Check if suitable for a bit test
348
44.3k
    if (N <= DL.getIndexSizeInBits(0u)) {
349
43.5k
      SmallPtrSet<const BasicBlock *, 4> Dests;
350
43.5k
      for (auto I : SI.cases())
351
264k
        Dests.insert(I.getCaseSuccessor());
352
43.5k
353
43.5k
      if (TLI->isSuitableForBitTests(Dests.size(), N, MinCaseVal, MaxCaseVal,
354
43.5k
                                     DL))
355
5.25k
        return 1;
356
39.0k
    }
357
39.0k
358
39.0k
    // Check if suitable for a jump table.
359
39.0k
    if (IsJTAllowed) {
360
39.0k
      if (N < 2 || N < TLI->getMinimumJumpTableEntries())
361
24.3k
        return N;
362
14.7k
      uint64_t Range =
363
14.7k
          (MaxCaseVal - MinCaseVal)
364
14.7k
              .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1;
365
14.7k
      // Check whether a range of clusters is dense enough for a jump table
366
14.7k
      if (TLI->isSuitableForJumpTable(&SI, N, Range)) {
367
12.1k
        JumpTableSize = Range;
368
12.1k
        return 1;
369
12.1k
      }
370
2.53k
    }
371
2.53k
    return N;
372
2.53k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Line
Count
Source
318
32.4k
                                            unsigned &JumpTableSize) {
319
32.4k
    /// Try to find the estimated number of clusters. Note that the number of
320
32.4k
    /// clusters identified in this function could be different from the actural
321
32.4k
    /// numbers found in lowering. This function ignore switches that are
322
32.4k
    /// lowered with a mix of jump table / bit test / BTree. This function was
323
32.4k
    /// initially intended to be used when estimating the cost of switch in
324
32.4k
    /// inline cost heuristic, but it's a generic cost model to be used in other
325
32.4k
    /// places (e.g., in loop unrolling).
326
32.4k
    unsigned N = SI.getNumCases();
327
32.4k
    const TargetLoweringBase *TLI = getTLI();
328
32.4k
    const DataLayout &DL = this->getDataLayout();
329
32.4k
330
32.4k
    JumpTableSize = 0;
331
32.4k
    bool IsJTAllowed = TLI->areJTsAllowed(SI.getParent()->getParent());
332
32.4k
333
32.4k
    // Early exit if both a jump table and bit test are not allowed.
334
32.4k
    if (N < 1 || (!IsJTAllowed && 
DL.getIndexSizeInBits(0u) < N0
))
335
0
      return N;
336
32.4k
337
32.4k
    APInt MaxCaseVal = SI.case_begin()->getCaseValue()->getValue();
338
32.4k
    APInt MinCaseVal = MaxCaseVal;
339
357k
    for (auto CI : SI.cases()) {
340
357k
      const APInt &CaseVal = CI.getCaseValue()->getValue();
341
357k
      if (CaseVal.sgt(MaxCaseVal))
342
59.8k
        MaxCaseVal = CaseVal;
343
357k
      if (CaseVal.slt(MinCaseVal))
344
33.6k
        MinCaseVal = CaseVal;
345
357k
    }
346
32.4k
347
32.4k
    // Check if suitable for a bit test
348
32.4k
    if (N <= DL.getIndexSizeInBits(0u)) {
349
31.6k
      SmallPtrSet<const BasicBlock *, 4> Dests;
350
31.6k
      for (auto I : SI.cases())
351
216k
        Dests.insert(I.getCaseSuccessor());
352
31.6k
353
31.6k
      if (TLI->isSuitableForBitTests(Dests.size(), N, MinCaseVal, MaxCaseVal,
354
31.6k
                                     DL))
355
2.69k
        return 1;
356
29.7k
    }
357
29.7k
358
29.7k
    // Check if suitable for a jump table.
359
29.7k
    if (IsJTAllowed) {
360
29.7k
      if (N < 2 || N < TLI->getMinimumJumpTableEntries())
361
18.3k
        return N;
362
11.4k
      uint64_t Range =
363
11.4k
          (MaxCaseVal - MinCaseVal)
364
11.4k
              .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1;
365
11.4k
      // Check whether a range of clusters is dense enough for a jump table
366
11.4k
      if (TLI->isSuitableForJumpTable(&SI, N, Range)) {
367
9.40k
        JumpTableSize = Range;
368
9.40k
        return 1;
369
9.40k
      }
370
2.02k
    }
371
2.02k
    return N;
372
2.02k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Line
Count
Source
318
2.15k
                                            unsigned &JumpTableSize) {
319
2.15k
    /// Try to find the estimated number of clusters. Note that the number of
320
2.15k
    /// clusters identified in this function could be different from the actural
321
2.15k
    /// numbers found in lowering. This function ignore switches that are
322
2.15k
    /// lowered with a mix of jump table / bit test / BTree. This function was
323
2.15k
    /// initially intended to be used when estimating the cost of switch in
324
2.15k
    /// inline cost heuristic, but it's a generic cost model to be used in other
325
2.15k
    /// places (e.g., in loop unrolling).
326
2.15k
    unsigned N = SI.getNumCases();
327
2.15k
    const TargetLoweringBase *TLI = getTLI();
328
2.15k
    const DataLayout &DL = this->getDataLayout();
329
2.15k
330
2.15k
    JumpTableSize = 0;
331
2.15k
    bool IsJTAllowed = TLI->areJTsAllowed(SI.getParent()->getParent());
332
2.15k
333
2.15k
    // Early exit if both a jump table and bit test are not allowed.
334
2.15k
    if (N < 1 || (!IsJTAllowed && 
DL.getIndexSizeInBits(0u) < N0
))
335
0
      return N;
336
2.15k
337
2.15k
    APInt MaxCaseVal = SI.case_begin()->getCaseValue()->getValue();
338
2.15k
    APInt MinCaseVal = MaxCaseVal;
339
9.32k
    for (auto CI : SI.cases()) {
340
9.32k
      const APInt &CaseVal = CI.getCaseValue()->getValue();
341
9.32k
      if (CaseVal.sgt(MaxCaseVal))
342
4.11k
        MaxCaseVal = CaseVal;
343
9.32k
      if (CaseVal.slt(MinCaseVal))
344
1.52k
        MinCaseVal = CaseVal;
345
9.32k
    }
346
2.15k
347
2.15k
    // Check if suitable for a bit test
348
2.15k
    if (N <= DL.getIndexSizeInBits(0u)) {
349
2.15k
      SmallPtrSet<const BasicBlock *, 4> Dests;
350
2.15k
      for (auto I : SI.cases())
351
9.32k
        Dests.insert(I.getCaseSuccessor());
352
2.15k
353
2.15k
      if (TLI->isSuitableForBitTests(Dests.size(), N, MinCaseVal, MaxCaseVal,
354
2.15k
                                     DL))
355
138
        return 1;
356
2.02k
    }
357
2.02k
358
2.02k
    // Check if suitable for a jump table.
359
2.02k
    if (IsJTAllowed) {
360
2.02k
      if (N < 2 || N < TLI->getMinimumJumpTableEntries())
361
1.18k
        return N;
362
840
      uint64_t Range =
363
840
          (MaxCaseVal - MinCaseVal)
364
840
              .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1;
365
840
      // Check whether a range of clusters is dense enough for a jump table
366
840
      if (TLI->isSuitableForJumpTable(&SI, N, Range)) {
367
705
        JumpTableSize = Range;
368
705
        return 1;
369
705
      }
370
135
    }
371
135
    return N;
372
135
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Line
Count
Source
318
9.76k
                                            unsigned &JumpTableSize) {
319
9.76k
    /// Try to find the estimated number of clusters. Note that the number of
320
9.76k
    /// clusters identified in this function could be different from the actural
321
9.76k
    /// numbers found in lowering. This function ignore switches that are
322
9.76k
    /// lowered with a mix of jump table / bit test / BTree. This function was
323
9.76k
    /// initially intended to be used when estimating the cost of switch in
324
9.76k
    /// inline cost heuristic, but it's a generic cost model to be used in other
325
9.76k
    /// places (e.g., in loop unrolling).
326
9.76k
    unsigned N = SI.getNumCases();
327
9.76k
    const TargetLoweringBase *TLI = getTLI();
328
9.76k
    const DataLayout &DL = this->getDataLayout();
329
9.76k
330
9.76k
    JumpTableSize = 0;
331
9.76k
    bool IsJTAllowed = TLI->areJTsAllowed(SI.getParent()->getParent());
332
9.76k
333
9.76k
    // Early exit if both a jump table and bit test are not allowed.
334
9.76k
    if (N < 1 || (!IsJTAllowed && 
DL.getIndexSizeInBits(0u) < N0
))
335
0
      return N;
336
9.76k
337
9.76k
    APInt MaxCaseVal = SI.case_begin()->getCaseValue()->getValue();
338
9.76k
    APInt MinCaseVal = MaxCaseVal;
339
39.5k
    for (auto CI : SI.cases()) {
340
39.5k
      const APInt &CaseVal = CI.getCaseValue()->getValue();
341
39.5k
      if (CaseVal.sgt(MaxCaseVal))
342
18.8k
        MaxCaseVal = CaseVal;
343
39.5k
      if (CaseVal.slt(MinCaseVal))
344
6.64k
        MinCaseVal = CaseVal;
345
39.5k
    }
346
9.76k
347
9.76k
    // Check if suitable for a bit test
348
9.76k
    if (N <= DL.getIndexSizeInBits(0u)) {
349
9.76k
      SmallPtrSet<const BasicBlock *, 4> Dests;
350
9.76k
      for (auto I : SI.cases())
351
39.4k
        Dests.insert(I.getCaseSuccessor());
352
9.76k
353
9.76k
      if (TLI->isSuitableForBitTests(Dests.size(), N, MinCaseVal, MaxCaseVal,
354
9.76k
                                     DL))
355
2.42k
        return 1;
356
7.33k
    }
357
7.33k
358
7.33k
    // Check if suitable for a jump table.
359
7.33k
    if (IsJTAllowed) {
360
7.33k
      if (N < 2 || N < TLI->getMinimumJumpTableEntries())
361
4.90k
        return N;
362
2.43k
      uint64_t Range =
363
2.43k
          (MaxCaseVal - MinCaseVal)
364
2.43k
              .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1;
365
2.43k
      // Check whether a range of clusters is dense enough for a jump table
366
2.43k
      if (TLI->isSuitableForJumpTable(&SI, N, Range)) {
367
2.06k
        JumpTableSize = Range;
368
2.06k
        return 1;
369
2.06k
      }
370
369
    }
371
369
    return N;
372
369
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
373
374
0
  unsigned getJumpBufAlignment() { return getTLI()->getJumpBufAlignment(); }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getJumpBufAlignment()
375
376
0
  unsigned getJumpBufSize() { return getTLI()->getJumpBufSize(); }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getJumpBufSize()
377
378
61.3k
  bool shouldBuildLookupTables() {
379
61.3k
    const TargetLoweringBase *TLI = getTLI();
380
61.3k
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
381
61.3k
           
TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other)2.70k
;
382
61.3k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::shouldBuildLookupTables()
Line
Count
Source
378
57.6k
  bool shouldBuildLookupTables() {
379
57.6k
    const TargetLoweringBase *TLI = getTLI();
380
57.6k
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
381
57.6k
           
TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other)0
;
382
57.6k
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::shouldBuildLookupTables()
Line
Count
Source
378
6
  bool shouldBuildLookupTables() {
379
6
    const TargetLoweringBase *TLI = getTLI();
380
6
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
381
6
           TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other);
382
6
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::shouldBuildLookupTables()
Line
Count
Source
378
6
  bool shouldBuildLookupTables() {
379
6
    const TargetLoweringBase *TLI = getTLI();
380
6
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
381
6
           TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other);
382
6
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::shouldBuildLookupTables()
Line
Count
Source
378
1.04k
  bool shouldBuildLookupTables() {
379
1.04k
    const TargetLoweringBase *TLI = getTLI();
380
1.04k
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
381
1.04k
           
TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other)0
;
382
1.04k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::shouldBuildLookupTables()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::shouldBuildLookupTables()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::shouldBuildLookupTables()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::shouldBuildLookupTables()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::shouldBuildLookupTables()
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::shouldBuildLookupTables()
Line
Count
Source
378
2.69k
  bool shouldBuildLookupTables() {
379
2.69k
    const TargetLoweringBase *TLI = getTLI();
380
2.69k
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
381
2.69k
           TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other);
382
2.69k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::shouldBuildLookupTables()
383
384
54
  bool haveFastSqrt(Type *Ty) {
385
54
    const TargetLoweringBase *TLI = getTLI();
386
54
    EVT VT = TLI->getValueType(DL, Ty);
387
54
    return TLI->isTypeLegal(VT) &&
388
54
           
TLI->isOperationLegalOrCustom(ISD::FSQRT, VT)52
;
389
54
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::haveFastSqrt(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::haveFastSqrt(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::haveFastSqrt(llvm::Type*)
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::haveFastSqrt(llvm::Type*)
Line
Count
Source
384
2
  bool haveFastSqrt(Type *Ty) {
385
2
    const TargetLoweringBase *TLI = getTLI();
386
2
    EVT VT = TLI->getValueType(DL, Ty);
387
2
    return TLI->isTypeLegal(VT) &&
388
2
           
TLI->isOperationLegalOrCustom(ISD::FSQRT, VT)0
;
389
2
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::haveFastSqrt(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::haveFastSqrt(llvm::Type*)
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::haveFastSqrt(llvm::Type*)
Line
Count
Source
384
14
  bool haveFastSqrt(Type *Ty) {
385
14
    const TargetLoweringBase *TLI = getTLI();
386
14
    EVT VT = TLI->getValueType(DL, Ty);
387
14
    return TLI->isTypeLegal(VT) &&
388
14
           TLI->isOperationLegalOrCustom(ISD::FSQRT, VT);
389
14
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::haveFastSqrt(llvm::Type*)
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::haveFastSqrt(llvm::Type*)
Line
Count
Source
384
4
  bool haveFastSqrt(Type *Ty) {
385
4
    const TargetLoweringBase *TLI = getTLI();
386
4
    EVT VT = TLI->getValueType(DL, Ty);
387
4
    return TLI->isTypeLegal(VT) &&
388
4
           TLI->isOperationLegalOrCustom(ISD::FSQRT, VT);
389
4
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::haveFastSqrt(llvm::Type*)
Line
Count
Source
384
4
  bool haveFastSqrt(Type *Ty) {
385
4
    const TargetLoweringBase *TLI = getTLI();
386
4
    EVT VT = TLI->getValueType(DL, Ty);
387
4
    return TLI->isTypeLegal(VT) &&
388
4
           TLI->isOperationLegalOrCustom(ISD::FSQRT, VT);
389
4
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::haveFastSqrt(llvm::Type*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::haveFastSqrt(llvm::Type*)
Line
Count
Source
384
30
  bool haveFastSqrt(Type *Ty) {
385
30
    const TargetLoweringBase *TLI = getTLI();
386
30
    EVT VT = TLI->getValueType(DL, Ty);
387
30
    return TLI->isTypeLegal(VT) &&
388
30
           TLI->isOperationLegalOrCustom(ISD::FSQRT, VT);
389
30
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::haveFastSqrt(llvm::Type*)
390
391
22
  bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) {
392
22
    return true;
393
22
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isFCmpOrdCheaperThanFCmpZero(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isFCmpOrdCheaperThanFCmpZero(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isFCmpOrdCheaperThanFCmpZero(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isFCmpOrdCheaperThanFCmpZero(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isFCmpOrdCheaperThanFCmpZero(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isFCmpOrdCheaperThanFCmpZero(llvm::Type*)
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isFCmpOrdCheaperThanFCmpZero(llvm::Type*)
Line
Count
Source
391
14
  bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) {
392
14
    return true;
393
14
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isFCmpOrdCheaperThanFCmpZero(llvm::Type*)
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isFCmpOrdCheaperThanFCmpZero(llvm::Type*)
Line
Count
Source
391
4
  bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) {
392
4
    return true;
393
4
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isFCmpOrdCheaperThanFCmpZero(llvm::Type*)
Line
Count
Source
391
4
  bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) {
392
4
    return true;
393
4
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isFCmpOrdCheaperThanFCmpZero(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isFCmpOrdCheaperThanFCmpZero(llvm::Type*)
394
395
573k
  unsigned getFPOpCost(Type *Ty) {
396
573k
    // Check whether FADD is available, as a proxy for floating-point in
397
573k
    // general.
398
573k
    const TargetLoweringBase *TLI = getTLI();
399
573k
    EVT VT = TLI->getValueType(DL, Ty);
400
573k
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
401
570k
      return TargetTransformInfo::TCC_Basic;
402
2.30k
    return TargetTransformInfo::TCC_Expensive;
403
2.30k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getFPOpCost(llvm::Type*)
Line
Count
Source
395
567k
  unsigned getFPOpCost(Type *Ty) {
396
567k
    // Check whether FADD is available, as a proxy for floating-point in
397
567k
    // general.
398
567k
    const TargetLoweringBase *TLI = getTLI();
399
567k
    EVT VT = TLI->getValueType(DL, Ty);
400
567k
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
401
565k
      return TargetTransformInfo::TCC_Basic;
402
1.97k
    return TargetTransformInfo::TCC_Expensive;
403
1.97k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getFPOpCost(llvm::Type*)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getFPOpCost(llvm::Type*)
Line
Count
Source
395
12
  unsigned getFPOpCost(Type *Ty) {
396
12
    // Check whether FADD is available, as a proxy for floating-point in
397
12
    // general.
398
12
    const TargetLoweringBase *TLI = getTLI();
399
12
    EVT VT = TLI->getValueType(DL, Ty);
400
12
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
401
12
      return TargetTransformInfo::TCC_Basic;
402
0
    return TargetTransformInfo::TCC_Expensive;
403
0
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getFPOpCost(llvm::Type*)
Line
Count
Source
395
570
  unsigned getFPOpCost(Type *Ty) {
396
570
    // Check whether FADD is available, as a proxy for floating-point in
397
570
    // general.
398
570
    const TargetLoweringBase *TLI = getTLI();
399
570
    EVT VT = TLI->getValueType(DL, Ty);
400
570
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
401
240
      return TargetTransformInfo::TCC_Basic;
402
330
    return TargetTransformInfo::TCC_Expensive;
403
330
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getFPOpCost(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getFPOpCost(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getFPOpCost(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getFPOpCost(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getFPOpCost(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getFPOpCost(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getFPOpCost(llvm::Type*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getFPOpCost(llvm::Type*)
Line
Count
Source
395
5.43k
  unsigned getFPOpCost(Type *Ty) {
396
5.43k
    // Check whether FADD is available, as a proxy for floating-point in
397
5.43k
    // general.
398
5.43k
    const TargetLoweringBase *TLI = getTLI();
399
5.43k
    EVT VT = TLI->getValueType(DL, Ty);
400
5.43k
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
401
5.43k
      return TargetTransformInfo::TCC_Basic;
402
0
    return TargetTransformInfo::TCC_Expensive;
403
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getFPOpCost(llvm::Type*)
404
405
26.5M
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
26.5M
    const TargetLoweringBase *TLI = getTLI();
407
26.5M
    switch (Opcode) {
408
26.5M
    
default: break25.7M
;
409
26.5M
    case Instruction::Trunc:
410
772k
      if (TLI->isTruncateFree(OpTy, Ty))
411
726k
        return TargetTransformInfo::TCC_Free;
412
46.6k
      return TargetTransformInfo::TCC_Basic;
413
46.6k
    case Instruction::ZExt:
414
0
      if (TLI->isZExtFree(OpTy, Ty))
415
0
        return TargetTransformInfo::TCC_Free;
416
0
      return TargetTransformInfo::TCC_Basic;
417
25.7M
    }
418
25.7M
419
25.7M
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
420
25.7M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
405
24.2M
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
24.2M
    const TargetLoweringBase *TLI = getTLI();
407
24.2M
    switch (Opcode) {
408
24.2M
    
default: break23.5M
;
409
24.2M
    case Instruction::Trunc:
410
683k
      if (TLI->isTruncateFree(OpTy, Ty))
411
640k
        return TargetTransformInfo::TCC_Free;
412
42.6k
      return TargetTransformInfo::TCC_Basic;
413
42.6k
    case Instruction::ZExt:
414
0
      if (TLI->isZExtFree(OpTy, Ty))
415
0
        return TargetTransformInfo::TCC_Free;
416
0
      return TargetTransformInfo::TCC_Basic;
417
23.5M
    }
418
23.5M
419
23.5M
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
420
23.5M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
405
314
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
314
    const TargetLoweringBase *TLI = getTLI();
407
314
    switch (Opcode) {
408
314
    default: break;
409
314
    case Instruction::Trunc:
410
0
      if (TLI->isTruncateFree(OpTy, Ty))
411
0
        return TargetTransformInfo::TCC_Free;
412
0
      return TargetTransformInfo::TCC_Basic;
413
0
    case Instruction::ZExt:
414
0
      if (TLI->isZExtFree(OpTy, Ty))
415
0
        return TargetTransformInfo::TCC_Free;
416
0
      return TargetTransformInfo::TCC_Basic;
417
314
    }
418
314
419
314
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
420
314
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
405
5.28k
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
5.28k
    const TargetLoweringBase *TLI = getTLI();
407
5.28k
    switch (Opcode) {
408
5.28k
    
default: break5.24k
;
409
5.28k
    case Instruction::Trunc:
410
39
      if (TLI->isTruncateFree(OpTy, Ty))
411
33
        return TargetTransformInfo::TCC_Free;
412
6
      return TargetTransformInfo::TCC_Basic;
413
6
    case Instruction::ZExt:
414
0
      if (TLI->isZExtFree(OpTy, Ty))
415
0
        return TargetTransformInfo::TCC_Free;
416
0
      return TargetTransformInfo::TCC_Basic;
417
5.24k
    }
418
5.24k
419
5.24k
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
420
5.24k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
405
522k
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
522k
    const TargetLoweringBase *TLI = getTLI();
407
522k
    switch (Opcode) {
408
522k
    
default: break509k
;
409
522k
    case Instruction::Trunc:
410
13.1k
      if (TLI->isTruncateFree(OpTy, Ty))
411
9.25k
        return TargetTransformInfo::TCC_Free;
412
3.84k
      return TargetTransformInfo::TCC_Basic;
413
3.84k
    case Instruction::ZExt:
414
0
      if (TLI->isZExtFree(OpTy, Ty))
415
0
        return TargetTransformInfo::TCC_Free;
416
0
      return TargetTransformInfo::TCC_Basic;
417
509k
    }
418
509k
419
509k
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
420
509k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
405
197
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
197
    const TargetLoweringBase *TLI = getTLI();
407
197
    switch (Opcode) {
408
197
    
default: break185
;
409
197
    case Instruction::Trunc:
410
12
      if (TLI->isTruncateFree(OpTy, Ty))
411
1
        return TargetTransformInfo::TCC_Free;
412
11
      return TargetTransformInfo::TCC_Basic;
413
11
    case Instruction::ZExt:
414
0
      if (TLI->isZExtFree(OpTy, Ty))
415
0
        return TargetTransformInfo::TCC_Free;
416
0
      return TargetTransformInfo::TCC_Basic;
417
185
    }
418
185
419
185
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
420
185
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
405
102
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
102
    const TargetLoweringBase *TLI = getTLI();
407
102
    switch (Opcode) {
408
102
    default: break;
409
102
    case Instruction::Trunc:
410
0
      if (TLI->isTruncateFree(OpTy, Ty))
411
0
        return TargetTransformInfo::TCC_Free;
412
0
      return TargetTransformInfo::TCC_Basic;
413
0
    case Instruction::ZExt:
414
0
      if (TLI->isZExtFree(OpTy, Ty))
415
0
        return TargetTransformInfo::TCC_Free;
416
0
      return TargetTransformInfo::TCC_Basic;
417
102
    }
418
102
419
102
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
420
102
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
405
5.06k
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
5.06k
    const TargetLoweringBase *TLI = getTLI();
407
5.06k
    switch (Opcode) {
408
5.06k
    
default: break4.91k
;
409
5.06k
    case Instruction::Trunc:
410
153
      if (TLI->isTruncateFree(OpTy, Ty))
411
101
        return TargetTransformInfo::TCC_Free;
412
52
      return TargetTransformInfo::TCC_Basic;
413
52
    case Instruction::ZExt:
414
0
      if (TLI->isZExtFree(OpTy, Ty))
415
0
        return TargetTransformInfo::TCC_Free;
416
0
      return TargetTransformInfo::TCC_Basic;
417
4.91k
    }
418
4.91k
419
4.91k
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
420
4.91k
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
405
1.05k
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
1.05k
    const TargetLoweringBase *TLI = getTLI();
407
1.05k
    switch (Opcode) {
408
1.05k
    
default: break1.03k
;
409
1.05k
    case Instruction::Trunc:
410
18
      if (TLI->isTruncateFree(OpTy, Ty))
411
15
        return TargetTransformInfo::TCC_Free;
412
3
      return TargetTransformInfo::TCC_Basic;
413
3
    case Instruction::ZExt:
414
0
      if (TLI->isZExtFree(OpTy, Ty))
415
0
        return TargetTransformInfo::TCC_Free;
416
0
      return TargetTransformInfo::TCC_Basic;
417
1.03k
    }
418
1.03k
419
1.03k
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
420
1.03k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
405
1.73M
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
1.73M
    const TargetLoweringBase *TLI = getTLI();
407
1.73M
    switch (Opcode) {
408
1.73M
    
default: break1.65M
;
409
1.73M
    case Instruction::Trunc:
410
75.9k
      if (TLI->isTruncateFree(OpTy, Ty))
411
75.8k
        return TargetTransformInfo::TCC_Free;
412
102
      return TargetTransformInfo::TCC_Basic;
413
102
    case Instruction::ZExt:
414
0
      if (TLI->isZExtFree(OpTy, Ty))
415
0
        return TargetTransformInfo::TCC_Free;
416
0
      return TargetTransformInfo::TCC_Basic;
417
1.65M
    }
418
1.65M
419
1.65M
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
420
1.65M
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
421
422
1.16M
  unsigned getInliningThresholdMultiplier() { return 1; }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
422
805k
  unsigned getInliningThresholdMultiplier() { return 1; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getInliningThresholdMultiplier()
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
422
76.3k
  unsigned getInliningThresholdMultiplier() { return 1; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getInliningThresholdMultiplier()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getInliningThresholdMultiplier()
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
422
8
  unsigned getInliningThresholdMultiplier() { return 1; }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
422
17
  unsigned getInliningThresholdMultiplier() { return 1; }
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
422
4
  unsigned getInliningThresholdMultiplier() { return 1; }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
422
283k
  unsigned getInliningThresholdMultiplier() { return 1; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getInliningThresholdMultiplier()
423
424
  void getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
425
388k
                               TTI::UnrollingPreferences &UP) {
426
388k
    // This unrolling functionality is target independent, but to provide some
427
388k
    // motivation for its intended use, for x86:
428
388k
429
388k
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
430
388k
    // Manual, Intel Core models and later have a loop stream detector (and
431
388k
    // associated uop queue) that can benefit from partial unrolling.
432
388k
    // The relevant requirements are:
433
388k
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
434
388k
    //    taken, and none of them may be calls.
435
388k
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
436
388k
437
388k
    // According to the Software Optimization Guide for AMD Family 15h
438
388k
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
439
388k
    // and loop buffer which can benefit from partial unrolling.
440
388k
    // The relevant requirements are:
441
388k
    //  - The loop must have fewer than 16 branches
442
388k
    //  - The loop must have less than 40 uops in all executed loop branches
443
388k
444
388k
    // The number of taken branches in a loop is hard to estimate here, and
445
388k
    // benchmarking has revealed that it is better not to be conservative when
446
388k
    // estimating the branch count. As a result, we'll ignore the branch limits
447
388k
    // until someone finds a case where it matters in practice.
448
388k
449
388k
    unsigned MaxOps;
450
388k
    const TargetSubtargetInfo *ST = getST();
451
388k
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
452
0
      MaxOps = PartialUnrollingThreshold;
453
388k
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
454
22.9k
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
455
365k
    else
456
365k
      return;
457
22.9k
458
22.9k
    // Scan the loop: don't unroll loops with calls.
459
71.0k
    
for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); 22.9k
I != E;
460
58.2k
         
++I48.1k
) {
461
58.2k
      BasicBlock *BB = *I;
462
58.2k
463
388k
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; 
++J330k
)
464
340k
        if (isa<CallInst>(J) || 
isa<InvokeInst>(J)324k
) {
465
15.7k
          ImmutableCallSite CS(&*J);
466
15.7k
          if (const Function *F = CS.getCalledFunction()) {
467
14.1k
            if (!static_cast<T *>(this)->isLoweredToCall(F))
468
5.59k
              continue;
469
10.1k
          }
470
10.1k
471
10.1k
          return;
472
10.1k
        }
473
58.2k
    }
474
22.9k
475
22.9k
    // Enable runtime and partial unrolling up to the specified size.
476
22.9k
    // Enable using trip count upper bound to unroll loops.
477
22.9k
    UP.Partial = UP.Runtime = UP.UpperBound = true;
478
12.7k
    UP.PartialThreshold = MaxOps;
479
12.7k
480
12.7k
    // Avoid unrolling when optimizing for size.
481
12.7k
    UP.OptSizeThreshold = 0;
482
12.7k
    UP.PartialOptSizeThreshold = 0;
483
12.7k
484
12.7k
    // Set number of instructions optimized when "back edge"
485
12.7k
    // becomes "fall through" to default value of 2.
486
12.7k
    UP.BEInsns = 2;
487
12.7k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
Line
Count
Source
425
358k
                               TTI::UnrollingPreferences &UP) {
426
358k
    // This unrolling functionality is target independent, but to provide some
427
358k
    // motivation for its intended use, for x86:
428
358k
429
358k
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
430
358k
    // Manual, Intel Core models and later have a loop stream detector (and
431
358k
    // associated uop queue) that can benefit from partial unrolling.
432
358k
    // The relevant requirements are:
433
358k
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
434
358k
    //    taken, and none of them may be calls.
435
358k
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
436
358k
437
358k
    // According to the Software Optimization Guide for AMD Family 15h
438
358k
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
439
358k
    // and loop buffer which can benefit from partial unrolling.
440
358k
    // The relevant requirements are:
441
358k
    //  - The loop must have fewer than 16 branches
442
358k
    //  - The loop must have less than 40 uops in all executed loop branches
443
358k
444
358k
    // The number of taken branches in a loop is hard to estimate here, and
445
358k
    // benchmarking has revealed that it is better not to be conservative when
446
358k
    // estimating the branch count. As a result, we'll ignore the branch limits
447
358k
    // until someone finds a case where it matters in practice.
448
358k
449
358k
    unsigned MaxOps;
450
358k
    const TargetSubtargetInfo *ST = getST();
451
358k
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
452
0
      MaxOps = PartialUnrollingThreshold;
453
358k
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
454
16
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
455
358k
    else
456
358k
      return;
457
16
458
16
    // Scan the loop: don't unroll loops with calls.
459
44
    
for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); 16
I != E;
460
28
         ++I) {
461
28
      BasicBlock *BB = *I;
462
28
463
219
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; 
++J191
)
464
191
        if (isa<CallInst>(J) || 
isa<InvokeInst>(J)185
) {
465
6
          ImmutableCallSite CS(&*J);
466
6
          if (const Function *F = CS.getCalledFunction()) {
467
6
            if (!static_cast<T *>(this)->isLoweredToCall(F))
468
6
              continue;
469
0
          }
470
0
471
0
          return;
472
0
        }
473
28
    }
474
16
475
16
    // Enable runtime and partial unrolling up to the specified size.
476
16
    // Enable using trip count upper bound to unroll loops.
477
16
    UP.Partial = UP.Runtime = UP.UpperBound = true;
478
16
    UP.PartialThreshold = MaxOps;
479
16
480
16
    // Avoid unrolling when optimizing for size.
481
16
    UP.OptSizeThreshold = 0;
482
16
    UP.PartialOptSizeThreshold = 0;
483
16
484
16
    // Set number of instructions optimized when "back edge"
485
16
    // becomes "fall through" to default value of 2.
486
16
    UP.BEInsns = 2;
487
16
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
Line
Count
Source
425
6.77k
                               TTI::UnrollingPreferences &UP) {
426
6.77k
    // This unrolling functionality is target independent, but to provide some
427
6.77k
    // motivation for its intended use, for x86:
428
6.77k
429
6.77k
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
430
6.77k
    // Manual, Intel Core models and later have a loop stream detector (and
431
6.77k
    // associated uop queue) that can benefit from partial unrolling.
432
6.77k
    // The relevant requirements are:
433
6.77k
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
434
6.77k
    //    taken, and none of them may be calls.
435
6.77k
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
436
6.77k
437
6.77k
    // According to the Software Optimization Guide for AMD Family 15h
438
6.77k
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
439
6.77k
    // and loop buffer which can benefit from partial unrolling.
440
6.77k
    // The relevant requirements are:
441
6.77k
    //  - The loop must have fewer than 16 branches
442
6.77k
    //  - The loop must have less than 40 uops in all executed loop branches
443
6.77k
444
6.77k
    // The number of taken branches in a loop is hard to estimate here, and
445
6.77k
    // benchmarking has revealed that it is better not to be conservative when
446
6.77k
    // estimating the branch count. As a result, we'll ignore the branch limits
447
6.77k
    // until someone finds a case where it matters in practice.
448
6.77k
449
6.77k
    unsigned MaxOps;
450
6.77k
    const TargetSubtargetInfo *ST = getST();
451
6.77k
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
452
0
      MaxOps = PartialUnrollingThreshold;
453
6.77k
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
454
21
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
455
6.75k
    else
456
6.75k
      return;
457
21
458
21
    // Scan the loop: don't unroll loops with calls.
459
45
    
for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); 21
I != E;
460
27
         
++I24
) {
461
27
      BasicBlock *BB = *I;
462
27
463
261
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; 
++J234
)
464
237
        if (isa<CallInst>(J) || 
isa<InvokeInst>(J)228
) {
465
9
          ImmutableCallSite CS(&*J);
466
9
          if (const Function *F = CS.getCalledFunction()) {
467
9
            if (!static_cast<T *>(this)->isLoweredToCall(F))
468
6
              continue;
469
3
          }
470
3
471
3
          return;
472
3
        }
473
27
    }
474
21
475
21
    // Enable runtime and partial unrolling up to the specified size.
476
21
    // Enable using trip count upper bound to unroll loops.
477
21
    UP.Partial = UP.Runtime = UP.UpperBound = true;
478
18
    UP.PartialThreshold = MaxOps;
479
18
480
18
    // Avoid unrolling when optimizing for size.
481
18
    UP.OptSizeThreshold = 0;
482
18
    UP.PartialOptSizeThreshold = 0;
483
18
484
18
    // Set number of instructions optimized when "back edge"
485
18
    // becomes "fall through" to default value of 2.
486
18
    UP.BEInsns = 2;
487
18
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
Line
Count
Source
425
2
                               TTI::UnrollingPreferences &UP) {
426
2
    // This unrolling functionality is target independent, but to provide some
427
2
    // motivation for its intended use, for x86:
428
2
429
2
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
430
2
    // Manual, Intel Core models and later have a loop stream detector (and
431
2
    // associated uop queue) that can benefit from partial unrolling.
432
2
    // The relevant requirements are:
433
2
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
434
2
    //    taken, and none of them may be calls.
435
2
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
436
2
437
2
    // According to the Software Optimization Guide for AMD Family 15h
438
2
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
439
2
    // and loop buffer which can benefit from partial unrolling.
440
2
    // The relevant requirements are:
441
2
    //  - The loop must have fewer than 16 branches
442
2
    //  - The loop must have less than 40 uops in all executed loop branches
443
2
444
2
    // The number of taken branches in a loop is hard to estimate here, and
445
2
    // benchmarking has revealed that it is better not to be conservative when
446
2
    // estimating the branch count. As a result, we'll ignore the branch limits
447
2
    // until someone finds a case where it matters in practice.
448
2
449
2
    unsigned MaxOps;
450
2
    const TargetSubtargetInfo *ST = getST();
451
2
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
452
0
      MaxOps = PartialUnrollingThreshold;
453
2
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
454
0
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
455
2
    else
456
2
      return;
457
0
458
0
    // Scan the loop: don't unroll loops with calls.
459
0
    for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); I != E;
460
0
         ++I) {
461
0
      BasicBlock *BB = *I;
462
0
463
0
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; ++J)
464
0
        if (isa<CallInst>(J) || isa<InvokeInst>(J)) {
465
0
          ImmutableCallSite CS(&*J);
466
0
          if (const Function *F = CS.getCalledFunction()) {
467
0
            if (!static_cast<T *>(this)->isLoweredToCall(F))
468
0
              continue;
469
0
          }
470
0
471
0
          return;
472
0
        }
473
0
    }
474
0
475
0
    // Enable runtime and partial unrolling up to the specified size.
476
0
    // Enable using trip count upper bound to unroll loops.
477
0
    UP.Partial = UP.Runtime = UP.UpperBound = true;
478
0
    UP.PartialThreshold = MaxOps;
479
0
480
0
    // Avoid unrolling when optimizing for size.
481
0
    UP.OptSizeThreshold = 0;
482
0
    UP.PartialOptSizeThreshold = 0;
483
0
484
0
    // Set number of instructions optimized when "back edge"
485
0
    // becomes "fall through" to default value of 2.
486
0
    UP.BEInsns = 2;
487
0
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
Line
Count
Source
425
11
                               TTI::UnrollingPreferences &UP) {
426
11
    // This unrolling functionality is target independent, but to provide some
427
11
    // motivation for its intended use, for x86:
428
11
429
11
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
430
11
    // Manual, Intel Core models and later have a loop stream detector (and
431
11
    // associated uop queue) that can benefit from partial unrolling.
432
11
    // The relevant requirements are:
433
11
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
434
11
    //    taken, and none of them may be calls.
435
11
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
436
11
437
11
    // According to the Software Optimization Guide for AMD Family 15h
438
11
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
439
11
    // and loop buffer which can benefit from partial unrolling.
440
11
    // The relevant requirements are:
441
11
    //  - The loop must have fewer than 16 branches
442
11
    //  - The loop must have less than 40 uops in all executed loop branches
443
11
444
11
    // The number of taken branches in a loop is hard to estimate here, and
445
11
    // benchmarking has revealed that it is better not to be conservative when
446
11
    // estimating the branch count. As a result, we'll ignore the branch limits
447
11
    // until someone finds a case where it matters in practice.
448
11
449
11
    unsigned MaxOps;
450
11
    const TargetSubtargetInfo *ST = getST();
451
11
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
452
0
      MaxOps = PartialUnrollingThreshold;
453
11
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
454
5
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
455
6
    else
456
6
      return;
457
5
458
5
    // Scan the loop: don't unroll loops with calls.
459
10
    
for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); 5
I != E;
460
5
         ++I) {
461
5
      BasicBlock *BB = *I;
462
5
463
57
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; 
++J52
)
464
52
        if (isa<CallInst>(J) || isa<InvokeInst>(J)) {
465
0
          ImmutableCallSite CS(&*J);
466
0
          if (const Function *F = CS.getCalledFunction()) {
467
0
            if (!static_cast<T *>(this)->isLoweredToCall(F))
468
0
              continue;
469
0
          }
470
0
471
0
          return;
472
0
        }
473
5
    }
474
5
475
5
    // Enable runtime and partial unrolling up to the specified size.
476
5
    // Enable using trip count upper bound to unroll loops.
477
5
    UP.Partial = UP.Runtime = UP.UpperBound = true;
478
5
    UP.PartialThreshold = MaxOps;
479
5
480
5
    // Avoid unrolling when optimizing for size.
481
5
    UP.OptSizeThreshold = 0;
482
5
    UP.PartialOptSizeThreshold = 0;
483
5
484
5
    // Set number of instructions optimized when "back edge"
485
5
    // becomes "fall through" to default value of 2.
486
5
    UP.BEInsns = 2;
487
5
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
Line
Count
Source
425
23.0k
                               TTI::UnrollingPreferences &UP) {
426
23.0k
    // This unrolling functionality is target independent, but to provide some
427
23.0k
    // motivation for its intended use, for x86:
428
23.0k
429
23.0k
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
430
23.0k
    // Manual, Intel Core models and later have a loop stream detector (and
431
23.0k
    // associated uop queue) that can benefit from partial unrolling.
432
23.0k
    // The relevant requirements are:
433
23.0k
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
434
23.0k
    //    taken, and none of them may be calls.
435
23.0k
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
436
23.0k
437
23.0k
    // According to the Software Optimization Guide for AMD Family 15h
438
23.0k
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
439
23.0k
    // and loop buffer which can benefit from partial unrolling.
440
23.0k
    // The relevant requirements are:
441
23.0k
    //  - The loop must have fewer than 16 branches
442
23.0k
    //  - The loop must have less than 40 uops in all executed loop branches
443
23.0k
444
23.0k
    // The number of taken branches in a loop is hard to estimate here, and
445
23.0k
    // benchmarking has revealed that it is better not to be conservative when
446
23.0k
    // estimating the branch count. As a result, we'll ignore the branch limits
447
23.0k
    // until someone finds a case where it matters in practice.
448
23.0k
449
23.0k
    unsigned MaxOps;
450
23.0k
    const TargetSubtargetInfo *ST = getST();
451
23.0k
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
452
0
      MaxOps = PartialUnrollingThreshold;
453
23.0k
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
454
22.8k
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
455
154
    else
456
154
      return;
457
22.8k
458
22.8k
    // Scan the loop: don't unroll loops with calls.
459
70.9k
    
for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); 22.8k
I != E;
460
58.2k
         
++I48.1k
) {
461
58.2k
      BasicBlock *BB = *I;
462
58.2k
463
388k
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; 
++J329k
)
464
340k
        if (isa<CallInst>(J) || 
isa<InvokeInst>(J)324k
) {
465
15.6k
          ImmutableCallSite CS(&*J);
466
15.6k
          if (const Function *F = CS.getCalledFunction()) {
467
14.1k
            if (!static_cast<T *>(this)->isLoweredToCall(F))
468
5.58k
              continue;
469
10.1k
          }
470
10.1k
471
10.1k
          return;
472
10.1k
        }
473
58.2k
    }
474
22.8k
475
22.8k
    // Enable runtime and partial unrolling up to the specified size.
476
22.8k
    // Enable using trip count upper bound to unroll loops.
477
22.8k
    UP.Partial = UP.Runtime = UP.UpperBound = true;
478
12.7k
    UP.PartialThreshold = MaxOps;
479
12.7k
480
12.7k
    // Avoid unrolling when optimizing for size.
481
12.7k
    UP.OptSizeThreshold = 0;
482
12.7k
    UP.PartialOptSizeThreshold = 0;
483
12.7k
484
12.7k
    // Set number of instructions optimized when "back edge"
485
12.7k
    // becomes "fall through" to default value of 2.
486
12.7k
    UP.BEInsns = 2;
487
12.7k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
488
489
11
  int getInstructionLatency(const Instruction *I) {
490
11
    if (isa<LoadInst>(I))
491
1
      return getST()->getSchedModel().DefaultLoadLatency;
492
10
493
10
    return BaseT::getInstructionLatency(I);
494
10
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getInstructionLatency(llvm::Instruction const*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getInstructionLatency(llvm::Instruction const*)
Line
Count
Source
489
11
  int getInstructionLatency(const Instruction *I) {
490
11
    if (isa<LoadInst>(I))
491
1
      return getST()->getSchedModel().DefaultLoadLatency;
492
10
493
10
    return BaseT::getInstructionLatency(I);
494
10
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getInstructionLatency(llvm::Instruction const*)
495
496
  /// @}
497
498
  /// \name Vector TTI Implementations
499
  /// @{
500
501
811
  unsigned getNumberOfRegisters(bool Vector) { return Vector ? 
0260
:
1551
; }
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getNumberOfRegisters(bool)
Line
Count
Source
501
56
  unsigned getNumberOfRegisters(bool Vector) { return Vector ? 
00
: 1; }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getNumberOfRegisters(bool)
Line
Count
Source
501
327
  unsigned getNumberOfRegisters(bool Vector) { return Vector ? 
052
:
1275
; }
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getNumberOfRegisters(bool)
Line
Count
Source
501
428
  unsigned getNumberOfRegisters(bool Vector) { return Vector ? 
0208
:
1220
; }
502
503
0
  unsigned getRegisterBitWidth(bool Vector) const { return 32; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getRegisterBitWidth(bool) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getRegisterBitWidth(bool) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getRegisterBitWidth(bool) const
504
505
  /// Estimate the overhead of scalarizing an instruction. Insert and Extract
506
  /// are set if the result needs to be inserted and/or extracted from vectors.
507
80.0k
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
508
80.0k
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
509
80.0k
    unsigned Cost = 0;
510
80.0k
511
332k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i252k
) {
512
252k
      if (Insert)
513
140k
        Cost += static_cast<T *>(this)
514
140k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
515
252k
      if (Extract)
516
114k
        Cost += static_cast<T *>(this)
517
114k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
518
252k
    }
519
80.0k
520
80.0k
    return Cost;
521
80.0k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
507
64.8k
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
508
64.8k
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
509
64.8k
    unsigned Cost = 0;
510
64.8k
511
239k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i174k
) {
512
174k
      if (Insert)
513
96.8k
        Cost += static_cast<T *>(this)
514
96.8k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
515
174k
      if (Extract)
516
78.0k
        Cost += static_cast<T *>(this)
517
78.0k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
518
174k
    }
519
64.8k
520
64.8k
    return Cost;
521
64.8k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
507
237
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
508
237
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
509
237
    unsigned Cost = 0;
510
237
511
1.14k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i911
) {
512
911
      if (Insert)
513
678
        Cost += static_cast<T *>(this)
514
678
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
515
911
      if (Extract)
516
237
        Cost += static_cast<T *>(this)
517
237
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
518
911
    }
519
237
520
237
    return Cost;
521
237
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
507
3.12k
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
508
3.12k
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
509
3.12k
    unsigned Cost = 0;
510
3.12k
511
10.9k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i7.84k
) {
512
7.84k
      if (Insert)
513
2.89k
        Cost += static_cast<T *>(this)
514
2.89k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
515
7.84k
      if (Extract)
516
5.18k
        Cost += static_cast<T *>(this)
517
5.18k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
518
7.84k
    }
519
3.12k
520
3.12k
    return Cost;
521
3.12k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
507
23
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
508
23
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
509
23
    unsigned Cost = 0;
510
23
511
311
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i288
) {
512
288
      if (Insert)
513
124
        Cost += static_cast<T *>(this)
514
124
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
515
288
      if (Extract)
516
164
        Cost += static_cast<T *>(this)
517
164
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
518
288
    }
519
23
520
23
    return Cost;
521
23
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
507
4
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
508
4
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
509
4
    unsigned Cost = 0;
510
4
511
12
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i8
) {
512
8
      if (Insert)
513
4
        Cost += static_cast<T *>(this)
514
4
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
515
8
      if (Extract)
516
4
        Cost += static_cast<T *>(this)
517
4
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
518
8
    }
519
4
520
4
    return Cost;
521
4
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
507
24
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
508
24
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
509
24
    unsigned Cost = 0;
510
24
511
103
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i79
) {
512
79
      if (Insert)
513
69
        Cost += static_cast<T *>(this)
514
69
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
515
79
      if (Extract)
516
10
        Cost += static_cast<T *>(this)
517
10
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
518
79
    }
519
24
520
24
    return Cost;
521
24
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
507
458
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
508
458
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
509
458
    unsigned Cost = 0;
510
458
511
3.29k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i2.83k
) {
512
2.83k
      if (Insert)
513
1.35k
        Cost += static_cast<T *>(this)
514
1.35k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
515
2.83k
      if (Extract)
516
1.25k
        Cost += static_cast<T *>(this)
517
1.25k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
518
2.83k
    }
519
458
520
458
    return Cost;
521
458
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
507
11.2k
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
508
11.2k
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
509
11.2k
    unsigned Cost = 0;
510
11.2k
511
77.1k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i65.9k
) {
512
65.9k
      if (Insert)
513
38.7k
        Cost += static_cast<T *>(this)
514
38.7k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
515
65.9k
      if (Extract)
516
29.2k
        Cost += static_cast<T *>(this)
517
29.2k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
518
65.9k
    }
519
11.2k
520
11.2k
    return Cost;
521
11.2k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
522
523
  /// Estimate the overhead of scalarizing an instructions unique
524
  /// non-constant operands. The types of the arguments are ordinarily
525
  /// scalar, in which case the costs are multiplied with VF.
526
  unsigned getOperandsScalarizationOverhead(ArrayRef<const Value *> Args,
527
21.7k
                                            unsigned VF) {
528
21.7k
    unsigned Cost = 0;
529
21.7k
    SmallPtrSet<const Value*, 4> UniqueOperands;
530
29.9k
    for (const Value *A : Args) {
531
29.9k
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second26.3k
) {
532
26.3k
        Type *VecTy = nullptr;
533
26.3k
        if (A->getType()->isVectorTy()) {
534
722
          VecTy = A->getType();
535
722
          // If A is a vector operand, VF should be 1 or correspond to A.
536
722
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
537
722
                 "Vector argument does not match VF");
538
722
        }
539
25.6k
        else
540
25.6k
          VecTy = VectorType::get(A->getType(), VF);
541
26.3k
542
26.3k
        Cost += getScalarizationOverhead(VecTy, false, true);
543
26.3k
      }
544
29.9k
    }
545
21.7k
546
21.7k
    return Cost;
547
21.7k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
527
17.0k
                                            unsigned VF) {
528
17.0k
    unsigned Cost = 0;
529
17.0k
    SmallPtrSet<const Value*, 4> UniqueOperands;
530
22.3k
    for (const Value *A : Args) {
531
22.3k
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second21.0k
) {
532
21.0k
        Type *VecTy = nullptr;
533
21.0k
        if (A->getType()->isVectorTy()) {
534
5
          VecTy = A->getType();
535
5
          // If A is a vector operand, VF should be 1 or correspond to A.
536
5
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
537
5
                 "Vector argument does not match VF");
538
5
        }
539
21.0k
        else
540
21.0k
          VecTy = VectorType::get(A->getType(), VF);
541
21.0k
542
21.0k
        Cost += getScalarizationOverhead(VecTy, false, true);
543
21.0k
      }
544
22.3k
    }
545
17.0k
546
17.0k
    return Cost;
547
17.0k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
527
18
                                            unsigned VF) {
528
18
    unsigned Cost = 0;
529
18
    SmallPtrSet<const Value*, 4> UniqueOperands;
530
30
    for (const Value *A : Args) {
531
30
      if (!isa<Constant>(A) && UniqueOperands.insert(A).second) {
532
30
        Type *VecTy = nullptr;
533
30
        if (A->getType()->isVectorTy()) {
534
6
          VecTy = A->getType();
535
6
          // If A is a vector operand, VF should be 1 or correspond to A.
536
6
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
537
6
                 "Vector argument does not match VF");
538
6
        }
539
24
        else
540
24
          VecTy = VectorType::get(A->getType(), VF);
541
30
542
30
        Cost += getScalarizationOverhead(VecTy, false, true);
543
30
      }
544
30
    }
545
18
546
18
    return Cost;
547
18
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
527
661
                                            unsigned VF) {
528
661
    unsigned Cost = 0;
529
661
    SmallPtrSet<const Value*, 4> UniqueOperands;
530
1.19k
    for (const Value *A : Args) {
531
1.19k
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second892
) {
532
892
        Type *VecTy = nullptr;
533
892
        if (A->getType()->isVectorTy()) {
534
0
          VecTy = A->getType();
535
0
          // If A is a vector operand, VF should be 1 or correspond to A.
536
0
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
537
0
                 "Vector argument does not match VF");
538
0
        }
539
892
        else
540
892
          VecTy = VectorType::get(A->getType(), VF);
541
892
542
892
        Cost += getScalarizationOverhead(VecTy, false, true);
543
892
      }
544
1.19k
    }
545
661
546
661
    return Cost;
547
661
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
527
5
                                            unsigned VF) {
528
5
    unsigned Cost = 0;
529
5
    SmallPtrSet<const Value*, 4> UniqueOperands;
530
10
    for (const Value *A : Args) {
531
10
      if (!isa<Constant>(A) && UniqueOperands.insert(A).second) {
532
10
        Type *VecTy = nullptr;
533
10
        if (A->getType()->isVectorTy()) {
534
0
          VecTy = A->getType();
535
0
          // If A is a vector operand, VF should be 1 or correspond to A.
536
0
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
537
0
                 "Vector argument does not match VF");
538
0
        }
539
10
        else
540
10
          VecTy = VectorType::get(A->getType(), VF);
541
10
542
10
        Cost += getScalarizationOverhead(VecTy, false, true);
543
10
      }
544
10
    }
545
5
546
5
    return Cost;
547
5
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
527
3
                                            unsigned VF) {
528
3
    unsigned Cost = 0;
529
3
    SmallPtrSet<const Value*, 4> UniqueOperands;
530
3
    for (const Value *A : Args) {
531
3
      if (!isa<Constant>(A) && UniqueOperands.insert(A).second) {
532
3
        Type *VecTy = nullptr;
533
3
        if (A->getType()->isVectorTy()) {
534
1
          VecTy = A->getType();
535
1
          // If A is a vector operand, VF should be 1 or correspond to A.
536
1
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
537
1
                 "Vector argument does not match VF");
538
1
        }
539
2
        else
540
2
          VecTy = VectorType::get(A->getType(), VF);
541
3
542
3
        Cost += getScalarizationOverhead(VecTy, false, true);
543
3
      }
544
3
    }
545
3
546
3
    return Cost;
547
3
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
527
72
                                            unsigned VF) {
528
72
    unsigned Cost = 0;
529
72
    SmallPtrSet<const Value*, 4> UniqueOperands;
530
144
    for (const Value *A : Args) {
531
144
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second60
) {
532
60
        Type *VecTy = nullptr;
533
60
        if (A->getType()->isVectorTy()) {
534
60
          VecTy = A->getType();
535
60
          // If A is a vector operand, VF should be 1 or correspond to A.
536
60
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
537
60
                 "Vector argument does not match VF");
538
60
        }
539
0
        else
540
0
          VecTy = VectorType::get(A->getType(), VF);
541
60
542
60
        Cost += getScalarizationOverhead(VecTy, false, true);
543
60
      }
544
144
    }
545
72
546
72
    return Cost;
547
72
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
527
3.99k
                                            unsigned VF) {
528
3.99k
    unsigned Cost = 0;
529
3.99k
    SmallPtrSet<const Value*, 4> UniqueOperands;
530
6.20k
    for (const Value *A : Args) {
531
6.20k
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second4.31k
) {
532
4.31k
        Type *VecTy = nullptr;
533
4.31k
        if (A->getType()->isVectorTy()) {
534
650
          VecTy = A->getType();
535
650
          // If A is a vector operand, VF should be 1 or correspond to A.
536
650
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
537
650
                 "Vector argument does not match VF");
538
650
        }
539
3.66k
        else
540
3.66k
          VecTy = VectorType::get(A->getType(), VF);
541
4.31k
542
4.31k
        Cost += getScalarizationOverhead(VecTy, false, true);
543
4.31k
      }
544
6.20k
    }
545
3.99k
546
3.99k
    return Cost;
547
3.99k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
548
549
5.61k
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
550
5.61k
    assert(VecTy->isVectorTy());
551
5.61k
552
5.61k
    unsigned Cost = 0;
553
5.61k
554
5.61k
    Cost += getScalarizationOverhead(VecTy, true, false);
555
5.61k
    if (!Args.empty())
556
64
      Cost += getOperandsScalarizationOverhead(Args,
557
64
                                               VecTy->getVectorNumElements());
558
5.54k
    else
559
5.54k
      // When no information on arguments is provided, we add the cost
560
5.54k
      // associated with one argument as a heuristic.
561
5.54k
      Cost += getScalarizationOverhead(VecTy, false, true);
562
5.61k
563
5.61k
    return Cost;
564
5.61k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
549
4.76k
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
550
4.76k
    assert(VecTy->isVectorTy());
551
4.76k
552
4.76k
    unsigned Cost = 0;
553
4.76k
554
4.76k
    Cost += getScalarizationOverhead(VecTy, true, false);
555
4.76k
    if (!Args.empty())
556
0
      Cost += getOperandsScalarizationOverhead(Args,
557
0
                                               VecTy->getVectorNumElements());
558
4.76k
    else
559
4.76k
      // When no information on arguments is provided, we add the cost
560
4.76k
      // associated with one argument as a heuristic.
561
4.76k
      Cost += getScalarizationOverhead(VecTy, false, true);
562
4.76k
563
4.76k
    return Cost;
564
4.76k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
549
32
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
550
32
    assert(VecTy->isVectorTy());
551
32
552
32
    unsigned Cost = 0;
553
32
554
32
    Cost += getScalarizationOverhead(VecTy, true, false);
555
32
    if (!Args.empty())
556
0
      Cost += getOperandsScalarizationOverhead(Args,
557
0
                                               VecTy->getVectorNumElements());
558
32
    else
559
32
      // When no information on arguments is provided, we add the cost
560
32
      // associated with one argument as a heuristic.
561
32
      Cost += getScalarizationOverhead(VecTy, false, true);
562
32
563
32
    return Cost;
564
32
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
549
694
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
550
694
    assert(VecTy->isVectorTy());
551
694
552
694
    unsigned Cost = 0;
553
694
554
694
    Cost += getScalarizationOverhead(VecTy, true, false);
555
694
    if (!Args.empty())
556
0
      Cost += getOperandsScalarizationOverhead(Args,
557
0
                                               VecTy->getVectorNumElements());
558
694
    else
559
694
      // When no information on arguments is provided, we add the cost
560
694
      // associated with one argument as a heuristic.
561
694
      Cost += getScalarizationOverhead(VecTy, false, true);
562
694
563
694
    return Cost;
564
694
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
549
2
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
550
2
    assert(VecTy->isVectorTy());
551
2
552
2
    unsigned Cost = 0;
553
2
554
2
    Cost += getScalarizationOverhead(VecTy, true, false);
555
2
    if (!Args.empty())
556
0
      Cost += getOperandsScalarizationOverhead(Args,
557
0
                                               VecTy->getVectorNumElements());
558
2
    else
559
2
      // When no information on arguments is provided, we add the cost
560
2
      // associated with one argument as a heuristic.
561
2
      Cost += getScalarizationOverhead(VecTy, false, true);
562
2
563
2
    return Cost;
564
2
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
549
64
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
550
64
    assert(VecTy->isVectorTy());
551
64
552
64
    unsigned Cost = 0;
553
64
554
64
    Cost += getScalarizationOverhead(VecTy, true, false);
555
64
    if (!Args.empty())
556
64
      Cost += getOperandsScalarizationOverhead(Args,
557
64
                                               VecTy->getVectorNumElements());
558
0
    else
559
0
      // When no information on arguments is provided, we add the cost
560
0
      // associated with one argument as a heuristic.
561
0
      Cost += getScalarizationOverhead(VecTy, false, true);
562
64
563
64
    return Cost;
564
64
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
549
54
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
550
54
    assert(VecTy->isVectorTy());
551
54
552
54
    unsigned Cost = 0;
553
54
554
54
    Cost += getScalarizationOverhead(VecTy, true, false);
555
54
    if (!Args.empty())
556
0
      Cost += getOperandsScalarizationOverhead(Args,
557
0
                                               VecTy->getVectorNumElements());
558
54
    else
559
54
      // When no information on arguments is provided, we add the cost
560
54
      // associated with one argument as a heuristic.
561
54
      Cost += getScalarizationOverhead(VecTy, false, true);
562
54
563
54
    return Cost;
564
54
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
565
566
66
  unsigned getMaxInterleaveFactor(unsigned VF) { return 1; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getMaxInterleaveFactor(unsigned int)
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getMaxInterleaveFactor(unsigned int)
Line
Count
Source
566
42
  unsigned getMaxInterleaveFactor(unsigned VF) { return 1; }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getMaxInterleaveFactor(unsigned int)
Line
Count
Source
566
1
  unsigned getMaxInterleaveFactor(unsigned VF) { return 1; }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getMaxInterleaveFactor(unsigned int)
Line
Count
Source
566
22
  unsigned getMaxInterleaveFactor(unsigned VF) { return 1; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getMaxInterleaveFactor(unsigned int)
llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getMaxInterleaveFactor(unsigned int)
Line
Count
Source
566
1
  unsigned getMaxInterleaveFactor(unsigned VF) { return 1; }
567
568
  unsigned getArithmeticInstrCost(
569
      unsigned Opcode, Type *Ty,
570
      TTI::OperandValueKind Opd1Info = TTI::OK_AnyValue,
571
      TTI::OperandValueKind Opd2Info = TTI::OK_AnyValue,
572
      TTI::OperandValueProperties Opd1PropInfo = TTI::OP_None,
573
      TTI::OperandValueProperties Opd2PropInfo = TTI::OP_None,
574
509k
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
575
509k
    // Check if any of the operands are vector operands.
576
509k
    const TargetLoweringBase *TLI = getTLI();
577
509k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
578
509k
    assert(ISD && "Invalid opcode");
579
509k
580
509k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
581
509k
582
509k
    bool IsFloat = Ty->isFPOrFPVectorTy();
583
509k
    // Assume that floating point arithmetic operations cost twice as much as
584
509k
    // integer operations.
585
509k
    unsigned OpCost = (IsFloat ? 
2267k
:
1242k
);
586
509k
587
509k
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
588
453k
      // The operation is legal. Assume it costs 1.
589
453k
      // TODO: Once we have extract/insert subvector cost we need to use them.
590
453k
      return LT.first * OpCost;
591
453k
    }
592
55.5k
593
55.5k
    if (!TLI->isOperationExpand(ISD, LT.second)) {
594
46.7k
      // If the operation is custom lowered, then assume that the code is twice
595
46.7k
      // as expensive.
596
46.7k
      return LT.first * 2 * OpCost;
597
46.7k
    }
598
8.80k
599
8.80k
    // Else, assume that we need to scalarize this op.
600
8.80k
    // TODO: If one of the types get legalized by splitting, handle this
601
8.80k
    // similarly to what getCastInstrCost() does.
602
8.80k
    if (Ty->isVectorTy()) {
603
5.56k
      unsigned Num = Ty->getVectorNumElements();
604
5.56k
      unsigned Cost = static_cast<T *>(this)
605
5.56k
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
606
5.56k
      // Return the cost of multiple scalar invocation plus the cost of
607
5.56k
      // inserting and extracting the values.
608
5.56k
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
609
5.56k
    }
610
3.23k
611
3.23k
    // We don't know anything about this scalar instruction.
612
3.23k
    return OpCost;
613
3.23k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getArithmeticInstrCost(unsigned int, llvm::Type*, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueProperties, llvm::TargetTransformInfo::OperandValueProperties, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
574
412k
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
575
412k
    // Check if any of the operands are vector operands.
576
412k
    const TargetLoweringBase *TLI = getTLI();
577
412k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
578
412k
    assert(ISD && "Invalid opcode");
579
412k
580
412k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
581
412k
582
412k
    bool IsFloat = Ty->isFPOrFPVectorTy();
583
412k
    // Assume that floating point arithmetic operations cost twice as much as
584
412k
    // integer operations.
585
412k
    unsigned OpCost = (IsFloat ? 
2262k
:
1150k
);
586
412k
587
412k
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
588
361k
      // The operation is legal. Assume it costs 1.
589
361k
      // TODO: Once we have extract/insert subvector cost we need to use them.
590
361k
      return LT.first * OpCost;
591
361k
    }
592
51.3k
593
51.3k
    if (!TLI->isOperationExpand(ISD, LT.second)) {
594
45.7k
      // If the operation is custom lowered, then assume that the code is twice
595
45.7k
      // as expensive.
596
45.7k
      return LT.first * 2 * OpCost;
597
45.7k
    }
598
5.59k
599
5.59k
    // Else, assume that we need to scalarize this op.
600
5.59k
    // TODO: If one of the types get legalized by splitting, handle this
601
5.59k
    // similarly to what getCastInstrCost() does.
602
5.59k
    if (Ty->isVectorTy()) {
603
4.76k
      unsigned Num = Ty->getVectorNumElements();
604
4.76k
      unsigned Cost = static_cast<T *>(this)
605
4.76k
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
606
4.76k
      // Return the cost of multiple scalar invocation plus the cost of
607
4.76k
      // inserting and extracting the values.
608
4.76k
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
609
4.76k
    }
610
826
611
826
    // We don't know anything about this scalar instruction.
612
826
    return OpCost;
613
826
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getArithmeticInstrCost(unsigned int, llvm::Type*, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueProperties, llvm::TargetTransformInfo::OperandValueProperties, llvm::ArrayRef<llvm::Value const*>)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getArithmeticInstrCost(unsigned int, llvm::Type*, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueProperties, llvm::TargetTransformInfo::OperandValueProperties, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
574
34
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
575
34
    // Check if any of the operands are vector operands.
576
34
    const TargetLoweringBase *TLI = getTLI();
577
34
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
578
34
    assert(ISD && "Invalid opcode");
579
34
580
34
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
581
34
582
34
    bool IsFloat = Ty->isFPOrFPVectorTy();
583
34
    // Assume that floating point arithmetic operations cost twice as much as
584
34
    // integer operations.
585
34
    unsigned OpCost = (IsFloat ? 
227
:
17
);
586
34
587
34
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
588
1
      // The operation is legal. Assume it costs 1.
589
1
      // TODO: Once we have extract/insert subvector cost we need to use them.
590
1
      return LT.first * OpCost;
591
1
    }
592
33
593
33
    if (!TLI->isOperationExpand(ISD, LT.second)) {
594
1
      // If the operation is custom lowered, then assume that the code is twice
595
1
      // as expensive.
596
1
      return LT.first * 2 * OpCost;
597
1
    }
598
32
599
32
    // Else, assume that we need to scalarize this op.
600
32
    // TODO: If one of the types get legalized by splitting, handle this
601
32
    // similarly to what getCastInstrCost() does.
602
32
    if (Ty->isVectorTy()) {
603
32
      unsigned Num = Ty->getVectorNumElements();
604
32
      unsigned Cost = static_cast<T *>(this)
605
32
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
606
32
      // Return the cost of multiple scalar invocation plus the cost of
607
32
      // inserting and extracting the values.
608
32
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
609
32
    }
610
0
611
0
    // We don't know anything about this scalar instruction.
612
0
    return OpCost;
613
0
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getArithmeticInstrCost(unsigned int, llvm::Type*, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueProperties, llvm::TargetTransformInfo::OperandValueProperties, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
574
14.6k
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
575
14.6k
    // Check if any of the operands are vector operands.
576
14.6k
    const TargetLoweringBase *TLI = getTLI();
577
14.6k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
578
14.6k
    assert(ISD && "Invalid opcode");
579
14.6k
580
14.6k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
581
14.6k
582
14.6k
    bool IsFloat = Ty->isFPOrFPVectorTy();
583
14.6k
    // Assume that floating point arithmetic operations cost twice as much as
584
14.6k
    // integer operations.
585
14.6k
    unsigned OpCost = (IsFloat ? 
22.93k
:
111.6k
);
586
14.6k
587
14.6k
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
588
12.9k
      // The operation is legal. Assume it costs 1.
589
12.9k
      // TODO: Once we have extract/insert subvector cost we need to use them.
590
12.9k
      return LT.first * OpCost;
591
12.9k
    }
592
1.72k
593
1.72k
    if (!TLI->isOperationExpand(ISD, LT.second)) {
594
1.01k
      // If the operation is custom lowered, then assume that the code is twice
595
1.01k
      // as expensive.
596
1.01k
      return LT.first * 2 * OpCost;
597
1.01k
    }
598
712
599
712
    // Else, assume that we need to scalarize this op.
600
712
    // TODO: If one of the types get legalized by splitting, handle this
601
712
    // similarly to what getCastInstrCost() does.
602
712
    if (Ty->isVectorTy()) {
603
694
      unsigned Num = Ty->getVectorNumElements();
604
694
      unsigned Cost = static_cast<T *>(this)
605
694
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
606
694
      // Return the cost of multiple scalar invocation plus the cost of
607
694
      // inserting and extracting the values.
608
694
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
609
694
    }
610
18
611
18
    // We don't know anything about this scalar instruction.
612
18
    return OpCost;
613
18
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getArithmeticInstrCost(unsigned int, llvm::Type*, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueProperties, llvm::TargetTransformInfo::OperandValueProperties, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
574
42
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
575
42
    // Check if any of the operands are vector operands.
576
42
    const TargetLoweringBase *TLI = getTLI();
577
42
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
578
42
    assert(ISD && "Invalid opcode");
579
42
580
42
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
581
42
582
42
    bool IsFloat = Ty->isFPOrFPVectorTy();
583
42
    // Assume that floating point arithmetic operations cost twice as much as
584
42
    // integer operations.
585
42
    unsigned OpCost = (IsFloat ? 
20
: 1);
586
42
587
42
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
588
42
      // The operation is legal. Assume it costs 1.
589
42
      // TODO: Once we have extract/insert subvector cost we need to use them.
590
42
      return LT.first * OpCost;
591
42
    }
592
0
593
0
    if (!TLI->isOperationExpand(ISD, LT.second)) {
594
0
      // If the operation is custom lowered, then assume that the code is twice
595
0
      // as expensive.
596
0
      return LT.first * 2 * OpCost;
597
0
    }
598
0
599
0
    // Else, assume that we need to scalarize this op.
600
0
    // TODO: If one of the types get legalized by splitting, handle this
601
0
    // similarly to what getCastInstrCost() does.
602
0
    if (Ty->isVectorTy()) {
603
0
      unsigned Num = Ty->getVectorNumElements();
604
0
      unsigned Cost = static_cast<T *>(this)
605
0
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
606
0
      // Return the cost of multiple scalar invocation plus the cost of
607
0
      // inserting and extracting the values.
608
0
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
609
0
    }
610
0
611
0
    // We don't know anything about this scalar instruction.
612
0
    return OpCost;
613
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getArithmeticInstrCost(unsigned int, llvm::Type*, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueProperties, llvm::TargetTransformInfo::OperandValueProperties, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getArithmeticInstrCost(unsigned int, llvm::Type*, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueProperties, llvm::TargetTransformInfo::OperandValueProperties, llvm::ArrayRef<llvm::Value const*>)
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getArithmeticInstrCost(unsigned int, llvm::Type*, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueProperties, llvm::TargetTransformInfo::OperandValueProperties, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
574
13
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
575
13
    // Check if any of the operands are vector operands.
576
13
    const TargetLoweringBase *TLI = getTLI();
577
13
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
578
13
    assert(ISD && "Invalid opcode");
579
13
580
13
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
581
13
582
13
    bool IsFloat = Ty->isFPOrFPVectorTy();
583
13
    // Assume that floating point arithmetic operations cost twice as much as
584
13
    // integer operations.
585
13
    unsigned OpCost = (IsFloat ? 
210
:
13
);
586
13
587
13
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
588
11
      // The operation is legal. Assume it costs 1.
589
11
      // TODO: Once we have extract/insert subvector cost we need to use them.
590
11
      return LT.first * OpCost;
591
11
    }
592
2
593
2
    if (!TLI->isOperationExpand(ISD, LT.second)) {
594
0
      // If the operation is custom lowered, then assume that the code is twice
595
0
      // as expensive.
596
0
      return LT.first * 2 * OpCost;
597
0
    }
598
2
599
2
    // Else, assume that we need to scalarize this op.
600
2
    // TODO: If one of the types get legalized by splitting, handle this
601
2
    // similarly to what getCastInstrCost() does.
602
2
    if (Ty->isVectorTy()) {
603
2
      unsigned Num = Ty->getVectorNumElements();
604
2
      unsigned Cost = static_cast<T *>(this)
605
2
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
606
2
      // Return the cost of multiple scalar invocation plus the cost of
607
2
      // inserting and extracting the values.
608
2
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
609
2
    }
610
0
611
0
    // We don't know anything about this scalar instruction.
612
0
    return OpCost;
613
0
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getArithmeticInstrCost(unsigned int, llvm::Type*, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueProperties, llvm::TargetTransformInfo::OperandValueProperties, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
574
106
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
575
106
    // Check if any of the operands are vector operands.
576
106
    const TargetLoweringBase *TLI = getTLI();
577
106
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
578
106
    assert(ISD && "Invalid opcode");
579
106
580
106
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
581
106
582
106
    bool IsFloat = Ty->isFPOrFPVectorTy();
583
106
    // Assume that floating point arithmetic operations cost twice as much as
584
106
    // integer operations.
585
106
    unsigned OpCost = (IsFloat ? 
258
:
148
);
586
106
587
106
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
588
106
      // The operation is legal. Assume it costs 1.
589
106
      // TODO: Once we have extract/insert subvector cost we need to use them.
590
106
      return LT.first * OpCost;
591
106
    }
592
0
593
0
    if (!TLI->isOperationExpand(ISD, LT.second)) {
594
0
      // If the operation is custom lowered, then assume that the code is twice
595
0
      // as expensive.
596
0
      return LT.first * 2 * OpCost;
597
0
    }
598
0
599
0
    // Else, assume that we need to scalarize this op.
600
0
    // TODO: If one of the types get legalized by splitting, handle this
601
0
    // similarly to what getCastInstrCost() does.
602
0
    if (Ty->isVectorTy()) {
603
0
      unsigned Num = Ty->getVectorNumElements();
604
0
      unsigned Cost = static_cast<T *>(this)
605
0
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
606
0
      // Return the cost of multiple scalar invocation plus the cost of
607
0
      // inserting and extracting the values.
608
0
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
609
0
    }
610
0
611
0
    // We don't know anything about this scalar instruction.
612
0
    return OpCost;
613
0
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getArithmeticInstrCost(unsigned int, llvm::Type*, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueProperties, llvm::TargetTransformInfo::OperandValueProperties, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
574
323
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
575
323
    // Check if any of the operands are vector operands.
576
323
    const TargetLoweringBase *TLI = getTLI();
577
323
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
578
323
    assert(ISD && "Invalid opcode");
579
323
580
323
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
581
323
582
323
    bool IsFloat = Ty->isFPOrFPVectorTy();
583
323
    // Assume that floating point arithmetic operations cost twice as much as
584
323
    // integer operations.
585
323
    unsigned OpCost = (IsFloat ? 
20
: 1);
586
323
587
323
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
588
303
      // The operation is legal. Assume it costs 1.
589
303
      // TODO: Once we have extract/insert subvector cost we need to use them.
590
303
      return LT.first * OpCost;
591
303
    }
592
20
593
20
    if (!TLI->isOperationExpand(ISD, LT.second)) {
594
0
      // If the operation is custom lowered, then assume that the code is twice
595
0
      // as expensive.
596
0
      return LT.first * 2 * OpCost;
597
0
    }
598
20
599
20
    // Else, assume that we need to scalarize this op.
600
20
    // TODO: If one of the types get legalized by splitting, handle this
601
20
    // similarly to what getCastInstrCost() does.
602
20
    if (Ty->isVectorTy()) {
603
20
      unsigned Num = Ty->getVectorNumElements();
604
20
      unsigned Cost = static_cast<T *>(this)
605
20
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
606
20
      // Return the cost of multiple scalar invocation plus the cost of
607
20
      // inserting and extracting the values.
608
20
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
609
20
    }
610
0
611
0
    // We don't know anything about this scalar instruction.
612
0
    return OpCost;
613
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getArithmeticInstrCost(unsigned int, llvm::Type*, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueProperties, llvm::TargetTransformInfo::OperandValueProperties, llvm::ArrayRef<llvm::Value const*>)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getArithmeticInstrCost(unsigned int, llvm::Type*, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueProperties, llvm::TargetTransformInfo::OperandValueProperties, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
574
80.9k
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
575
80.9k
    // Check if any of the operands are vector operands.
576
80.9k
    const TargetLoweringBase *TLI = getTLI();
577
80.9k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
578
80.9k
    assert(ISD && "Invalid opcode");
579
80.9k
580
80.9k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
581
80.9k
582
80.9k
    bool IsFloat = Ty->isFPOrFPVectorTy();
583
80.9k
    // Assume that floating point arithmetic operations cost twice as much as
584
80.9k
    // integer operations.
585
80.9k
    unsigned OpCost = (IsFloat ? 
21.74k
:
179.2k
);
586
80.9k
587
80.9k
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
588
78.5k
      // The operation is legal. Assume it costs 1.
589
78.5k
      // TODO: Once we have extract/insert subvector cost we need to use them.
590
78.5k
      return LT.first * OpCost;
591
78.5k
    }
592
2.44k
593
2.44k
    if (!TLI->isOperationExpand(ISD, LT.second)) {
594
0
      // If the operation is custom lowered, then assume that the code is twice
595
0
      // as expensive.
596
0
      return LT.first * 2 * OpCost;
597
0
    }
598
2.44k
599
2.44k
    // Else, assume that we need to scalarize this op.
600
2.44k
    // TODO: If one of the types get legalized by splitting, handle this
601
2.44k
    // similarly to what getCastInstrCost() does.
602
2.44k
    if (Ty->isVectorTy()) {
603
54
      unsigned Num = Ty->getVectorNumElements();
604
54
      unsigned Cost = static_cast<T *>(this)
605
54
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
606
54
      // Return the cost of multiple scalar invocation plus the cost of
607
54
      // inserting and extracting the values.
608
54
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
609
54
    }
610
2.39k
611
2.39k
    // We don't know anything about this scalar instruction.
612
2.39k
    return OpCost;
613
2.39k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getArithmeticInstrCost(unsigned int, llvm::Type*, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueProperties, llvm::TargetTransformInfo::OperandValueProperties, llvm::ArrayRef<llvm::Value const*>)
614
615
  unsigned getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index,
616
7.95k
                          Type *SubTp) {
617
7.95k
    switch (Kind) {
618
7.95k
    case TTI::SK_Broadcast:
619
47
      return getBroadcastShuffleOverhead(Tp);
620
7.95k
    case TTI::SK_Select:
621
3.47k
    case TTI::SK_Reverse:
622
3.47k
    case TTI::SK_Transpose:
623
3.47k
    case TTI::SK_PermuteSingleSrc:
624
3.47k
    case TTI::SK_PermuteTwoSrc:
625
3.47k
      return getPermuteShuffleOverhead(Tp);
626
4.41k
    case TTI::SK_ExtractSubvector:
627
4.41k
      return getExtractSubvectorOverhead(Tp, Index, SubTp);
628
3.47k
    case TTI::SK_InsertSubvector:
629
17
      return getInsertSubvectorOverhead(Tp, Index, SubTp);
630
0
    }
631
0
    llvm_unreachable("Unknown TTI::ShuffleKind");
632
0
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
Line
Count
Source
616
7.38k
                          Type *SubTp) {
617
7.38k
    switch (Kind) {
618
7.38k
    case TTI::SK_Broadcast:
619
2
      return getBroadcastShuffleOverhead(Tp);
620
7.38k
    case TTI::SK_Select:
621
3.00k
    case TTI::SK_Reverse:
622
3.00k
    case TTI::SK_Transpose:
623
3.00k
    case TTI::SK_PermuteSingleSrc:
624
3.00k
    case TTI::SK_PermuteTwoSrc:
625
3.00k
      return getPermuteShuffleOverhead(Tp);
626
4.37k
    case TTI::SK_ExtractSubvector:
627
4.37k
      return getExtractSubvectorOverhead(Tp, Index, SubTp);
628
3.00k
    case TTI::SK_InsertSubvector:
629
0
      return getInsertSubvectorOverhead(Tp, Index, SubTp);
630
0
    }
631
0
    llvm_unreachable("Unknown TTI::ShuffleKind");
632
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
Line
Count
Source
616
81
                          Type *SubTp) {
617
81
    switch (Kind) {
618
81
    case TTI::SK_Broadcast:
619
2
      return getBroadcastShuffleOverhead(Tp);
620
81
    case TTI::SK_Select:
621
54
    case TTI::SK_Reverse:
622
54
    case TTI::SK_Transpose:
623
54
    case TTI::SK_PermuteSingleSrc:
624
54
    case TTI::SK_PermuteTwoSrc:
625
54
      return getPermuteShuffleOverhead(Tp);
626
54
    case TTI::SK_ExtractSubvector:
627
25
      return getExtractSubvectorOverhead(Tp, Index, SubTp);
628
54
    case TTI::SK_InsertSubvector:
629
0
      return getInsertSubvectorOverhead(Tp, Index, SubTp);
630
0
    }
631
0
    llvm_unreachable("Unknown TTI::ShuffleKind");
632
0
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
Line
Count
Source
616
96
                          Type *SubTp) {
617
96
    switch (Kind) {
618
96
    case TTI::SK_Broadcast:
619
0
      return getBroadcastShuffleOverhead(Tp);
620
96
    case TTI::SK_Select:
621
96
    case TTI::SK_Reverse:
622
96
    case TTI::SK_Transpose:
623
96
    case TTI::SK_PermuteSingleSrc:
624
96
    case TTI::SK_PermuteTwoSrc:
625
96
      return getPermuteShuffleOverhead(Tp);
626
96
    case TTI::SK_ExtractSubvector:
627
0
      return getExtractSubvectorOverhead(Tp, Index, SubTp);
628
96
    case TTI::SK_InsertSubvector:
629
0
      return getInsertSubvectorOverhead(Tp, Index, SubTp);
630
0
    }
631
0
    llvm_unreachable("Unknown TTI::ShuffleKind");
632
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
Line
Count
Source
616
394
                          Type *SubTp) {
617
394
    switch (Kind) {
618
394
    case TTI::SK_Broadcast:
619
43
      return getBroadcastShuffleOverhead(Tp);
620
394
    case TTI::SK_Select:
621
322
    case TTI::SK_Reverse:
622
322
    case TTI::SK_Transpose:
623
322
    case TTI::SK_PermuteSingleSrc:
624
322
    case TTI::SK_PermuteTwoSrc:
625
322
      return getPermuteShuffleOverhead(Tp);
626
322
    case TTI::SK_ExtractSubvector:
627
12
      return getExtractSubvectorOverhead(Tp, Index, SubTp);
628
322
    case TTI::SK_InsertSubvector:
629
17
      return getInsertSubvectorOverhead(Tp, Index, SubTp);
630
0
    }
631
0
    llvm_unreachable("Unknown TTI::ShuffleKind");
632
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
633
634
  unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
635
114k
                            const Instruction *I = nullptr) {
636
114k
    const TargetLoweringBase *TLI = getTLI();
637
114k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
638
114k
    assert(ISD && "Invalid opcode");
639
114k
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
640
114k
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
641
114k
642
114k
    // Check for NOOP conversions.
643
114k
    if (SrcLT.first == DstLT.first &&
644
114k
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()110k
) {
645
39.8k
646
39.8k
      // Bitcast between types that are legalized to the same type are free.
647
39.8k
      if (Opcode == Instruction::BitCast || 
Opcode == Instruction::Trunc28.1k
)
648
13.7k
        return 0;
649
100k
    }
650
100k
651
100k
    if (Opcode == Instruction::Trunc &&
652
100k
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)42.6k
)
653
24.0k
      return 0;
654
76.7k
655
76.7k
    if (Opcode == Instruction::ZExt &&
656
76.7k
        
TLI->isZExtFree(SrcLT.second, DstLT.second)18.2k
)
657
4.15k
      return 0;
658
72.5k
659
72.5k
    if (Opcode == Instruction::AddrSpaceCast &&
660
72.5k
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
661
12
                                 Dst->getPointerAddressSpace()))
662
3
      return 0;
663
72.5k
664
72.5k
    // If this is a zext/sext of a load, return 0 if the corresponding
665
72.5k
    // extending load exists on target.
666
72.5k
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt58.4k
) &&
667
72.5k
        
I28.1k
&&
isa<LoadInst>(I->getOperand(0))1.79k
) {
668
810
        EVT ExtVT = EVT::getEVT(Dst);
669
810
        EVT LoadVT = EVT::getEVT(Src);
670
810
        unsigned LType =
671
810
          ((Opcode == Instruction::ZExt) ? 
ISD::ZEXTLOAD535
:
ISD::SEXTLOAD275
);
672
810
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
673
578
          return 0;
674
72.0k
    }
675
72.0k
676
72.0k
    // If the cast is marked as legal (or promote) then assume low cost.
677
72.0k
    if (SrcLT.first == DstLT.first &&
678
72.0k
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)67.5k
)
679
64.3k
      return 1;
680
7.64k
681
7.64k
    // Handle scalar conversions.
682
7.64k
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()2.75k
) {
683
2.75k
      // Scalar bitcasts are usually free.
684
2.75k
      if (Opcode == Instruction::BitCast)
685
108
        return 0;
686
2.64k
687
2.64k
      // Just check the op cost. If the operation is legal then assume it costs
688
2.64k
      // 1.
689
2.64k
      if (!TLI->isOperationExpand(ISD, DstLT.second))
690
2.40k
        return 1;
691
235
692
235
      // Assume that illegal scalar instruction are expensive.
693
235
      return 4;
694
235
    }
695
4.89k
696
4.89k
    // Check vector-to-vector casts.
697
4.89k
    if (Dst->isVectorTy() && Src->isVectorTy()) {
698
4.89k
      // If the cast is between same-sized registers, then the check is simple.
699
4.89k
      if (SrcLT.first == DstLT.first &&
700
4.89k
          
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()1.50k
) {
701
1.28k
702
1.28k
        // Assume that Zext is done using AND.
703
1.28k
        if (Opcode == Instruction::ZExt)
704
638
          return 1;
705
649
706
649
        // Assume that sext is done using SHL and SRA.
707
649
        if (Opcode == Instruction::SExt)
708
66
          return 2;
709
583
710
583
        // Just check the op cost. If the operation is legal then assume it
711
583
        // costs
712
583
        // 1 and multiply by the type-legalization overhead.
713
583
        if (!TLI->isOperationExpand(ISD, DstLT.second))
714
12
          return SrcLT.first * 1;
715
4.17k
      }
716
4.17k
717
4.17k
      // If we are legalizing by splitting, query the concrete TTI for the cost
718
4.17k
      // of casting the original vector twice. We also need to factor in the
719
4.17k
      // cost of the split itself. Count that as 1, to be consistent with
720
4.17k
      // TLI->getTypeLegalizationCost().
721
4.17k
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
722
4.17k
           TargetLowering::TypeSplitVector) ||
723
4.17k
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
724
3.04k
           TargetLowering::TypeSplitVector)) {
725
3.04k
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
726
3.04k
                                         Dst->getVectorNumElements() / 2);
727
3.04k
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
728
3.04k
                                         Src->getVectorNumElements() / 2);
729
3.04k
        T *TTI = static_cast<T *>(this);
730
3.04k
        return TTI->getVectorSplitCost() +
731
3.04k
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
732
3.04k
      }
733
1.13k
734
1.13k
      // In other cases where the source or destination are illegal, assume
735
1.13k
      // the operation will get scalarized.
736
1.13k
      unsigned Num = Dst->getVectorNumElements();
737
1.13k
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
738
1.13k
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
739
1.13k
740
1.13k
      // Return the cost of multiple scalar invocation plus the cost of
741
1.13k
      // inserting and extracting the values.
742
1.13k
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
743
1.13k
    }
744
0
745
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
746
0
    // This
747
0
    // is where we handle bitcast between vectors and scalars. We need to assume
748
0
    //  that the conversion is scalarized in one way or another.
749
0
    if (Opcode == Instruction::BitCast)
750
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
751
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
752
0
                                : 0) +
753
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
754
0
                                : 0);
755
0
756
0
    llvm_unreachable("Unhandled cast");
757
0
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
635
103k
                            const Instruction *I = nullptr) {
636
103k
    const TargetLoweringBase *TLI = getTLI();
637
103k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
638
103k
    assert(ISD && "Invalid opcode");
639
103k
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
640
103k
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
641
103k
642
103k
    // Check for NOOP conversions.
643
103k
    if (SrcLT.first == DstLT.first &&
644
103k
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()101k
) {
645
34.3k
646
34.3k
      // Bitcast between types that are legalized to the same type are free.
647
34.3k
      if (Opcode == Instruction::BitCast || 
Opcode == Instruction::Trunc24.0k
)
648
12.0k
        return 0;
649
91.1k
    }
650
91.1k
651
91.1k
    if (Opcode == Instruction::Trunc &&
652
91.1k
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)40.3k
)
653
23.4k
      return 0;
654
67.7k
655
67.7k
    if (Opcode == Instruction::ZExt &&
656
67.7k
        
TLI->isZExtFree(SrcLT.second, DstLT.second)16.3k
)
657
3.92k
      return 0;
658
63.7k
659
63.7k
    if (Opcode == Instruction::AddrSpaceCast &&
660
63.7k
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
661
0
                                 Dst->getPointerAddressSpace()))
662
0
      return 0;
663
63.7k
664
63.7k
    // If this is a zext/sext of a load, return 0 if the corresponding
665
63.7k
    // extending load exists on target.
666
63.7k
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt51.4k
) &&
667
63.7k
        
I25.9k
&&
isa<LoadInst>(I->getOperand(0))0
) {
668
0
        EVT ExtVT = EVT::getEVT(Dst);
669
0
        EVT LoadVT = EVT::getEVT(Src);
670
0
        unsigned LType =
671
0
          ((Opcode == Instruction::ZExt) ? ISD::ZEXTLOAD : ISD::SEXTLOAD);
672
0
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
673
0
          return 0;
674
63.7k
    }
675
63.7k
676
63.7k
    // If the cast is marked as legal (or promote) then assume low cost.
677
63.7k
    if (SrcLT.first == DstLT.first &&
678
63.7k
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)61.8k
)
679
60.7k
      return 1;
680
3.05k
681
3.05k
    // Handle scalar conversions.
682
3.05k
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()1.17k
) {
683
1.17k
      // Scalar bitcasts are usually free.
684
1.17k
      if (Opcode == Instruction::BitCast)
685
0
        return 0;
686
1.17k
687
1.17k
      // Just check the op cost. If the operation is legal then assume it costs
688
1.17k
      // 1.
689
1.17k
      if (!TLI->isOperationExpand(ISD, DstLT.second))
690
1.17k
        return 1;
691
0
692
0
      // Assume that illegal scalar instruction are expensive.
693
0
      return 4;
694
0
    }
695
1.88k
696
1.88k
    // Check vector-to-vector casts.
697
1.88k
    if (Dst->isVectorTy() && Src->isVectorTy()) {
698
1.88k
      // If the cast is between same-sized registers, then the check is simple.
699
1.88k
      if (SrcLT.first == DstLT.first &&
700
1.88k
          
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()0
) {
701
0
702
0
        // Assume that Zext is done using AND.
703
0
        if (Opcode == Instruction::ZExt)
704
0
          return 1;
705
0
706
0
        // Assume that sext is done using SHL and SRA.
707
0
        if (Opcode == Instruction::SExt)
708
0
          return 2;
709
0
710
0
        // Just check the op cost. If the operation is legal then assume it
711
0
        // costs
712
0
        // 1 and multiply by the type-legalization overhead.
713
0
        if (!TLI->isOperationExpand(ISD, DstLT.second))
714
0
          return SrcLT.first * 1;
715
1.88k
      }
716
1.88k
717
1.88k
      // If we are legalizing by splitting, query the concrete TTI for the cost
718
1.88k
      // of casting the original vector twice. We also need to factor in the
719
1.88k
      // cost of the split itself. Count that as 1, to be consistent with
720
1.88k
      // TLI->getTypeLegalizationCost().
721
1.88k
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
722
1.88k
           TargetLowering::TypeSplitVector) ||
723
1.88k
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
724
1.84k
           TargetLowering::TypeSplitVector)) {
725
1.84k
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
726
1.84k
                                         Dst->getVectorNumElements() / 2);
727
1.84k
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
728
1.84k
                                         Src->getVectorNumElements() / 2);
729
1.84k
        T *TTI = static_cast<T *>(this);
730
1.84k
        return TTI->getVectorSplitCost() +
731
1.84k
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
732
1.84k
      }
733
36
734
36
      // In other cases where the source or destination are illegal, assume
735
36
      // the operation will get scalarized.
736
36
      unsigned Num = Dst->getVectorNumElements();
737
36
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
738
36
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
739
36
740
36
      // Return the cost of multiple scalar invocation plus the cost of
741
36
      // inserting and extracting the values.
742
36
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
743
36
    }
744
0
745
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
746
0
    // This
747
0
    // is where we handle bitcast between vectors and scalars. We need to assume
748
0
    //  that the conversion is scalarized in one way or another.
749
0
    if (Opcode == Instruction::BitCast)
750
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
751
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
752
0
                                : 0) +
753
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
754
0
                                : 0);
755
0
756
0
    llvm_unreachable("Unhandled cast");
757
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
635
16
                            const Instruction *I = nullptr) {
636
16
    const TargetLoweringBase *TLI = getTLI();
637
16
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
638
16
    assert(ISD && "Invalid opcode");
639
16
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
640
16
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
641
16
642
16
    // Check for NOOP conversions.
643
16
    if (SrcLT.first == DstLT.first &&
644
16
        SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()) {
645
12
646
12
      // Bitcast between types that are legalized to the same type are free.
647
12
      if (Opcode == Instruction::BitCast || Opcode == Instruction::Trunc)
648
0
        return 0;
649
16
    }
650
16
651
16
    if (Opcode == Instruction::Trunc &&
652
16
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)2
)
653
2
      return 0;
654
14
655
14
    if (Opcode == Instruction::ZExt &&
656
14
        
TLI->isZExtFree(SrcLT.second, DstLT.second)2
)
657
2
      return 0;
658
12
659
12
    if (Opcode == Instruction::AddrSpaceCast &&
660
12
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
661
12
                                 Dst->getPointerAddressSpace()))
662
3
      return 0;
663
9
664
9
    // If this is a zext/sext of a load, return 0 if the corresponding
665
9
    // extending load exists on target.
666
9
    if ((Opcode == Instruction::ZExt || Opcode == Instruction::SExt) &&
667
9
        
I0
&&
isa<LoadInst>(I->getOperand(0))0
) {
668
0
        EVT ExtVT = EVT::getEVT(Dst);
669
0
        EVT LoadVT = EVT::getEVT(Src);
670
0
        unsigned LType =
671
0
          ((Opcode == Instruction::ZExt) ? ISD::ZEXTLOAD : ISD::SEXTLOAD);
672
0
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
673
0
          return 0;
674
9
    }
675
9
676
9
    // If the cast is marked as legal (or promote) then assume low cost.
677
9
    if (SrcLT.first == DstLT.first &&
678
9
        TLI->isOperationLegalOrPromote(ISD, DstLT.second))
679
0
      return 1;
680
9
681
9
    // Handle scalar conversions.
682
9
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()3
) {
683
3
      // Scalar bitcasts are usually free.
684
3
      if (Opcode == Instruction::BitCast)
685
0
        return 0;
686
3
687
3
      // Just check the op cost. If the operation is legal then assume it costs
688
3
      // 1.
689
3
      if (!TLI->isOperationExpand(ISD, DstLT.second))
690
3
        return 1;
691
0
692
0
      // Assume that illegal scalar instruction are expensive.
693
0
      return 4;
694
0
    }
695
6
696
6
    // Check vector-to-vector casts.
697
6
    if (Dst->isVectorTy() && Src->isVectorTy()) {
698
6
      // If the cast is between same-sized registers, then the check is simple.
699
6
      if (SrcLT.first == DstLT.first &&
700
6
          SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()) {
701
6
702
6
        // Assume that Zext is done using AND.
703
6
        if (Opcode == Instruction::ZExt)
704
0
          return 1;
705
6
706
6
        // Assume that sext is done using SHL and SRA.
707
6
        if (Opcode == Instruction::SExt)
708
0
          return 2;
709
6
710
6
        // Just check the op cost. If the operation is legal then assume it
711
6
        // costs
712
6
        // 1 and multiply by the type-legalization overhead.
713
6
        if (!TLI->isOperationExpand(ISD, DstLT.second))
714
0
          return SrcLT.first * 1;
715
6
      }
716
6
717
6
      // If we are legalizing by splitting, query the concrete TTI for the cost
718
6
      // of casting the original vector twice. We also need to factor in the
719
6
      // cost of the split itself. Count that as 1, to be consistent with
720
6
      // TLI->getTypeLegalizationCost().
721
6
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
722
6
           TargetLowering::TypeSplitVector) ||
723
6
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
724
4
           TargetLowering::TypeSplitVector)) {
725
4
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
726
4
                                         Dst->getVectorNumElements() / 2);
727
4
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
728
4
                                         Src->getVectorNumElements() / 2);
729
4
        T *TTI = static_cast<T *>(this);
730
4
        return TTI->getVectorSplitCost() +
731
4
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
732
4
      }
733
2
734
2
      // In other cases where the source or destination are illegal, assume
735
2
      // the operation will get scalarized.
736
2
      unsigned Num = Dst->getVectorNumElements();
737
2
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
738
2
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
739
2
740
2
      // Return the cost of multiple scalar invocation plus the cost of
741
2
      // inserting and extracting the values.
742
2
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
743
2
    }
744
0
745
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
746
0
    // This
747
0
    // is where we handle bitcast between vectors and scalars. We need to assume
748
0
    //  that the conversion is scalarized in one way or another.
749
0
    if (Opcode == Instruction::BitCast)
750
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
751
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
752
0
                                : 0) +
753
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
754
0
                                : 0);
755
0
756
0
    llvm_unreachable("Unhandled cast");
757
0
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
635
1.21k
                            const Instruction *I = nullptr) {
636
1.21k
    const TargetLoweringBase *TLI = getTLI();
637
1.21k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
638
1.21k
    assert(ISD && "Invalid opcode");
639
1.21k
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
640
1.21k
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
641
1.21k
642
1.21k
    // Check for NOOP conversions.
643
1.21k
    if (SrcLT.first == DstLT.first &&
644
1.21k
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()856
) {
645
606
646
606
      // Bitcast between types that are legalized to the same type are free.
647
606
      if (Opcode == Instruction::BitCast || 
Opcode == Instruction::Trunc278
)
648
340
        return 0;
649
871
    }
650
871
651
871
    if (Opcode == Instruction::Trunc &&
652
871
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)168
)
653
0
      return 0;
654
871
655
871
    if (Opcode == Instruction::ZExt &&
656
871
        
TLI->isZExtFree(SrcLT.second, DstLT.second)240
)
657
0
      return 0;
658
871
659
871
    if (Opcode == Instruction::AddrSpaceCast &&
660
871
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
661
0
                                 Dst->getPointerAddressSpace()))
662
0
      return 0;
663
871
664
871
    // If this is a zext/sext of a load, return 0 if the corresponding
665
871
    // extending load exists on target.
666
871
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt631
) &&
667
871
        
I317
&&
isa<LoadInst>(I->getOperand(0))0
) {
668
0
        EVT ExtVT = EVT::getEVT(Dst);
669
0
        EVT LoadVT = EVT::getEVT(Src);
670
0
        unsigned LType =
671
0
          ((Opcode == Instruction::ZExt) ? ISD::ZEXTLOAD : ISD::SEXTLOAD);
672
0
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
673
0
          return 0;
674
871
    }
675
871
676
871
    // If the cast is marked as legal (or promote) then assume low cost.
677
871
    if (SrcLT.first == DstLT.first &&
678
871
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)516
)
679
372
      return 1;
680
499
681
499
    // Handle scalar conversions.
682
499
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()145
) {
683
145
      // Scalar bitcasts are usually free.
684
145
      if (Opcode == Instruction::BitCast)
685
82
        return 0;
686
63
687
63
      // Just check the op cost. If the operation is legal then assume it costs
688
63
      // 1.
689
63
      if (!TLI->isOperationExpand(ISD, DstLT.second))
690
63
        return 1;
691
0
692
0
      // Assume that illegal scalar instruction are expensive.
693
0
      return 4;
694
0
    }
695
354
696
354
    // Check vector-to-vector casts.
697
354
    if (Dst->isVectorTy() && Src->isVectorTy()) {
698
354
      // If the cast is between same-sized registers, then the check is simple.
699
354
      if (SrcLT.first == DstLT.first &&
700
354
          
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()144
) {
701
66
702
66
        // Assume that Zext is done using AND.
703
66
        if (Opcode == Instruction::ZExt)
704
0
          return 1;
705
66
706
66
        // Assume that sext is done using SHL and SRA.
707
66
        if (Opcode == Instruction::SExt)
708
0
          return 2;
709
66
710
66
        // Just check the op cost. If the operation is legal then assume it
711
66
        // costs
712
66
        // 1 and multiply by the type-legalization overhead.
713
66
        if (!TLI->isOperationExpand(ISD, DstLT.second))
714
12
          return SrcLT.first * 1;
715
342
      }
716
342
717
342
      // If we are legalizing by splitting, query the concrete TTI for the cost
718
342
      // of casting the original vector twice. We also need to factor in the
719
342
      // cost of the split itself. Count that as 1, to be consistent with
720
342
      // TLI->getTypeLegalizationCost().
721
342
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
722
342
           TargetLowering::TypeSplitVector) ||
723
342
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
724
228
           TargetLowering::TypeSplitVector)) {
725
228
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
726
228
                                         Dst->getVectorNumElements() / 2);
727
228
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
728
228
                                         Src->getVectorNumElements() / 2);
729
228
        T *TTI = static_cast<T *>(this);
730
228
        return TTI->getVectorSplitCost() +
731
228
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
732
228
      }
733
114
734
114
      // In other cases where the source or destination are illegal, assume
735
114
      // the operation will get scalarized.
736
114
      unsigned Num = Dst->getVectorNumElements();
737
114
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
738
114
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
739
114
740
114
      // Return the cost of multiple scalar invocation plus the cost of
741
114
      // inserting and extracting the values.
742
114
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
743
114
    }
744
0
745
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
746
0
    // This
747
0
    // is where we handle bitcast between vectors and scalars. We need to assume
748
0
    //  that the conversion is scalarized in one way or another.
749
0
    if (Opcode == Instruction::BitCast)
750
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
751
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
752
0
                                : 0) +
753
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
754
0
                                : 0);
755
0
756
0
    llvm_unreachable("Unhandled cast");
757
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
635
35
                            const Instruction *I = nullptr) {
636
35
    const TargetLoweringBase *TLI = getTLI();
637
35
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
638
35
    assert(ISD && "Invalid opcode");
639
35
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
640
35
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
641
35
642
35
    // Check for NOOP conversions.
643
35
    if (SrcLT.first == DstLT.first &&
644
35
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()34
) {
645
22
646
22
      // Bitcast between types that are legalized to the same type are free.
647
22
      if (Opcode == Instruction::BitCast || Opcode == Instruction::Trunc)
648
0
        return 0;
649
35
    }
650
35
651
35
    if (Opcode == Instruction::Trunc &&
652
35
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)8
)
653
8
      return 0;
654
27
655
27
    if (Opcode == Instruction::ZExt &&
656
27
        
TLI->isZExtFree(SrcLT.second, DstLT.second)12
)
657
0
      return 0;
658
27
659
27
    if (Opcode == Instruction::AddrSpaceCast &&
660
27
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
661
0
                                 Dst->getPointerAddressSpace()))
662
0
      return 0;
663
27
664
27
    // If this is a zext/sext of a load, return 0 if the corresponding
665
27
    // extending load exists on target.
666
27
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt15
) &&
667
27
        
I17
&&
isa<LoadInst>(I->getOperand(0))0
) {
668
0
        EVT ExtVT = EVT::getEVT(Dst);
669
0
        EVT LoadVT = EVT::getEVT(Src);
670
0
        unsigned LType =
671
0
          ((Opcode == Instruction::ZExt) ? ISD::ZEXTLOAD : ISD::SEXTLOAD);
672
0
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
673
0
          return 0;
674
27
    }
675
27
676
27
    // If the cast is marked as legal (or promote) then assume low cost.
677
27
    if (SrcLT.first == DstLT.first &&
678
27
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)26
)
679
26
      return 1;
680
1
681
1
    // Handle scalar conversions.
682
1
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()0
) {
683
0
      // Scalar bitcasts are usually free.
684
0
      if (Opcode == Instruction::BitCast)
685
0
        return 0;
686
0
687
0
      // Just check the op cost. If the operation is legal then assume it costs
688
0
      // 1.
689
0
      if (!TLI->isOperationExpand(ISD, DstLT.second))
690
0
        return 1;
691
0
692
0
      // Assume that illegal scalar instruction are expensive.
693
0
      return 4;
694
0
    }
695
1
696
1
    // Check vector-to-vector casts.
697
1
    if (Dst->isVectorTy() && Src->isVectorTy()) {
698
1
      // If the cast is between same-sized registers, then the check is simple.
699
1
      if (SrcLT.first == DstLT.first &&
700
1
          
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()0
) {
701
0
702
0
        // Assume that Zext is done using AND.
703
0
        if (Opcode == Instruction::ZExt)
704
0
          return 1;
705
0
706
0
        // Assume that sext is done using SHL and SRA.
707
0
        if (Opcode == Instruction::SExt)
708
0
          return 2;
709
0
710
0
        // Just check the op cost. If the operation is legal then assume it
711
0
        // costs
712
0
        // 1 and multiply by the type-legalization overhead.
713
0
        if (!TLI->isOperationExpand(ISD, DstLT.second))
714
0
          return SrcLT.first * 1;
715
1
      }
716
1
717
1
      // If we are legalizing by splitting, query the concrete TTI for the cost
718
1
      // of casting the original vector twice. We also need to factor in the
719
1
      // cost of the split itself. Count that as 1, to be consistent with
720
1
      // TLI->getTypeLegalizationCost().
721
1
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
722
1
           TargetLowering::TypeSplitVector) ||
723
1
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
724
1
           TargetLowering::TypeSplitVector)) {
725
1
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
726
1
                                         Dst->getVectorNumElements() / 2);
727
1
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
728
1
                                         Src->getVectorNumElements() / 2);
729
1
        T *TTI = static_cast<T *>(this);
730
1
        return TTI->getVectorSplitCost() +
731
1
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
732
1
      }
733
0
734
0
      // In other cases where the source or destination are illegal, assume
735
0
      // the operation will get scalarized.
736
0
      unsigned Num = Dst->getVectorNumElements();
737
0
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
738
0
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
739
0
740
0
      // Return the cost of multiple scalar invocation plus the cost of
741
0
      // inserting and extracting the values.
742
0
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
743
0
    }
744
0
745
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
746
0
    // This
747
0
    // is where we handle bitcast between vectors and scalars. We need to assume
748
0
    //  that the conversion is scalarized in one way or another.
749
0
    if (Opcode == Instruction::BitCast)
750
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
751
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
752
0
                                : 0) +
753
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
754
0
                                : 0);
755
0
756
0
    llvm_unreachable("Unhandled cast");
757
0
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
635
239
                            const Instruction *I = nullptr) {
636
239
    const TargetLoweringBase *TLI = getTLI();
637
239
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
638
239
    assert(ISD && "Invalid opcode");
639
239
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
640
239
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
641
239
642
239
    // Check for NOOP conversions.
643
239
    if (SrcLT.first == DstLT.first &&
644
239
        SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()) {
645
74
646
74
      // Bitcast between types that are legalized to the same type are free.
647
74
      if (Opcode == Instruction::BitCast || Opcode == Instruction::Trunc)
648
4
        return 0;
649
235
    }
650
235
651
235
    if (Opcode == Instruction::Trunc &&
652
235
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)41
)
653
41
      return 0;
654
194
655
194
    if (Opcode == Instruction::ZExt &&
656
194
        
TLI->isZExtFree(SrcLT.second, DstLT.second)20
)
657
0
      return 0;
658
194
659
194
    if (Opcode == Instruction::AddrSpaceCast &&
660
194
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
661
0
                                 Dst->getPointerAddressSpace()))
662
0
      return 0;
663
194
664
194
    // If this is a zext/sext of a load, return 0 if the corresponding
665
194
    // extending load exists on target.
666
194
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt174
) &&
667
194
        
I84
&&
isa<LoadInst>(I->getOperand(0))84
) {
668
72
        EVT ExtVT = EVT::getEVT(Dst);
669
72
        EVT LoadVT = EVT::getEVT(Src);
670
72
        unsigned LType =
671
72
          ((Opcode == Instruction::ZExt) ? 
ISD::ZEXTLOAD14
:
ISD::SEXTLOAD58
);
672
72
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
673
72
          return 0;
674
122
    }
675
122
676
122
    // If the cast is marked as legal (or promote) then assume low cost.
677
122
    if (SrcLT.first == DstLT.first &&
678
122
        TLI->isOperationLegalOrPromote(ISD, DstLT.second))
679
122
      return 1;
680
0
681
0
    // Handle scalar conversions.
682
0
    if (!Src->isVectorTy() && !Dst->isVectorTy()) {
683
0
      // Scalar bitcasts are usually free.
684
0
      if (Opcode == Instruction::BitCast)
685
0
        return 0;
686
0
687
0
      // Just check the op cost. If the operation is legal then assume it costs
688
0
      // 1.
689
0
      if (!TLI->isOperationExpand(ISD, DstLT.second))
690
0
        return 1;
691
0
692
0
      // Assume that illegal scalar instruction are expensive.
693
0
      return 4;
694
0
    }
695
0
696
0
    // Check vector-to-vector casts.
697
0
    if (Dst->isVectorTy() && Src->isVectorTy()) {
698
0
      // If the cast is between same-sized registers, then the check is simple.
699
0
      if (SrcLT.first == DstLT.first &&
700
0
          SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()) {
701
0
702
0
        // Assume that Zext is done using AND.
703
0
        if (Opcode == Instruction::ZExt)
704
0
          return 1;
705
0
706
0
        // Assume that sext is done using SHL and SRA.
707
0
        if (Opcode == Instruction::SExt)
708
0
          return 2;
709
0
710
0
        // Just check the op cost. If the operation is legal then assume it
711
0
        // costs
712
0
        // 1 and multiply by the type-legalization overhead.
713
0
        if (!TLI->isOperationExpand(ISD, DstLT.second))
714
0
          return SrcLT.first * 1;
715
0
      }
716
0
717
0
      // If we are legalizing by splitting, query the concrete TTI for the cost
718
0
      // of casting the original vector twice. We also need to factor in the
719
0
      // cost of the split itself. Count that as 1, to be consistent with
720
0
      // TLI->getTypeLegalizationCost().
721
0
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
722
0
           TargetLowering::TypeSplitVector) ||
723
0
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
724
0
           TargetLowering::TypeSplitVector)) {
725
0
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
726
0
                                         Dst->getVectorNumElements() / 2);
727
0
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
728
0
                                         Src->getVectorNumElements() / 2);
729
0
        T *TTI = static_cast<T *>(this);
730
0
        return TTI->getVectorSplitCost() +
731
0
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
732
0
      }
733
0
734
0
      // In other cases where the source or destination are illegal, assume
735
0
      // the operation will get scalarized.
736
0
      unsigned Num = Dst->getVectorNumElements();
737
0
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
738
0
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
739
0
740
0
      // Return the cost of multiple scalar invocation plus the cost of
741
0
      // inserting and extracting the values.
742
0
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
743
0
    }
744
0
745
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
746
0
    // This
747
0
    // is where we handle bitcast between vectors and scalars. We need to assume
748
0
    //  that the conversion is scalarized in one way or another.
749
0
    if (Opcode == Instruction::BitCast)
750
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
751
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
752
0
                                : 0) +
753
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
754
0
                                : 0);
755
0
756
0
    llvm_unreachable("Unhandled cast");
757
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
635
9.81k
                            const Instruction *I = nullptr) {
636
9.81k
    const TargetLoweringBase *TLI = getTLI();
637
9.81k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
638
9.81k
    assert(ISD && "Invalid opcode");
639
9.81k
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
640
9.81k
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
641
9.81k
642
9.81k
    // Check for NOOP conversions.
643
9.81k
    if (SrcLT.first == DstLT.first &&
644
9.81k
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()7.62k
) {
645
4.74k
646
4.74k
      // Bitcast between types that are legalized to the same type are free.
647
4.74k
      if (Opcode == Instruction::BitCast || 
Opcode == Instruction::Trunc3.79k
)
648
1.33k
        return 0;
649
8.48k
    }
650
8.48k
651
8.48k
    if (Opcode == Instruction::Trunc &&
652
8.48k
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)2.14k
)
653
542
      return 0;
654
7.93k
655
7.93k
    if (Opcode == Instruction::ZExt &&
656
7.93k
        
TLI->isZExtFree(SrcLT.second, DstLT.second)1.72k
)
657
226
      return 0;
658
7.71k
659
7.71k
    if (Opcode == Instruction::AddrSpaceCast &&
660
7.71k
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
661
0
                                 Dst->getPointerAddressSpace()))
662
0
      return 0;
663
7.71k
664
7.71k
    // If this is a zext/sext of a load, return 0 if the corresponding
665
7.71k
    // extending load exists on target.
666
7.71k
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt6.21k
) &&
667
7.71k
        
I1.83k
&&
isa<LoadInst>(I->getOperand(0))1.70k
) {
668
738
        EVT ExtVT = EVT::getEVT(Dst);
669
738
        EVT LoadVT = EVT::getEVT(Src);
670
738
        unsigned LType =
671
738
          ((Opcode == Instruction::ZExt) ? 
ISD::ZEXTLOAD521
:
ISD::SEXTLOAD217
);
672
738
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
673
506
          return 0;
674
7.20k
    }
675
7.20k
676
7.20k
    // If the cast is marked as legal (or promote) then assume low cost.
677
7.20k
    if (SrcLT.first == DstLT.first &&
678
7.20k
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)5.04k
)
679
3.12k
      return 1;
680
4.07k
681
4.07k
    // Handle scalar conversions.
682
4.07k
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()1.43k
) {
683
1.43k
      // Scalar bitcasts are usually free.
684
1.43k
      if (Opcode == Instruction::BitCast)
685
26
        return 0;
686
1.40k
687
1.40k
      // Just check the op cost. If the operation is legal then assume it costs
688
1.40k
      // 1.
689
1.40k
      if (!TLI->isOperationExpand(ISD, DstLT.second))
690
1.16k
        return 1;
691
235
692
235
      // Assume that illegal scalar instruction are expensive.
693
235
      return 4;
694
235
    }
695
2.64k
696
2.64k
    // Check vector-to-vector casts.
697
2.64k
    if (Dst->isVectorTy() && Src->isVectorTy()) {
698
2.64k
      // If the cast is between same-sized registers, then the check is simple.
699
2.64k
      if (SrcLT.first == DstLT.first &&
700
2.64k
          
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()1.35k
) {
701
1.21k
702
1.21k
        // Assume that Zext is done using AND.
703
1.21k
        if (Opcode == Instruction::ZExt)
704
638
          return 1;
705
577
706
577
        // Assume that sext is done using SHL and SRA.
707
577
        if (Opcode == Instruction::SExt)
708
66
          return 2;
709
511
710
511
        // Just check the op cost. If the operation is legal then assume it
711
511
        // costs
712
511
        // 1 and multiply by the type-legalization overhead.
713
511
        if (!TLI->isOperationExpand(ISD, DstLT.second))
714
0
          return SrcLT.first * 1;
715
1.94k
      }
716
1.94k
717
1.94k
      // If we are legalizing by splitting, query the concrete TTI for the cost
718
1.94k
      // of casting the original vector twice. We also need to factor in the
719
1.94k
      // cost of the split itself. Count that as 1, to be consistent with
720
1.94k
      // TLI->getTypeLegalizationCost().
721
1.94k
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
722
1.94k
           TargetLowering::TypeSplitVector) ||
723
1.94k
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
724
1.13k
           TargetLowering::TypeSplitVector)) {
725
961
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
726
961
                                         Dst->getVectorNumElements() / 2);
727
961
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
728
961
                                         Src->getVectorNumElements() / 2);
729
961
        T *TTI = static_cast<T *>(this);
730
961
        return TTI->getVectorSplitCost() +
731
961
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
732
961
      }
733
984
734
984
      // In other cases where the source or destination are illegal, assume
735
984
      // the operation will get scalarized.
736
984
      unsigned Num = Dst->getVectorNumElements();
737
984
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
738
984
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
739
984
740
984
      // Return the cost of multiple scalar invocation plus the cost of
741
984
      // inserting and extracting the values.
742
984
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
743
984
    }
744
0
745
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
746
0
    // This
747
0
    // is where we handle bitcast between vectors and scalars. We need to assume
748
0
    //  that the conversion is scalarized in one way or another.
749
0
    if (Opcode == Instruction::BitCast)
750
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
751
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
752
0
                                : 0) +
753
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
754
0
                                : 0);
755
0
756
0
    llvm_unreachable("Unhandled cast");
757
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
758
759
  unsigned getExtractWithExtendCost(unsigned Opcode, Type *Dst,
760
8
                                    VectorType *VecTy, unsigned Index) {
761
8
    return static_cast<T *>(this)->getVectorInstrCost(
762
8
               Instruction::ExtractElement, VecTy, Index) +
763
8
           static_cast<T *>(this)->getCastInstrCost(Opcode, Dst,
764
8
                                                    VecTy->getElementType());
765
8
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Line
Count
Source
760
8
                                    VectorType *VecTy, unsigned Index) {
761
8
    return static_cast<T *>(this)->getVectorInstrCost(
762
8
               Instruction::ExtractElement, VecTy, Index) +
763
8
           static_cast<T *>(this)->getCastInstrCost(Opcode, Dst,
764
8
                                                    VecTy->getElementType());
765
8
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
766
767
131k
  unsigned getCFInstrCost(unsigned Opcode) {
768
131k
    // Branches are assumed to be predicted.
769
131k
    return 0;
770
131k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getCFInstrCost(unsigned int)
Line
Count
Source
767
110k
  unsigned getCFInstrCost(unsigned Opcode) {
768
110k
    // Branches are assumed to be predicted.
769
110k
    return 0;
770
110k
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getCFInstrCost(unsigned int)
Line
Count
Source
767
17
  unsigned getCFInstrCost(unsigned Opcode) {
768
17
    // Branches are assumed to be predicted.
769
17
    return 0;
770
17
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getCFInstrCost(unsigned int)
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getCFInstrCost(unsigned int)
Line
Count
Source
767
3.33k
  unsigned getCFInstrCost(unsigned Opcode) {
768
3.33k
    // Branches are assumed to be predicted.
769
3.33k
    return 0;
770
3.33k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getCFInstrCost(unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getCFInstrCost(unsigned int)
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getCFInstrCost(unsigned int)
Line
Count
Source
767
6
  unsigned getCFInstrCost(unsigned Opcode) {
768
6
    // Branches are assumed to be predicted.
769
6
    return 0;
770
6
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getCFInstrCost(unsigned int)
Line
Count
Source
767
143
  unsigned getCFInstrCost(unsigned Opcode) {
768
143
    // Branches are assumed to be predicted.
769
143
    return 0;
770
143
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getCFInstrCost(unsigned int)
Line
Count
Source
767
916
  unsigned getCFInstrCost(unsigned Opcode) {
768
916
    // Branches are assumed to be predicted.
769
916
    return 0;
770
916
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getCFInstrCost(unsigned int)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getCFInstrCost(unsigned int)
Line
Count
Source
767
16.8k
  unsigned getCFInstrCost(unsigned Opcode) {
768
16.8k
    // Branches are assumed to be predicted.
769
16.8k
    return 0;
770
16.8k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getCFInstrCost(unsigned int)
771
772
  unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
773
194k
                              const Instruction *I) {
774
194k
    const TargetLoweringBase *TLI = getTLI();
775
194k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
776
194k
    assert(ISD && "Invalid opcode");
777
194k
778
194k
    // Selects on vectors are actually vector selects.
779
194k
    if (ISD == ISD::SELECT) {
780
72.7k
      assert(CondTy && "CondTy must exist");
781
72.7k
      if (CondTy->isVectorTy())
782
28.0k
        ISD = ISD::VSELECT;
783
72.7k
    }
784
194k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
785
194k
786
194k
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()63.5k
) &&
787
194k
        
!TLI->isOperationExpand(ISD, LT.second)194k
) {
788
169k
      // The operation is legal. Assume it costs 1. Multiply
789
169k
      // by the type-legalization overhead.
790
169k
      return LT.first * 1;
791
169k
    }
792
25.7k
793
25.7k
    // Otherwise, assume that the cast is scalarized.
794
25.7k
    // TODO: If one of the types get legalized by splitting, handle this
795
25.7k
    // similarly to what getCastInstrCost() does.
796
25.7k
    if (ValTy->isVectorTy()) {
797
23.3k
      unsigned Num = ValTy->getVectorNumElements();
798
23.3k
      if (CondTy)
799
23.3k
        CondTy = CondTy->getScalarType();
800
23.3k
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
801
23.3k
          Opcode, ValTy->getScalarType(), CondTy, I);
802
23.3k
803
23.3k
      // Return the cost of multiple scalar invocation plus the cost of
804
23.3k
      // inserting and extracting the values.
805
23.3k
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
806
23.3k
    }
807
2.34k
808
2.34k
    // Unknown scalar opcode.
809
2.34k
    return 1;
810
2.34k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
773
171k
                              const Instruction *I) {
774
171k
    const TargetLoweringBase *TLI = getTLI();
775
171k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
776
171k
    assert(ISD && "Invalid opcode");
777
171k
778
171k
    // Selects on vectors are actually vector selects.
779
171k
    if (ISD == ISD::SELECT) {
780
63.9k
      assert(CondTy && "CondTy must exist");
781
63.9k
      if (CondTy->isVectorTy())
782
22.3k
        ISD = ISD::VSELECT;
783
63.9k
    }
784
171k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
785
171k
786
171k
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()55.0k
) &&
787
171k
        
!TLI->isOperationExpand(ISD, LT.second)171k
) {
788
150k
      // The operation is legal. Assume it costs 1. Multiply
789
150k
      // by the type-legalization overhead.
790
150k
      return LT.first * 1;
791
150k
    }
792
21.1k
793
21.1k
    // Otherwise, assume that the cast is scalarized.
794
21.1k
    // TODO: If one of the types get legalized by splitting, handle this
795
21.1k
    // similarly to what getCastInstrCost() does.
796
21.1k
    if (ValTy->isVectorTy()) {
797
21.1k
      unsigned Num = ValTy->getVectorNumElements();
798
21.1k
      if (CondTy)
799
21.1k
        CondTy = CondTy->getScalarType();
800
21.1k
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
801
21.1k
          Opcode, ValTy->getScalarType(), CondTy, I);
802
21.1k
803
21.1k
      // Return the cost of multiple scalar invocation plus the cost of
804
21.1k
      // inserting and extracting the values.
805
21.1k
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
806
21.1k
    }
807
0
808
0
    // Unknown scalar opcode.
809
0
    return 1;
810
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
773
256
                              const Instruction *I) {
774
256
    const TargetLoweringBase *TLI = getTLI();
775
256
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
776
256
    assert(ISD && "Invalid opcode");
777
256
778
256
    // Selects on vectors are actually vector selects.
779
256
    if (ISD == ISD::SELECT) {
780
138
      assert(CondTy && "CondTy must exist");
781
138
      if (CondTy->isVectorTy())
782
44
        ISD = ISD::VSELECT;
783
138
    }
784
256
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
785
256
786
256
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()88
) &&
787
256
        !TLI->isOperationExpand(ISD, LT.second)) {
788
168
      // The operation is legal. Assume it costs 1. Multiply
789
168
      // by the type-legalization overhead.
790
168
      return LT.first * 1;
791
168
    }
792
88
793
88
    // Otherwise, assume that the cast is scalarized.
794
88
    // TODO: If one of the types get legalized by splitting, handle this
795
88
    // similarly to what getCastInstrCost() does.
796
88
    if (ValTy->isVectorTy()) {
797
88
      unsigned Num = ValTy->getVectorNumElements();
798
88
      if (CondTy)
799
88
        CondTy = CondTy->getScalarType();
800
88
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
801
88
          Opcode, ValTy->getScalarType(), CondTy, I);
802
88
803
88
      // Return the cost of multiple scalar invocation plus the cost of
804
88
      // inserting and extracting the values.
805
88
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
806
88
    }
807
0
808
0
    // Unknown scalar opcode.
809
0
    return 1;
810
0
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
773
3.84k
                              const Instruction *I) {
774
3.84k
    const TargetLoweringBase *TLI = getTLI();
775
3.84k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
776
3.84k
    assert(ISD && "Invalid opcode");
777
3.84k
778
3.84k
    // Selects on vectors are actually vector selects.
779
3.84k
    if (ISD == ISD::SELECT) {
780
435
      assert(CondTy && "CondTy must exist");
781
435
      if (CondTy->isVectorTy())
782
96
        ISD = ISD::VSELECT;
783
435
    }
784
3.84k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
785
3.84k
786
3.84k
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()1.06k
) &&
787
3.84k
        !TLI->isOperationExpand(ISD, LT.second)) {
788
1.34k
      // The operation is legal. Assume it costs 1. Multiply
789
1.34k
      // by the type-legalization overhead.
790
1.34k
      return LT.first * 1;
791
1.34k
    }
792
2.50k
793
2.50k
    // Otherwise, assume that the cast is scalarized.
794
2.50k
    // TODO: If one of the types get legalized by splitting, handle this
795
2.50k
    // similarly to what getCastInstrCost() does.
796
2.50k
    if (ValTy->isVectorTy()) {
797
162
      unsigned Num = ValTy->getVectorNumElements();
798
162
      if (CondTy)
799
162
        CondTy = CondTy->getScalarType();
800
162
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
801
162
          Opcode, ValTy->getScalarType(), CondTy, I);
802
162
803
162
      // Return the cost of multiple scalar invocation plus the cost of
804
162
      // inserting and extracting the values.
805
162
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
806
162
    }
807
2.34k
808
2.34k
    // Unknown scalar opcode.
809
2.34k
    return 1;
810
2.34k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
773
12
                              const Instruction *I) {
774
12
    const TargetLoweringBase *TLI = getTLI();
775
12
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
776
12
    assert(ISD && "Invalid opcode");
777
12
778
12
    // Selects on vectors are actually vector selects.
779
12
    if (ISD == ISD::SELECT) {
780
0
      assert(CondTy && "CondTy must exist");
781
0
      if (CondTy->isVectorTy())
782
0
        ISD = ISD::VSELECT;
783
0
    }
784
12
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
785
12
786
12
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()0
) &&
787
12
        !TLI->isOperationExpand(ISD, LT.second)) {
788
12
      // The operation is legal. Assume it costs 1. Multiply
789
12
      // by the type-legalization overhead.
790
12
      return LT.first * 1;
791
12
    }
792
0
793
0
    // Otherwise, assume that the cast is scalarized.
794
0
    // TODO: If one of the types get legalized by splitting, handle this
795
0
    // similarly to what getCastInstrCost() does.
796
0
    if (ValTy->isVectorTy()) {
797
0
      unsigned Num = ValTy->getVectorNumElements();
798
0
      if (CondTy)
799
0
        CondTy = CondTy->getScalarType();
800
0
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
801
0
          Opcode, ValTy->getScalarType(), CondTy, I);
802
0
803
0
      // Return the cost of multiple scalar invocation plus the cost of
804
0
      // inserting and extracting the values.
805
0
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
806
0
    }
807
0
808
0
    // Unknown scalar opcode.
809
0
    return 1;
810
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
773
3
                              const Instruction *I) {
774
3
    const TargetLoweringBase *TLI = getTLI();
775
3
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
776
3
    assert(ISD && "Invalid opcode");
777
3
778
3
    // Selects on vectors are actually vector selects.
779
3
    if (ISD == ISD::SELECT) {
780
0
      assert(CondTy && "CondTy must exist");
781
0
      if (CondTy->isVectorTy())
782
0
        ISD = ISD::VSELECT;
783
0
    }
784
3
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
785
3
786
3
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()0
) &&
787
3
        !TLI->isOperationExpand(ISD, LT.second)) {
788
3
      // The operation is legal. Assume it costs 1. Multiply
789
3
      // by the type-legalization overhead.
790
3
      return LT.first * 1;
791
3
    }
792
0
793
0
    // Otherwise, assume that the cast is scalarized.
794
0
    // TODO: If one of the types get legalized by splitting, handle this
795
0
    // similarly to what getCastInstrCost() does.
796
0
    if (ValTy->isVectorTy()) {
797
0
      unsigned Num = ValTy->getVectorNumElements();
798
0
      if (CondTy)
799
0
        CondTy = CondTy->getScalarType();
800
0
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
801
0
          Opcode, ValTy->getScalarType(), CondTy, I);
802
0
803
0
      // Return the cost of multiple scalar invocation plus the cost of
804
0
      // inserting and extracting the values.
805
0
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
806
0
    }
807
0
808
0
    // Unknown scalar opcode.
809
0
    return 1;
810
0
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
773
49
                              const Instruction *I) {
774
49
    const TargetLoweringBase *TLI = getTLI();
775
49
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
776
49
    assert(ISD && "Invalid opcode");
777
49
778
49
    // Selects on vectors are actually vector selects.
779
49
    if (ISD == ISD::SELECT) {
780
0
      assert(CondTy && "CondTy must exist");
781
0
      if (CondTy->isVectorTy())
782
0
        ISD = ISD::VSELECT;
783
0
    }
784
49
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
785
49
786
49
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()9
) &&
787
49
        
!TLI->isOperationExpand(ISD, LT.second)48
) {
788
48
      // The operation is legal. Assume it costs 1. Multiply
789
48
      // by the type-legalization overhead.
790
48
      return LT.first * 1;
791
48
    }
792
1
793
1
    // Otherwise, assume that the cast is scalarized.
794
1
    // TODO: If one of the types get legalized by splitting, handle this
795
1
    // similarly to what getCastInstrCost() does.
796
1
    if (ValTy->isVectorTy()) {
797
1
      unsigned Num = ValTy->getVectorNumElements();
798
1
      if (CondTy)
799
1
        CondTy = CondTy->getScalarType();
800
1
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
801
1
          Opcode, ValTy->getScalarType(), CondTy, I);
802
1
803
1
      // Return the cost of multiple scalar invocation plus the cost of
804
1
      // inserting and extracting the values.
805
1
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
806
1
    }
807
0
808
0
    // Unknown scalar opcode.
809
0
    return 1;
810
0
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
773
188
                              const Instruction *I) {
774
188
    const TargetLoweringBase *TLI = getTLI();
775
188
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
776
188
    assert(ISD && "Invalid opcode");
777
188
778
188
    // Selects on vectors are actually vector selects.
779
188
    if (ISD == ISD::SELECT) {
780
0
      assert(CondTy && "CondTy must exist");
781
0
      if (CondTy->isVectorTy())
782
0
        ISD = ISD::VSELECT;
783
0
    }
784
188
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
785
188
786
188
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()0
) &&
787
188
        !TLI->isOperationExpand(ISD, LT.second)) {
788
188
      // The operation is legal. Assume it costs 1. Multiply
789
188
      // by the type-legalization overhead.
790
188
      return LT.first * 1;
791
188
    }
792
0
793
0
    // Otherwise, assume that the cast is scalarized.
794
0
    // TODO: If one of the types get legalized by splitting, handle this
795
0
    // similarly to what getCastInstrCost() does.
796
0
    if (ValTy->isVectorTy()) {
797
0
      unsigned Num = ValTy->getVectorNumElements();
798
0
      if (CondTy)
799
0
        CondTy = CondTy->getScalarType();
800
0
      unsigned Cost = static_cast<T *>(this)->getCmp