Coverage Report

Created: 2019-07-24 05:18

/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
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
/// \file
10
/// This file provides a helper that implements much of the TTI interface in
11
/// terms of the target-independent code generator and TargetLowering
12
/// interfaces.
13
//
14
//===----------------------------------------------------------------------===//
15
16
#ifndef LLVM_CODEGEN_BASICTTIIMPL_H
17
#define LLVM_CODEGEN_BASICTTIIMPL_H
18
19
#include "llvm/ADT/APInt.h"
20
#include "llvm/ADT/ArrayRef.h"
21
#include "llvm/ADT/BitVector.h"
22
#include "llvm/ADT/SmallPtrSet.h"
23
#include "llvm/ADT/SmallVector.h"
24
#include "llvm/Analysis/LoopInfo.h"
25
#include "llvm/Analysis/TargetTransformInfo.h"
26
#include "llvm/Analysis/TargetTransformInfoImpl.h"
27
#include "llvm/CodeGen/ISDOpcodes.h"
28
#include "llvm/CodeGen/TargetLowering.h"
29
#include "llvm/CodeGen/TargetSubtargetInfo.h"
30
#include "llvm/CodeGen/ValueTypes.h"
31
#include "llvm/IR/BasicBlock.h"
32
#include "llvm/IR/CallSite.h"
33
#include "llvm/IR/Constant.h"
34
#include "llvm/IR/Constants.h"
35
#include "llvm/IR/DataLayout.h"
36
#include "llvm/IR/DerivedTypes.h"
37
#include "llvm/IR/InstrTypes.h"
38
#include "llvm/IR/Instruction.h"
39
#include "llvm/IR/Instructions.h"
40
#include "llvm/IR/Intrinsics.h"
41
#include "llvm/IR/Operator.h"
42
#include "llvm/IR/Type.h"
43
#include "llvm/IR/Value.h"
44
#include "llvm/MC/MCSchedule.h"
45
#include "llvm/Support/Casting.h"
46
#include "llvm/Support/CommandLine.h"
47
#include "llvm/Support/ErrorHandling.h"
48
#include "llvm/Support/MachineValueType.h"
49
#include "llvm/Support/MathExtras.h"
50
#include <algorithm>
51
#include <cassert>
52
#include <cstdint>
53
#include <limits>
54
#include <utility>
55
56
namespace llvm {
57
58
class Function;
59
class GlobalValue;
60
class LLVMContext;
61
class ScalarEvolution;
62
class SCEV;
63
class TargetMachine;
64
65
extern cl::opt<unsigned> PartialUnrollingThreshold;
66
67
/// Base class which can be used to help build a TTI implementation.
68
///
69
/// This class provides as much implementation of the TTI interface as is
70
/// possible using the target independent parts of the code generator.
71
///
72
/// In order to subclass it, your class must implement a getST() method to
73
/// return the subtarget, and a getTLI() method to return the target lowering.
74
/// We need these methods implemented in the derived class so that this class
75
/// doesn't have to duplicate storage for them.
76
template <typename T>
77
class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
78
private:
79
  using BaseT = TargetTransformInfoImplCRTPBase<T>;
80
  using TTI = TargetTransformInfo;
81
82
  /// Estimate a cost of Broadcast as an extract and sequence of insert
83
  /// operations.
84
51
  unsigned getBroadcastShuffleOverhead(Type *Ty) {
85
51
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
86
51
    unsigned Cost = 0;
87
51
    // Broadcast cost is equal to the cost of extracting the zero'th element
88
51
    // plus the cost of inserting it into every element of the result vector.
89
51
    Cost += static_cast<T *>(this)->getVectorInstrCost(
90
51
        Instruction::ExtractElement, Ty, 0);
91
51
92
153
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i102
) {
93
102
      Cost += static_cast<T *>(this)->getVectorInstrCost(
94
102
          Instruction::InsertElement, Ty, i);
95
102
    }
96
51
    return Cost;
97
51
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getBroadcastShuffleOverhead(llvm::Type*)
Line
Count
Source
84
2
  unsigned getBroadcastShuffleOverhead(Type *Ty) {
85
2
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
86
2
    unsigned Cost = 0;
87
2
    // Broadcast cost is equal to the cost of extracting the zero'th element
88
2
    // plus the cost of inserting it into every element of the result vector.
89
2
    Cost += static_cast<T *>(this)->getVectorInstrCost(
90
2
        Instruction::ExtractElement, Ty, 0);
91
2
92
6
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i4
) {
93
4
      Cost += static_cast<T *>(this)->getVectorInstrCost(
94
4
          Instruction::InsertElement, Ty, i);
95
4
    }
96
2
    return Cost;
97
2
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getBroadcastShuffleOverhead(llvm::Type*)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getBroadcastShuffleOverhead(llvm::Type*)
Line
Count
Source
84
2
  unsigned getBroadcastShuffleOverhead(Type *Ty) {
85
2
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
86
2
    unsigned Cost = 0;
87
2
    // Broadcast cost is equal to the cost of extracting the zero'th element
88
2
    // plus the cost of inserting it into every element of the result vector.
89
2
    Cost += static_cast<T *>(this)->getVectorInstrCost(
90
2
        Instruction::ExtractElement, Ty, 0);
91
2
92
6
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i4
) {
93
4
      Cost += static_cast<T *>(this)->getVectorInstrCost(
94
4
          Instruction::InsertElement, Ty, i);
95
4
    }
96
2
    return Cost;
97
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::RISCVTTIImpl>::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
84
47
  unsigned getBroadcastShuffleOverhead(Type *Ty) {
85
47
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
86
47
    unsigned Cost = 0;
87
47
    // Broadcast cost is equal to the cost of extracting the zero'th element
88
47
    // plus the cost of inserting it into every element of the result vector.
89
47
    Cost += static_cast<T *>(this)->getVectorInstrCost(
90
47
        Instruction::ExtractElement, Ty, 0);
91
47
92
141
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i94
) {
93
94
      Cost += static_cast<T *>(this)->getVectorInstrCost(
94
94
          Instruction::InsertElement, Ty, i);
95
94
    }
96
47
    return Cost;
97
47
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getBroadcastShuffleOverhead(llvm::Type*)
98
99
  /// Estimate a cost of shuffle as a sequence of extract and insert
100
  /// operations.
101
3.96k
  unsigned getPermuteShuffleOverhead(Type *Ty) {
102
3.96k
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
103
3.96k
    unsigned Cost = 0;
104
3.96k
    // Shuffle cost is equal to the cost of extracting element from its argument
105
3.96k
    // plus the cost of inserting them onto the result vector.
106
3.96k
107
3.96k
    // e.g. <4 x float> has a mask of <0,5,2,7> i.e we need to extract from
108
3.96k
    // index 0 of first vector, index 1 of second vector,index 2 of first
109
3.96k
    // vector and finally index 3 of second vector and insert them at index
110
3.96k
    // <0,1,2,3> of result vector.
111
22.1k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i18.1k
) {
112
18.1k
      Cost += static_cast<T *>(this)
113
18.1k
                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
114
18.1k
      Cost += static_cast<T *>(this)
115
18.1k
                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
116
18.1k
    }
117
3.96k
    return Cost;
118
3.96k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Line
Count
Source
101
3.32k
  unsigned getPermuteShuffleOverhead(Type *Ty) {
102
3.32k
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
103
3.32k
    unsigned Cost = 0;
104
3.32k
    // Shuffle cost is equal to the cost of extracting element from its argument
105
3.32k
    // plus the cost of inserting them onto the result vector.
106
3.32k
107
3.32k
    // e.g. <4 x float> has a mask of <0,5,2,7> i.e we need to extract from
108
3.32k
    // index 0 of first vector, index 1 of second vector,index 2 of first
109
3.32k
    // vector and finally index 3 of second vector and insert them at index
110
3.32k
    // <0,1,2,3> of result vector.
111
17.8k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i14.5k
) {
112
14.5k
      Cost += static_cast<T *>(this)
113
14.5k
                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
114
14.5k
      Cost += static_cast<T *>(this)
115
14.5k
                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
116
14.5k
    }
117
3.32k
    return Cost;
118
3.32k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Line
Count
Source
101
54
  unsigned getPermuteShuffleOverhead(Type *Ty) {
102
54
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
103
54
    unsigned Cost = 0;
104
54
    // Shuffle cost is equal to the cost of extracting element from its argument
105
54
    // plus the cost of inserting them onto the result vector.
106
54
107
54
    // e.g. <4 x float> has a mask of <0,5,2,7> i.e we need to extract from
108
54
    // index 0 of first vector, index 1 of second vector,index 2 of first
109
54
    // vector and finally index 3 of second vector and insert them at index
110
54
    // <0,1,2,3> of result vector.
111
254
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i200
) {
112
200
      Cost += static_cast<T *>(this)
113
200
                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
114
200
      Cost += static_cast<T *>(this)
115
200
                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
116
200
    }
117
54
    return Cost;
118
54
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Line
Count
Source
101
96
  unsigned getPermuteShuffleOverhead(Type *Ty) {
102
96
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
103
96
    unsigned Cost = 0;
104
96
    // Shuffle cost is equal to the cost of extracting element from its argument
105
96
    // plus the cost of inserting them onto the result vector.
106
96
107
96
    // e.g. <4 x float> has a mask of <0,5,2,7> i.e we need to extract from
108
96
    // index 0 of first vector, index 1 of second vector,index 2 of first
109
96
    // vector and finally index 3 of second vector and insert them at index
110
96
    // <0,1,2,3> of result vector.
111
480
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i384
) {
112
384
      Cost += static_cast<T *>(this)
113
384
                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
114
384
      Cost += static_cast<T *>(this)
115
384
                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
116
384
    }
117
96
    return Cost;
118
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::RISCVTTIImpl>::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
101
487
  unsigned getPermuteShuffleOverhead(Type *Ty) {
102
487
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
103
487
    unsigned Cost = 0;
104
487
    // Shuffle cost is equal to the cost of extracting element from its argument
105
487
    // plus the cost of inserting them onto the result vector.
106
487
107
487
    // e.g. <4 x float> has a mask of <0,5,2,7> i.e we need to extract from
108
487
    // index 0 of first vector, index 1 of second vector,index 2 of first
109
487
    // vector and finally index 3 of second vector and insert them at index
110
487
    // <0,1,2,3> of result vector.
111
3.53k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i3.04k
) {
112
3.04k
      Cost += static_cast<T *>(this)
113
3.04k
                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
114
3.04k
      Cost += static_cast<T *>(this)
115
3.04k
                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
116
3.04k
    }
117
487
    return Cost;
118
487
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
119
120
  /// Estimate a cost of subvector extraction as a sequence of extract and
121
  /// insert operations.
122
3.93k
  unsigned getExtractSubvectorOverhead(Type *Ty, int Index, Type *SubTy) {
123
3.93k
    assert(Ty && Ty->isVectorTy() && SubTy && SubTy->isVectorTy() &&
124
3.93k
           "Can only extract subvectors from vectors");
125
3.93k
    int NumSubElts = SubTy->getVectorNumElements();
126
3.93k
    assert((Index + NumSubElts) <= (int)Ty->getVectorNumElements() &&
127
3.93k
           "SK_ExtractSubvector index out of range");
128
3.93k
129
3.93k
    unsigned Cost = 0;
130
3.93k
    // Subvector extraction cost is equal to the cost of extracting element from
131
3.93k
    // the source type plus the cost of inserting them into the result vector
132
3.93k
    // type.
133
13.9k
    for (int i = 0; i != NumSubElts; 
++i9.99k
) {
134
9.99k
      Cost += static_cast<T *>(this)->getVectorInstrCost(
135
9.99k
          Instruction::ExtractElement, Ty, i + Index);
136
9.99k
      Cost += static_cast<T *>(this)->getVectorInstrCost(
137
9.99k
          Instruction::InsertElement, SubTy, i);
138
9.99k
    }
139
3.93k
    return Cost;
140
3.93k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getExtractSubvectorOverhead(llvm::Type*, int, llvm::Type*)
Line
Count
Source
122
3.89k
  unsigned getExtractSubvectorOverhead(Type *Ty, int Index, Type *SubTy) {
123
3.89k
    assert(Ty && Ty->isVectorTy() && SubTy && SubTy->isVectorTy() &&
124
3.89k
           "Can only extract subvectors from vectors");
125
3.89k
    int NumSubElts = SubTy->getVectorNumElements();
126
3.89k
    assert((Index + NumSubElts) <= (int)Ty->getVectorNumElements() &&
127
3.89k
           "SK_ExtractSubvector index out of range");
128
3.89k
129
3.89k
    unsigned Cost = 0;
130
3.89k
    // Subvector extraction cost is equal to the cost of extracting element from
131
3.89k
    // the source type plus the cost of inserting them into the result vector
132
3.89k
    // type.
133
13.7k
    for (int i = 0; i != NumSubElts; 
++i9.82k
) {
134
9.82k
      Cost += static_cast<T *>(this)->getVectorInstrCost(
135
9.82k
          Instruction::ExtractElement, Ty, i + Index);
136
9.82k
      Cost += static_cast<T *>(this)->getVectorInstrCost(
137
9.82k
          Instruction::InsertElement, SubTy, i);
138
9.82k
    }
139
3.89k
    return Cost;
140
3.89k
  }
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
122
25
  unsigned getExtractSubvectorOverhead(Type *Ty, int Index, Type *SubTy) {
123
25
    assert(Ty && Ty->isVectorTy() && SubTy && SubTy->isVectorTy() &&
124
25
           "Can only extract subvectors from vectors");
125
25
    int NumSubElts = SubTy->getVectorNumElements();
126
25
    assert((Index + NumSubElts) <= (int)Ty->getVectorNumElements() &&
127
25
           "SK_ExtractSubvector index out of range");
128
25
129
25
    unsigned Cost = 0;
130
25
    // Subvector extraction cost is equal to the cost of extracting element from
131
25
    // the source type plus the cost of inserting them into the result vector
132
25
    // type.
133
141
    for (int i = 0; i != NumSubElts; 
++i116
) {
134
116
      Cost += static_cast<T *>(this)->getVectorInstrCost(
135
116
          Instruction::ExtractElement, Ty, i + Index);
136
116
      Cost += static_cast<T *>(this)->getVectorInstrCost(
137
116
          Instruction::InsertElement, SubTy, i);
138
116
    }
139
25
    return Cost;
140
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::RISCVTTIImpl>::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
122
12
  unsigned getExtractSubvectorOverhead(Type *Ty, int Index, Type *SubTy) {
123
12
    assert(Ty && Ty->isVectorTy() && SubTy && SubTy->isVectorTy() &&
124
12
           "Can only extract subvectors from vectors");
125
12
    int NumSubElts = SubTy->getVectorNumElements();
126
12
    assert((Index + NumSubElts) <= (int)Ty->getVectorNumElements() &&
127
12
           "SK_ExtractSubvector index out of range");
128
12
129
12
    unsigned Cost = 0;
130
12
    // Subvector extraction cost is equal to the cost of extracting element from
131
12
    // the source type plus the cost of inserting them into the result vector
132
12
    // type.
133
60
    for (int i = 0; i != NumSubElts; 
++i48
) {
134
48
      Cost += static_cast<T *>(this)->getVectorInstrCost(
135
48
          Instruction::ExtractElement, Ty, i + Index);
136
48
      Cost += static_cast<T *>(this)->getVectorInstrCost(
137
48
          Instruction::InsertElement, SubTy, i);
138
48
    }
139
12
    return Cost;
140
12
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getExtractSubvectorOverhead(llvm::Type*, int, llvm::Type*)
141
142
  /// Estimate a cost of subvector insertion as a sequence of extract and
143
  /// insert operations.
144
73
  unsigned getInsertSubvectorOverhead(Type *Ty, int Index, Type *SubTy) {
145
73
    assert(Ty && Ty->isVectorTy() && SubTy && SubTy->isVectorTy() &&
146
73
           "Can only insert subvectors into vectors");
147
73
    int NumSubElts = SubTy->getVectorNumElements();
148
73
    assert((Index + NumSubElts) <= (int)Ty->getVectorNumElements() &&
149
73
           "SK_InsertSubvector index out of range");
150
73
151
73
    unsigned Cost = 0;
152
73
    // Subvector insertion cost is equal to the cost of extracting element from
153
73
    // the source type plus the cost of inserting them into the result vector
154
73
    // type.
155
235
    for (int i = 0; i != NumSubElts; 
++i162
) {
156
162
      Cost += static_cast<T *>(this)->getVectorInstrCost(
157
162
          Instruction::ExtractElement, SubTy, i);
158
162
      Cost += static_cast<T *>(this)->getVectorInstrCost(
159
162
          Instruction::InsertElement, Ty, i + Index);
160
162
    }
161
73
    return Cost;
162
73
  }
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::RISCVTTIImpl>::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
144
73
  unsigned getInsertSubvectorOverhead(Type *Ty, int Index, Type *SubTy) {
145
73
    assert(Ty && Ty->isVectorTy() && SubTy && SubTy->isVectorTy() &&
146
73
           "Can only insert subvectors into vectors");
147
73
    int NumSubElts = SubTy->getVectorNumElements();
148
73
    assert((Index + NumSubElts) <= (int)Ty->getVectorNumElements() &&
149
73
           "SK_InsertSubvector index out of range");
150
73
151
73
    unsigned Cost = 0;
152
73
    // Subvector insertion cost is equal to the cost of extracting element from
153
73
    // the source type plus the cost of inserting them into the result vector
154
73
    // type.
155
235
    for (int i = 0; i != NumSubElts; 
++i162
) {
156
162
      Cost += static_cast<T *>(this)->getVectorInstrCost(
157
162
          Instruction::ExtractElement, SubTy, i);
158
162
      Cost += static_cast<T *>(this)->getVectorInstrCost(
159
162
          Instruction::InsertElement, Ty, i + Index);
160
162
    }
161
73
    return Cost;
162
73
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getInsertSubvectorOverhead(llvm::Type*, int, llvm::Type*)
163
164
  /// Local query method delegates up to T which *must* implement this!
165
390k
  const TargetSubtargetInfo *getST() const {
166
390k
    return static_cast<const T *>(this)->getST();
167
390k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getST() const
Line
Count
Source
165
359k
  const TargetSubtargetInfo *getST() const {
166
359k
    return static_cast<const T *>(this)->getST();
167
359k
  }
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
165
6.89k
  const TargetSubtargetInfo *getST() const {
166
6.89k
    return static_cast<const T *>(this)->getST();
167
6.89k
  }
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
165
2
  const TargetSubtargetInfo *getST() const {
166
2
    return static_cast<const T *>(this)->getST();
167
2
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getST() const
Line
Count
Source
165
654
  const TargetSubtargetInfo *getST() const {
166
654
    return static_cast<const T *>(this)->getST();
167
654
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getST() const
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
165
22.9k
  const TargetSubtargetInfo *getST() const {
166
22.9k
    return static_cast<const T *>(this)->getST();
167
22.9k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getST() const
168
169
  /// Local query method delegates up to T which *must* implement this!
170
117M
  const TargetLoweringBase *getTLI() const {
171
117M
    return static_cast<const T *>(this)->getTLI();
172
117M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getTLI() const
Line
Count
Source
170
104M
  const TargetLoweringBase *getTLI() const {
171
104M
    return static_cast<const T *>(this)->getTLI();
172
104M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getTLI() const
Line
Count
Source
170
3.64k
  const TargetLoweringBase *getTLI() const {
171
3.64k
    return static_cast<const T *>(this)->getTLI();
172
3.64k
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getTLI() const
Line
Count
Source
170
98.3k
  const TargetLoweringBase *getTLI() const {
171
98.3k
    return static_cast<const T *>(this)->getTLI();
172
98.3k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getTLI() const
Line
Count
Source
170
2.07M
  const TargetLoweringBase *getTLI() const {
171
2.07M
    return static_cast<const T *>(this)->getTLI();
172
2.07M
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getTLI() const
Line
Count
Source
170
40.9k
  const TargetLoweringBase *getTLI() const {
171
40.9k
    return static_cast<const T *>(this)->getTLI();
172
40.9k
  }
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getTLI() const
Line
Count
Source
170
268
  const TargetLoweringBase *getTLI() const {
171
268
    return static_cast<const T *>(this)->getTLI();
172
268
  }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getTLI() const
Line
Count
Source
170
1.36k
  const TargetLoweringBase *getTLI() const {
171
1.36k
    return static_cast<const T *>(this)->getTLI();
172
1.36k
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getTLI() const
Line
Count
Source
170
2.22k
  const TargetLoweringBase *getTLI() const {
171
2.22k
    return static_cast<const T *>(this)->getTLI();
172
2.22k
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getTLI() const
Line
Count
Source
170
155k
  const TargetLoweringBase *getTLI() const {
171
155k
    return static_cast<const T *>(this)->getTLI();
172
155k
  }
llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getTLI() const
Line
Count
Source
170
655
  const TargetLoweringBase *getTLI() const {
171
655
    return static_cast<const T *>(this)->getTLI();
172
655
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getTLI() const
Line
Count
Source
170
12.6k
  const TargetLoweringBase *getTLI() const {
171
12.6k
    return static_cast<const T *>(this)->getTLI();
172
12.6k
  }
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getTLI() const
Line
Count
Source
170
966
  const TargetLoweringBase *getTLI() const {
171
966
    return static_cast<const T *>(this)->getTLI();
172
966
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getTLI() const
Line
Count
Source
170
10.0M
  const TargetLoweringBase *getTLI() const {
171
10.0M
    return static_cast<const T *>(this)->getTLI();
172
10.0M
  }
llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getTLI() const
Line
Count
Source
170
26
  const TargetLoweringBase *getTLI() const {
171
26
    return static_cast<const T *>(this)->getTLI();
172
26
  }
173
174
8.49M
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
175
8.49M
    switch (M) {
176
8.49M
      case TTI::MIM_Unindexed:
177
0
        return ISD::UNINDEXED;
178
8.49M
      case TTI::MIM_PreInc:
179
0
        return ISD::PRE_INC;
180
8.49M
      case TTI::MIM_PreDec:
181
0
        return ISD::PRE_DEC;
182
8.49M
      case TTI::MIM_PostInc:
183
8.49M
        return ISD::POST_INC;
184
8.49M
      case TTI::MIM_PostDec:
185
0
        return ISD::POST_DEC;
186
0
    }
187
0
    llvm_unreachable("Unexpected MemIndexedMode");
188
0
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Line
Count
Source
174
6.95M
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
175
6.95M
    switch (M) {
176
6.95M
      case TTI::MIM_Unindexed:
177
0
        return ISD::UNINDEXED;
178
6.95M
      case TTI::MIM_PreInc:
179
0
        return ISD::PRE_INC;
180
6.95M
      case TTI::MIM_PreDec:
181
0
        return ISD::PRE_DEC;
182
6.95M
      case TTI::MIM_PostInc:
183
6.95M
        return ISD::POST_INC;
184
6.95M
      case TTI::MIM_PostDec:
185
0
        return ISD::POST_DEC;
186
0
    }
187
0
    llvm_unreachable("Unexpected MemIndexedMode");
188
0
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Line
Count
Source
174
304
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
175
304
    switch (M) {
176
304
      case TTI::MIM_Unindexed:
177
0
        return ISD::UNINDEXED;
178
304
      case TTI::MIM_PreInc:
179
0
        return ISD::PRE_INC;
180
304
      case TTI::MIM_PreDec:
181
0
        return ISD::PRE_DEC;
182
304
      case TTI::MIM_PostInc:
183
304
        return ISD::POST_INC;
184
304
      case TTI::MIM_PostDec:
185
0
        return ISD::POST_DEC;
186
0
    }
187
0
    llvm_unreachable("Unexpected MemIndexedMode");
188
0
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Line
Count
Source
174
7.27k
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
175
7.27k
    switch (M) {
176
7.27k
      case TTI::MIM_Unindexed:
177
0
        return ISD::UNINDEXED;
178
7.27k
      case TTI::MIM_PreInc:
179
0
        return ISD::PRE_INC;
180
7.27k
      case TTI::MIM_PreDec:
181
0
        return ISD::PRE_DEC;
182
7.27k
      case TTI::MIM_PostInc:
183
7.27k
        return ISD::POST_INC;
184
7.27k
      case TTI::MIM_PostDec:
185
0
        return ISD::POST_DEC;
186
0
    }
187
0
    llvm_unreachable("Unexpected MemIndexedMode");
188
0
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Line
Count
Source
174
177k
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
175
177k
    switch (M) {
176
177k
      case TTI::MIM_Unindexed:
177
0
        return ISD::UNINDEXED;
178
177k
      case TTI::MIM_PreInc:
179
0
        return ISD::PRE_INC;
180
177k
      case TTI::MIM_PreDec:
181
0
        return ISD::PRE_DEC;
182
177k
      case TTI::MIM_PostInc:
183
177k
        return ISD::POST_INC;
184
177k
      case TTI::MIM_PostDec:
185
0
        return ISD::POST_DEC;
186
0
    }
187
0
    llvm_unreachable("Unexpected MemIndexedMode");
188
0
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Line
Count
Source
174
8.07k
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
175
8.07k
    switch (M) {
176
8.07k
      case TTI::MIM_Unindexed:
177
0
        return ISD::UNINDEXED;
178
8.07k
      case TTI::MIM_PreInc:
179
0
        return ISD::PRE_INC;
180
8.07k
      case TTI::MIM_PreDec:
181
0
        return ISD::PRE_DEC;
182
8.07k
      case TTI::MIM_PostInc:
183
8.07k
        return ISD::POST_INC;
184
8.07k
      case TTI::MIM_PostDec:
185
0
        return ISD::POST_DEC;
186
0
    }
187
0
    llvm_unreachable("Unexpected MemIndexedMode");
188
0
  }
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Line
Count
Source
174
112
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
175
112
    switch (M) {
176
112
      case TTI::MIM_Unindexed:
177
0
        return ISD::UNINDEXED;
178
112
      case TTI::MIM_PreInc:
179
0
        return ISD::PRE_INC;
180
112
      case TTI::MIM_PreDec:
181
0
        return ISD::PRE_DEC;
182
112
      case TTI::MIM_PostInc:
183
112
        return ISD::POST_INC;
184
112
      case TTI::MIM_PostDec:
185
0
        return ISD::POST_DEC;
186
0
    }
187
0
    llvm_unreachable("Unexpected MemIndexedMode");
188
0
  }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Line
Count
Source
174
454
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
175
454
    switch (M) {
176
454
      case TTI::MIM_Unindexed:
177
0
        return ISD::UNINDEXED;
178
454
      case TTI::MIM_PreInc:
179
0
        return ISD::PRE_INC;
180
454
      case TTI::MIM_PreDec:
181
0
        return ISD::PRE_DEC;
182
454
      case TTI::MIM_PostInc:
183
454
        return ISD::POST_INC;
184
454
      case TTI::MIM_PostDec:
185
0
        return ISD::POST_DEC;
186
0
    }
187
0
    llvm_unreachable("Unexpected MemIndexedMode");
188
0
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Line
Count
Source
174
494
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
175
494
    switch (M) {
176
494
      case TTI::MIM_Unindexed:
177
0
        return ISD::UNINDEXED;
178
494
      case TTI::MIM_PreInc:
179
0
        return ISD::PRE_INC;
180
494
      case TTI::MIM_PreDec:
181
0
        return ISD::PRE_DEC;
182
494
      case TTI::MIM_PostInc:
183
494
        return ISD::POST_INC;
184
494
      case TTI::MIM_PostDec:
185
0
        return ISD::POST_DEC;
186
0
    }
187
0
    llvm_unreachable("Unexpected MemIndexedMode");
188
0
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Line
Count
Source
174
23.3k
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
175
23.3k
    switch (M) {
176
23.3k
      case TTI::MIM_Unindexed:
177
0
        return ISD::UNINDEXED;
178
23.3k
      case TTI::MIM_PreInc:
179
0
        return ISD::PRE_INC;
180
23.3k
      case TTI::MIM_PreDec:
181
0
        return ISD::PRE_DEC;
182
23.3k
      case TTI::MIM_PostInc:
183
23.3k
        return ISD::POST_INC;
184
23.3k
      case TTI::MIM_PostDec:
185
0
        return ISD::POST_DEC;
186
0
    }
187
0
    llvm_unreachable("Unexpected MemIndexedMode");
188
0
  }
llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Line
Count
Source
174
108
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
175
108
    switch (M) {
176
108
      case TTI::MIM_Unindexed:
177
0
        return ISD::UNINDEXED;
178
108
      case TTI::MIM_PreInc:
179
0
        return ISD::PRE_INC;
180
108
      case TTI::MIM_PreDec:
181
0
        return ISD::PRE_DEC;
182
108
      case TTI::MIM_PostInc:
183
108
        return ISD::POST_INC;
184
108
      case TTI::MIM_PostDec:
185
0
        return ISD::POST_DEC;
186
0
    }
187
0
    llvm_unreachable("Unexpected MemIndexedMode");
188
0
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Line
Count
Source
174
1.54k
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
175
1.54k
    switch (M) {
176
1.54k
      case TTI::MIM_Unindexed:
177
0
        return ISD::UNINDEXED;
178
1.54k
      case TTI::MIM_PreInc:
179
0
        return ISD::PRE_INC;
180
1.54k
      case TTI::MIM_PreDec:
181
0
        return ISD::PRE_DEC;
182
1.54k
      case TTI::MIM_PostInc:
183
1.54k
        return ISD::POST_INC;
184
1.54k
      case TTI::MIM_PostDec:
185
0
        return ISD::POST_DEC;
186
0
    }
187
0
    llvm_unreachable("Unexpected MemIndexedMode");
188
0
  }
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Line
Count
Source
174
368
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
175
368
    switch (M) {
176
368
      case TTI::MIM_Unindexed:
177
0
        return ISD::UNINDEXED;
178
368
      case TTI::MIM_PreInc:
179
0
        return ISD::PRE_INC;
180
368
      case TTI::MIM_PreDec:
181
0
        return ISD::PRE_DEC;
182
368
      case TTI::MIM_PostInc:
183
368
        return ISD::POST_INC;
184
368
      case TTI::MIM_PostDec:
185
0
        return ISD::POST_DEC;
186
0
    }
187
0
    llvm_unreachable("Unexpected MemIndexedMode");
188
0
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Line
Count
Source
174
1.31M
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
175
1.31M
    switch (M) {
176
1.31M
      case TTI::MIM_Unindexed:
177
0
        return ISD::UNINDEXED;
178
1.31M
      case TTI::MIM_PreInc:
179
0
        return ISD::PRE_INC;
180
1.31M
      case TTI::MIM_PreDec:
181
0
        return ISD::PRE_DEC;
182
1.31M
      case TTI::MIM_PostInc:
183
1.31M
        return ISD::POST_INC;
184
1.31M
      case TTI::MIM_PostDec:
185
0
        return ISD::POST_DEC;
186
0
    }
187
0
    llvm_unreachable("Unexpected MemIndexedMode");
188
0
  }
llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Line
Count
Source
174
8
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
175
8
    switch (M) {
176
8
      case TTI::MIM_Unindexed:
177
0
        return ISD::UNINDEXED;
178
8
      case TTI::MIM_PreInc:
179
0
        return ISD::PRE_INC;
180
8
      case TTI::MIM_PreDec:
181
0
        return ISD::PRE_DEC;
182
8
      case TTI::MIM_PostInc:
183
8
        return ISD::POST_INC;
184
8
      case TTI::MIM_PostDec:
185
0
        return ISD::POST_DEC;
186
0
    }
187
0
    llvm_unreachable("Unexpected MemIndexedMode");
188
0
  }
189
190
protected:
191
  explicit BasicTTIImplBase(const TargetMachine *TM, const DataLayout &DL)
192
16.5M
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
192
11.9M
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
192
37.9k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::AMDGPUTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
192
551k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
192
513k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
192
656k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
192
30.6k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
192
648
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
192
19.6k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
192
97.9k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
192
23.8k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
192
107k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
192
33.7k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
192
2.43M
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
192
1.89k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
192
95.5k
      : BaseT(DL) {}
193
194
  using TargetTransformInfoImplBase::DL;
195
196
public:
197
  /// \name Scalar TTI Implementations
198
  /// @{
199
  bool allowsMisalignedMemoryAccesses(LLVMContext &Context, unsigned BitWidth,
200
                                      unsigned AddressSpace, unsigned Alignment,
201
9.42k
                                      bool *Fast) const {
202
9.42k
    EVT E = EVT::getIntegerVT(Context, BitWidth);
203
9.42k
    return getTLI()->allowsMisalignedMemoryAccesses(
204
9.42k
        E, AddressSpace, Alignment, MachineMemOperand::MONone, Fast);
205
9.42k
  }
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
201
118
                                      bool *Fast) const {
202
118
    EVT E = EVT::getIntegerVT(Context, BitWidth);
203
118
    return getTLI()->allowsMisalignedMemoryAccesses(
204
118
        E, AddressSpace, Alignment, MachineMemOperand::MONone, Fast);
205
118
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
Line
Count
Source
201
9.24k
                                      bool *Fast) const {
202
9.24k
    EVT E = EVT::getIntegerVT(Context, BitWidth);
203
9.24k
    return getTLI()->allowsMisalignedMemoryAccesses(
204
9.24k
        E, AddressSpace, Alignment, MachineMemOperand::MONone, Fast);
205
9.24k
  }
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
201
21
                                      bool *Fast) const {
202
21
    EVT E = EVT::getIntegerVT(Context, BitWidth);
203
21
    return getTLI()->allowsMisalignedMemoryAccesses(
204
21
        E, AddressSpace, Alignment, MachineMemOperand::MONone, 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::RISCVTTIImpl>::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
201
47
                                      bool *Fast) const {
202
47
    EVT E = EVT::getIntegerVT(Context, BitWidth);
203
47
    return getTLI()->allowsMisalignedMemoryAccesses(
204
47
        E, AddressSpace, Alignment, MachineMemOperand::MONone, Fast);
205
47
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
206
207
469k
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::hasBranchDivergence()
Line
Count
Source
207
359k
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::hasBranchDivergence()
Line
Count
Source
207
2.44k
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::hasBranchDivergence()
Line
Count
Source
207
22.3k
  bool hasBranchDivergence() { return false; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::hasBranchDivergence()
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::hasBranchDivergence()
Line
Count
Source
207
49
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::hasBranchDivergence()
Line
Count
Source
207
81
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::hasBranchDivergence()
Line
Count
Source
207
6
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::hasBranchDivergence()
Line
Count
Source
207
3.43k
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::hasBranchDivergence()
Line
Count
Source
207
170
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::hasBranchDivergence()
Line
Count
Source
207
81.2k
  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::RISCVTTIImpl>::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
108
  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
108
  bool isAlwaysUniform(const Value *V) { return false; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::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.36k
  unsigned getFlatAddressSpace() {
214
2.36k
    // Return an invalid address space.
215
2.36k
    return -1;
216
2.36k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getFlatAddressSpace()
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getFlatAddressSpace()
Line
Count
Source
213
2.36k
  unsigned getFlatAddressSpace() {
214
2.36k
    // Return an invalid address space.
215
2.36k
    return -1;
216
2.36k
  }
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::RISCVTTIImpl>::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.61M
  bool isLegalAddImmediate(int64_t imm) {
219
2.61M
    return getTLI()->isLegalAddImmediate(imm);
220
2.61M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
2.54M
  bool isLegalAddImmediate(int64_t imm) {
219
2.54M
    return getTLI()->isLegalAddImmediate(imm);
220
2.54M
  }
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
660
  bool isLegalAddImmediate(int64_t imm) {
219
660
    return getTLI()->isLegalAddImmediate(imm);
220
660
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
29.4k
  bool isLegalAddImmediate(int64_t imm) {
219
29.4k
    return getTLI()->isLegalAddImmediate(imm);
220
29.4k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
1.15k
  bool isLegalAddImmediate(int64_t imm) {
219
1.15k
    return getTLI()->isLegalAddImmediate(imm);
220
1.15k
  }
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
4.39k
  bool isLegalAddImmediate(int64_t imm) {
219
4.39k
    return getTLI()->isLegalAddImmediate(imm);
220
4.39k
  }
llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
38
  bool isLegalAddImmediate(int64_t imm) {
219
38
    return getTLI()->isLegalAddImmediate(imm);
220
38
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
22
  bool isLegalAddImmediate(int64_t imm) {
219
22
    return getTLI()->isLegalAddImmediate(imm);
220
22
  }
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
12
  bool isLegalAddImmediate(int64_t imm) {
219
12
    return getTLI()->isLegalAddImmediate(imm);
220
12
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
218
34.0k
  bool isLegalAddImmediate(int64_t imm) {
219
34.0k
    return getTLI()->isLegalAddImmediate(imm);
220
34.0k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isLegalAddImmediate(long long)
221
222
535k
  bool isLegalICmpImmediate(int64_t imm) {
223
535k
    return getTLI()->isLegalICmpImmediate(imm);
224
535k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
222
452k
  bool isLegalICmpImmediate(int64_t imm) {
223
452k
    return getTLI()->isLegalICmpImmediate(imm);
224
452k
  }
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
12.9k
  bool isLegalICmpImmediate(int64_t imm) {
223
12.9k
    return getTLI()->isLegalICmpImmediate(imm);
224
12.9k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
222
1.27k
  bool isLegalICmpImmediate(int64_t imm) {
223
1.27k
    return getTLI()->isLegalICmpImmediate(imm);
224
1.27k
  }
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
836
  bool isLegalICmpImmediate(int64_t imm) {
223
836
    return getTLI()->isLegalICmpImmediate(imm);
224
836
  }
llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
222
19
  bool isLegalICmpImmediate(int64_t imm) {
223
19
    return getTLI()->isLegalICmpImmediate(imm);
224
19
  }
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
66.9k
  bool isLegalICmpImmediate(int64_t imm) {
223
66.9k
    return getTLI()->isLegalICmpImmediate(imm);
224
66.9k
  }
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
59.0M
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
59.0M
    TargetLoweringBase::AddrMode AM;
230
59.0M
    AM.BaseGV = BaseGV;
231
59.0M
    AM.BaseOffs = BaseOffset;
232
59.0M
    AM.HasBaseReg = HasBaseReg;
233
59.0M
    AM.Scale = Scale;
234
59.0M
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
59.0M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
53.7M
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
53.7M
    TargetLoweringBase::AddrMode AM;
230
53.7M
    AM.BaseGV = BaseGV;
231
53.7M
    AM.BaseOffs = BaseOffset;
232
53.7M
    AM.HasBaseReg = HasBaseReg;
233
53.7M
    AM.Scale = Scale;
234
53.7M
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
53.7M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
2.39k
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
2.39k
    TargetLoweringBase::AddrMode AM;
230
2.39k
    AM.BaseGV = BaseGV;
231
2.39k
    AM.BaseOffs = BaseOffset;
232
2.39k
    AM.HasBaseReg = HasBaseReg;
233
2.39k
    AM.Scale = Scale;
234
2.39k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
2.39k
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
62.9k
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
62.9k
    TargetLoweringBase::AddrMode AM;
230
62.9k
    AM.BaseGV = BaseGV;
231
62.9k
    AM.BaseOffs = BaseOffset;
232
62.9k
    AM.HasBaseReg = HasBaseReg;
233
62.9k
    AM.Scale = Scale;
234
62.9k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
62.9k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
866k
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
866k
    TargetLoweringBase::AddrMode AM;
230
866k
    AM.BaseGV = BaseGV;
231
866k
    AM.BaseOffs = BaseOffset;
232
866k
    AM.HasBaseReg = HasBaseReg;
233
866k
    AM.Scale = Scale;
234
866k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
866k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
21.4k
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
21.4k
    TargetLoweringBase::AddrMode AM;
230
21.4k
    AM.BaseGV = BaseGV;
231
21.4k
    AM.BaseOffs = BaseOffset;
232
21.4k
    AM.HasBaseReg = HasBaseReg;
233
21.4k
    AM.Scale = Scale;
234
21.4k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
21.4k
  }
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
899
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
899
    TargetLoweringBase::AddrMode AM;
230
899
    AM.BaseGV = BaseGV;
231
899
    AM.BaseOffs = BaseOffset;
232
899
    AM.HasBaseReg = HasBaseReg;
233
899
    AM.Scale = Scale;
234
899
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
899
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
75.9k
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
75.9k
    TargetLoweringBase::AddrMode AM;
230
75.9k
    AM.BaseGV = BaseGV;
231
75.9k
    AM.BaseOffs = BaseOffset;
232
75.9k
    AM.HasBaseReg = HasBaseReg;
233
75.9k
    AM.Scale = Scale;
234
75.9k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
75.9k
  }
llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
194
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
194
    TargetLoweringBase::AddrMode AM;
230
194
    AM.BaseGV = BaseGV;
231
194
    AM.BaseOffs = BaseOffset;
232
194
    AM.HasBaseReg = HasBaseReg;
233
194
    AM.Scale = Scale;
234
194
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
194
  }
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
116
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
116
    TargetLoweringBase::AddrMode AM;
230
116
    AM.BaseGV = BaseGV;
231
116
    AM.BaseOffs = BaseOffset;
232
116
    AM.HasBaseReg = HasBaseReg;
233
116
    AM.Scale = Scale;
234
116
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
116
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
228
4.26M
                             unsigned AddrSpace, Instruction *I = nullptr) {
229
4.26M
    TargetLoweringBase::AddrMode AM;
230
4.26M
    AM.BaseGV = BaseGV;
231
4.26M
    AM.BaseOffs = BaseOffset;
232
4.26M
    AM.HasBaseReg = HasBaseReg;
233
4.26M
    AM.Scale = Scale;
234
4.26M
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
235
4.26M
  }
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.82M
                          const DataLayout &DL) const {
239
7.82M
    EVT VT = getTLI()->getValueType(DL, Ty);
240
7.82M
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
241
7.82M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
238
6.95M
                          const DataLayout &DL) const {
239
6.95M
    EVT VT = getTLI()->getValueType(DL, Ty);
240
6.95M
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
241
6.95M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
238
152
                          const DataLayout &DL) const {
239
152
    EVT VT = getTLI()->getValueType(DL, Ty);
240
152
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
241
152
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
238
3.63k
                          const DataLayout &DL) const {
239
3.63k
    EVT VT = getTLI()->getValueType(DL, Ty);
240
3.63k
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
241
3.63k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
238
177k
                          const DataLayout &DL) const {
239
177k
    EVT VT = getTLI()->getValueType(DL, Ty);
240
177k
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
241
177k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
238
8.07k
                          const DataLayout &DL) const {
239
8.07k
    EVT VT = getTLI()->getValueType(DL, Ty);
240
8.07k
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
241
8.07k
  }
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
238
56
                          const DataLayout &DL) const {
239
56
    EVT VT = getTLI()->getValueType(DL, Ty);
240
56
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
241
56
  }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
238
267
                          const DataLayout &DL) const {
239
267
    EVT VT = getTLI()->getValueType(DL, Ty);
240
267
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
241
267
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
238
247
                          const DataLayout &DL) const {
239
247
    EVT VT = getTLI()->getValueType(DL, Ty);
240
247
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
241
247
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
238
11.6k
                          const DataLayout &DL) const {
239
11.6k
    EVT VT = getTLI()->getValueType(DL, Ty);
240
11.6k
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
241
11.6k
  }
llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
238
54
                          const DataLayout &DL) const {
239
54
    EVT VT = getTLI()->getValueType(DL, Ty);
240
54
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
241
54
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
238
773
                          const DataLayout &DL) const {
239
773
    EVT VT = getTLI()->getValueType(DL, Ty);
240
773
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
241
773
  }
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
238
184
                          const DataLayout &DL) const {
239
184
    EVT VT = getTLI()->getValueType(DL, Ty);
240
184
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
241
184
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
238
659k
                          const DataLayout &DL) const {
239
659k
    EVT VT = getTLI()->getValueType(DL, Ty);
240
659k
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
241
659k
  }
llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
238
4
                          const DataLayout &DL) const {
239
4
    EVT VT = getTLI()->getValueType(DL, Ty);
240
4
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
241
4
  }
242
243
  bool isIndexedStoreLegal(TTI::MemIndexedMode M, Type *Ty,
244
676k
                           const DataLayout &DL) const {
245
676k
    EVT VT = getTLI()->getValueType(DL, Ty);
246
676k
    return getTLI()->isIndexedStoreLegal(getISDIndexedMode(M), VT);
247
676k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
244
152
                           const DataLayout &DL) const {
245
152
    EVT VT = getTLI()->getValueType(DL, Ty);
246
152
    return getTLI()->isIndexedStoreLegal(getISDIndexedMode(M), VT);
247
152
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
244
3.63k
                           const DataLayout &DL) const {
245
3.63k
    EVT VT = getTLI()->getValueType(DL, Ty);
246
3.63k
    return getTLI()->isIndexedStoreLegal(getISDIndexedMode(M), VT);
247
3.63k
  }
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
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
244
56
                           const DataLayout &DL) const {
245
56
    EVT VT = getTLI()->getValueType(DL, Ty);
246
56
    return getTLI()->isIndexedStoreLegal(getISDIndexedMode(M), VT);
247
56
  }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
244
187
                           const DataLayout &DL) const {
245
187
    EVT VT = getTLI()->getValueType(DL, Ty);
246
187
    return getTLI()->isIndexedStoreLegal(getISDIndexedMode(M), VT);
247
187
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
244
247
                           const DataLayout &DL) const {
245
247
    EVT VT = getTLI()->getValueType(DL, Ty);
246
247
    return getTLI()->isIndexedStoreLegal(getISDIndexedMode(M), VT);
247
247
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
244
11.6k
                           const DataLayout &DL) const {
245
11.6k
    EVT VT = getTLI()->getValueType(DL, Ty);
246
11.6k
    return getTLI()->isIndexedStoreLegal(getISDIndexedMode(M), VT);
247
11.6k
  }
llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
244
54
                           const DataLayout &DL) const {
245
54
    EVT VT = getTLI()->getValueType(DL, Ty);
246
54
    return getTLI()->isIndexedStoreLegal(getISDIndexedMode(M), VT);
247
54
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
244
773
                           const DataLayout &DL) const {
245
773
    EVT VT = getTLI()->getValueType(DL, Ty);
246
773
    return getTLI()->isIndexedStoreLegal(getISDIndexedMode(M), VT);
247
773
  }
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
244
184
                           const DataLayout &DL) const {
245
184
    EVT VT = getTLI()->getValueType(DL, Ty);
246
184
    return getTLI()->isIndexedStoreLegal(getISDIndexedMode(M), VT);
247
184
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
244
659k
                           const DataLayout &DL) const {
245
659k
    EVT VT = getTLI()->getValueType(DL, Ty);
246
659k
    return getTLI()->isIndexedStoreLegal(getISDIndexedMode(M), VT);
247
659k
  }
llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
244
4
                           const DataLayout &DL) const {
245
4
    EVT VT = getTLI()->getValueType(DL, Ty);
246
4
    return getTLI()->isIndexedStoreLegal(getISDIndexedMode(M), VT);
247
4
  }
248
249
4.21M
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
4.21M
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
4.21M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
4.07M
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
4.07M
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
4.07M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
86
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
86
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
86
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
1.02k
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
1.02k
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
1.02k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
123k
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
123k
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
123k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
4.38k
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
4.38k
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
4.38k
  }
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.90k
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
4.90k
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
4.90k
  }
llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
39
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
39
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
39
  }
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
249
96
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
250
96
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
251
96
  }
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
6.05M
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
255
6.05M
    TargetLoweringBase::AddrMode AM;
256
6.05M
    AM.BaseGV = BaseGV;
257
6.05M
    AM.BaseOffs = BaseOffset;
258
6.05M
    AM.HasBaseReg = HasBaseReg;
259
6.05M
    AM.Scale = Scale;
260
6.05M
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
261
6.05M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
254
5.24M
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
255
5.24M
    TargetLoweringBase::AddrMode AM;
256
5.24M
    AM.BaseGV = BaseGV;
257
5.24M
    AM.BaseOffs = BaseOffset;
258
5.24M
    AM.HasBaseReg = HasBaseReg;
259
5.24M
    AM.Scale = Scale;
260
5.24M
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
261
5.24M
  }
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
446
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
255
446
    TargetLoweringBase::AddrMode AM;
256
446
    AM.BaseGV = BaseGV;
257
446
    AM.BaseOffs = BaseOffset;
258
446
    AM.HasBaseReg = HasBaseReg;
259
446
    AM.Scale = Scale;
260
446
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
261
446
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
254
105k
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
255
105k
    TargetLoweringBase::AddrMode AM;
256
105k
    AM.BaseGV = BaseGV;
257
105k
    AM.BaseOffs = BaseOffset;
258
105k
    AM.HasBaseReg = HasBaseReg;
259
105k
    AM.Scale = Scale;
260
105k
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
261
105k
  }
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
11.9k
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
255
11.9k
    TargetLoweringBase::AddrMode AM;
256
11.9k
    AM.BaseGV = BaseGV;
257
11.9k
    AM.BaseOffs = BaseOffset;
258
11.9k
    AM.HasBaseReg = HasBaseReg;
259
11.9k
    AM.Scale = Scale;
260
11.9k
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
261
11.9k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
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
690k
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
255
690k
    TargetLoweringBase::AddrMode AM;
256
690k
    AM.BaseGV = BaseGV;
257
690k
    AM.BaseOffs = BaseOffset;
258
690k
    AM.HasBaseReg = HasBaseReg;
259
690k
    AM.Scale = Scale;
260
690k
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
261
690k
  }
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
30
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
30
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
30
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
263
1.33k
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
1.33k
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
1.33k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
263
4.18k
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
4.18k
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
4.18k
  }
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
98
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
98
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
98
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
263
3.88k
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
3.88k
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
3.88k
  }
llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
263
184
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
184
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
184
  }
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
52
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
52
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
52
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
263
21.6k
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
264
21.6k
    return getTLI()->isTruncateFree(Ty1, Ty2);
265
21.6k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
266
267
121k
  bool isProfitableToHoist(Instruction *I) {
268
121k
    return getTLI()->isProfitableToHoist(I);
269
121k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isProfitableToHoist(llvm::Instruction*)
Line
Count
Source
267
78.6k
  bool isProfitableToHoist(Instruction *I) {
268
78.6k
    return getTLI()->isProfitableToHoist(I);
269
78.6k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isProfitableToHoist(llvm::Instruction*)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isProfitableToHoist(llvm::Instruction*)
Line
Count
Source
267
24
  bool isProfitableToHoist(Instruction *I) {
268
24
    return getTLI()->isProfitableToHoist(I);
269
24
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isProfitableToHoist(llvm::Instruction*)
Line
Count
Source
267
8.67k
  bool isProfitableToHoist(Instruction *I) {
268
8.67k
    return getTLI()->isProfitableToHoist(I);
269
8.67k
  }
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*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::isProfitableToHoist(llvm::Instruction*)
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isProfitableToHoist(llvm::Instruction*)
Line
Count
Source
267
64
  bool isProfitableToHoist(Instruction *I) {
268
64
    return getTLI()->isProfitableToHoist(I);
269
64
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isProfitableToHoist(llvm::Instruction*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isProfitableToHoist(llvm::Instruction*)
Line
Count
Source
267
33.6k
  bool isProfitableToHoist(Instruction *I) {
268
33.6k
    return getTLI()->isProfitableToHoist(I);
269
33.6k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isProfitableToHoist(llvm::Instruction*)
270
271
674
  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
639
  bool useAA() const { return getST()->useAA(); }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::useAA() const
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
18.0k
  bool isTypeLegal(Type *Ty) {
274
18.0k
    EVT VT = getTLI()->getValueType(DL, Ty);
275
18.0k
    return getTLI()->isTypeLegal(VT);
276
18.0k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isTypeLegal(llvm::Type*)
Line
Count
Source
273
17.2k
  bool isTypeLegal(Type *Ty) {
274
17.2k
    EVT VT = getTLI()->getValueType(DL, Ty);
275
17.2k
    return getTLI()->isTypeLegal(VT);
276
17.2k
  }
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
160
  bool isTypeLegal(Type *Ty) {
274
160
    EVT VT = getTLI()->getValueType(DL, Ty);
275
160
    return getTLI()->isTypeLegal(VT);
276
160
  }
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
75
  bool isTypeLegal(Type *Ty) {
274
75
    EVT VT = getTLI()->getValueType(DL, Ty);
275
75
    return getTLI()->isTypeLegal(VT);
276
75
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::isTypeLegal(llvm::Type*)
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.06M
                 ArrayRef<const Value *> Operands) {
280
6.06M
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
6.06M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
279
5.47M
                 ArrayRef<const Value *> Operands) {
280
5.47M
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
5.47M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
279
1.84k
                 ArrayRef<const Value *> Operands) {
280
1.84k
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
1.84k
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
279
38.1k
                 ArrayRef<const Value *> Operands) {
280
38.1k
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
38.1k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
279
92.2k
                 ArrayRef<const Value *> Operands) {
280
92.2k
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
92.2k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
279
29
                 ArrayRef<const Value *> Operands) {
280
29
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
29
  }
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
335
                 ArrayRef<const Value *> Operands) {
280
335
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
335
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
279
1.08k
                 ArrayRef<const Value *> Operands) {
280
1.08k
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
1.08k
  }
llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
279
132
                 ArrayRef<const Value *> Operands) {
280
132
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
132
  }
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
461k
                 ArrayRef<const Value *> Operands) {
280
461k
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
281
461k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
282
283
1.56M
  int getExtCost(const Instruction *I, const Value *Src) {
284
1.56M
    if (getTLI()->isExtFree(I))
285
592k
      return TargetTransformInfo::TCC_Free;
286
974k
287
974k
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)599k
)
288
901k
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
592k
        if (getTLI()->isExtLoad(LI, I, DL))
290
583k
          return TargetTransformInfo::TCC_Free;
291
390k
292
390k
    return TargetTransformInfo::TCC_Basic;
293
390k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
283
1.37M
  int getExtCost(const Instruction *I, const Value *Src) {
284
1.37M
    if (getTLI()->isExtFree(I))
285
566k
      return TargetTransformInfo::TCC_Free;
286
811k
287
811k
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)504k
)
288
738k
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
485k
        if (getTLI()->isExtLoad(LI, I, DL))
290
477k
          return TargetTransformInfo::TCC_Free;
291
334k
292
334k
    return TargetTransformInfo::TCC_Basic;
293
334k
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
283
7
  int getExtCost(const Instruction *I, const Value *Src) {
284
7
    if (getTLI()->isExtFree(I))
285
0
      return TargetTransformInfo::TCC_Free;
286
7
287
7
    if (isa<ZExtInst>(I) || isa<SExtInst>(I))
288
7
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
0
        if (getTLI()->isExtLoad(LI, I, DL))
290
0
          return TargetTransformInfo::TCC_Free;
291
7
292
7
    return TargetTransformInfo::TCC_Basic;
293
7
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
283
221
  int getExtCost(const Instruction *I, const Value *Src) {
284
221
    if (getTLI()->isExtFree(I))
285
109
      return TargetTransformInfo::TCC_Free;
286
112
287
112
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)103
)
288
112
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
34
        if (getTLI()->isExtLoad(LI, I, DL))
290
30
          return TargetTransformInfo::TCC_Free;
291
82
292
82
    return TargetTransformInfo::TCC_Basic;
293
82
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
283
69.0k
  int getExtCost(const Instruction *I, const Value *Src) {
284
69.0k
    if (getTLI()->isExtFree(I))
285
0
      return TargetTransformInfo::TCC_Free;
286
69.0k
287
69.0k
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)39.0k
)
288
69.0k
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
50.9k
        if (getTLI()->isExtLoad(LI, I, DL))
290
50.5k
          return TargetTransformInfo::TCC_Free;
291
18.4k
292
18.4k
    return TargetTransformInfo::TCC_Basic;
293
18.4k
  }
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
245
  int getExtCost(const Instruction *I, const Value *Src) {
284
245
    if (getTLI()->isExtFree(I))
285
6
      return TargetTransformInfo::TCC_Free;
286
239
287
239
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)104
)
288
239
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
124
        if (getTLI()->isExtLoad(LI, I, DL))
290
119
          return TargetTransformInfo::TCC_Free;
291
120
292
120
    return TargetTransformInfo::TCC_Basic;
293
120
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
283
23
  int getExtCost(const Instruction *I, const Value *Src) {
284
23
    if (getTLI()->isExtFree(I))
285
0
      return TargetTransformInfo::TCC_Free;
286
23
287
23
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)8
)
288
23
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
9
        if (getTLI()->isExtLoad(LI, I, DL))
290
9
          return TargetTransformInfo::TCC_Free;
291
14
292
14
    return TargetTransformInfo::TCC_Basic;
293
14
  }
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
118k
  int getExtCost(const Instruction *I, const Value *Src) {
284
118k
    if (getTLI()->isExtFree(I))
285
25.3k
      return TargetTransformInfo::TCC_Free;
286
93.1k
287
93.1k
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)55.4k
)
288
93.1k
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
289
55.8k
        if (getTLI()->isExtLoad(LI, I, DL))
290
55.6k
          return TargetTransformInfo::TCC_Free;
291
37.5k
292
37.5k
    return TargetTransformInfo::TCC_Basic;
293
37.5k
  }
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, const User *U) {
297
4
    return BaseT::getIntrinsicCost(IID, RetTy, Arguments, U);
298
4
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>, llvm::User const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>, llvm::User const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>, llvm::User const*)
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>, llvm::User const*)
Line
Count
Source
296
2
                            ArrayRef<const Value *> Arguments, const User *U) {
297
2
    return BaseT::getIntrinsicCost(IID, RetTy, Arguments, U);
298
2
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>, llvm::User const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>, llvm::User const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>, llvm::User const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>, llvm::User const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>, llvm::User const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>, llvm::User const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>, llvm::User const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>, llvm::User const*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>, llvm::User const*)
Line
Count
Source
296
2
                            ArrayRef<const Value *> Arguments, const User *U) {
297
2
    return BaseT::getIntrinsicCost(IID, RetTy, Arguments, U);
298
2
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>, llvm::User const*)
299
300
  unsigned getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,
301
968k
                            ArrayRef<Type *> ParamTys, const User *U) {
302
968k
    if (IID == Intrinsic::cttz) {
303
6.85k
      if (getTLI()->isCheapToSpeculateCttz())
304
3.70k
        return TargetTransformInfo::TCC_Basic;
305
3.14k
      return TargetTransformInfo::TCC_Expensive;
306
3.14k
    }
307
962k
308
962k
    if (IID == Intrinsic::ctlz) {
309
10.3k
      if (getTLI()->isCheapToSpeculateCtlz())
310
6.37k
        return TargetTransformInfo::TCC_Basic;
311
3.94k
      return TargetTransformInfo::TCC_Expensive;
312
3.94k
    }
313
951k
314
951k
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys, U);
315
951k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>, llvm::User const*)
Line
Count
Source
301
755k
                            ArrayRef<Type *> ParamTys, const User *U) {
302
755k
    if (IID == Intrinsic::cttz) {
303
688
      if (getTLI()->isCheapToSpeculateCttz())
304
688
        return TargetTransformInfo::TCC_Basic;
305
0
      return TargetTransformInfo::TCC_Expensive;
306
0
    }
307
754k
308
754k
    if (IID == Intrinsic::ctlz) {
309
1.51k
      if (getTLI()->isCheapToSpeculateCtlz())
310
1.51k
        return TargetTransformInfo::TCC_Basic;
311
0
      return TargetTransformInfo::TCC_Expensive;
312
0
    }
313
753k
314
753k
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys, U);
315
753k
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>, llvm::User const*)
Line
Count
Source
301
2
                            ArrayRef<Type *> ParamTys, const User *U) {
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, U);
315
2
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>, llvm::User const*)
Line
Count
Source
301
537
                            ArrayRef<Type *> ParamTys, const User *U) {
302
537
    if (IID == Intrinsic::cttz) {
303
12
      if (getTLI()->isCheapToSpeculateCttz())
304
12
        return TargetTransformInfo::TCC_Basic;
305
0
      return TargetTransformInfo::TCC_Expensive;
306
0
    }
307
525
308
525
    if (IID == Intrinsic::ctlz) {
309
12
      if (getTLI()->isCheapToSpeculateCtlz())
310
12
        return TargetTransformInfo::TCC_Basic;
311
0
      return TargetTransformInfo::TCC_Expensive;
312
0
    }
313
513
314
513
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys, U);
315
513
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>, llvm::User const*)
Line
Count
Source
301
57.5k
                            ArrayRef<Type *> ParamTys, const User *U) {
302
57.5k
    if (IID == Intrinsic::cttz) {
303
2.03k
      if (getTLI()->isCheapToSpeculateCttz())
304
1.97k
        return TargetTransformInfo::TCC_Basic;
305
60
      return TargetTransformInfo::TCC_Expensive;
306
60
    }
307
55.4k
308
55.4k
    if (IID == Intrinsic::ctlz) {
309
4.23k
      if (getTLI()->isCheapToSpeculateCtlz())
310
3.80k
        return TargetTransformInfo::TCC_Basic;
311
437
      return TargetTransformInfo::TCC_Expensive;
312
437
    }
313
51.2k
314
51.2k
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys, U);
315
51.2k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>, llvm::User const*)
Line
Count
Source
301
14
                            ArrayRef<Type *> ParamTys, const User *U) {
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, U);
315
14
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>, llvm::User const*)
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>, llvm::User const*)
Line
Count
Source
301
5
                            ArrayRef<Type *> ParamTys, const User *U) {
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, U);
315
3
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>, llvm::User const*)
Line
Count
Source
301
16
                            ArrayRef<Type *> ParamTys, const User *U) {
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, U);
315
16
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>, llvm::User const*)
Line
Count
Source
301
59
                            ArrayRef<Type *> ParamTys, const User *U) {
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, U);
315
57
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>, llvm::User const*)
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>, llvm::User const*)
Line
Count
Source
301
20
                            ArrayRef<Type *> ParamTys, const User *U) {
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, U);
315
20
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>, llvm::User const*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>, llvm::User const*)
Line
Count
Source
301
155k
                            ArrayRef<Type *> ParamTys, const User *U) {
302
155k
    if (IID == Intrinsic::cttz) {
303
4.11k
      if (getTLI()->isCheapToSpeculateCttz())
304
1.02k
        return TargetTransformInfo::TCC_Basic;
305
3.08k
      return TargetTransformInfo::TCC_Expensive;
306
3.08k
    }
307
151k
308
151k
    if (IID == Intrinsic::ctlz) {
309
4.55k
      if (getTLI()->isCheapToSpeculateCtlz())
310
1.04k
        return TargetTransformInfo::TCC_Basic;
311
3.51k
      return TargetTransformInfo::TCC_Expensive;
312
3.51k
    }
313
146k
314
146k
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys, U);
315
146k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>, llvm::User const*)
316
317
  unsigned getEstimatedNumberOfCaseClusters(const SwitchInst &SI,
318
31.4k
                                            unsigned &JumpTableSize) {
319
31.4k
    /// Try to find the estimated number of clusters. Note that the number of
320
31.4k
    /// clusters identified in this function could be different from the actural
321
31.4k
    /// numbers found in lowering. This function ignore switches that are
322
31.4k
    /// lowered with a mix of jump table / bit test / BTree. This function was
323
31.4k
    /// initially intended to be used when estimating the cost of switch in
324
31.4k
    /// inline cost heuristic, but it's a generic cost model to be used in other
325
31.4k
    /// places (e.g., in loop unrolling).
326
31.4k
    unsigned N = SI.getNumCases();
327
31.4k
    const TargetLoweringBase *TLI = getTLI();
328
31.4k
    const DataLayout &DL = this->getDataLayout();
329
31.4k
330
31.4k
    JumpTableSize = 0;
331
31.4k
    bool IsJTAllowed = TLI->areJTsAllowed(SI.getParent()->getParent());
332
31.4k
333
31.4k
    // Early exit if both a jump table and bit test are not allowed.
334
31.4k
    if (N < 1 || (!IsJTAllowed && 
DL.getIndexSizeInBits(0u) < N0
))
335
0
      return N;
336
31.4k
337
31.4k
    APInt MaxCaseVal = SI.case_begin()->getCaseValue()->getValue();
338
31.4k
    APInt MinCaseVal = MaxCaseVal;
339
303k
    for (auto CI : SI.cases()) {
340
303k
      const APInt &CaseVal = CI.getCaseValue()->getValue();
341
303k
      if (CaseVal.sgt(MaxCaseVal))
342
59.0k
        MaxCaseVal = CaseVal;
343
303k
      if (CaseVal.slt(MinCaseVal))
344
30.0k
        MinCaseVal = CaseVal;
345
303k
    }
346
31.4k
347
31.4k
    // Check if suitable for a bit test
348
31.4k
    if (N <= DL.getIndexSizeInBits(0u)) {
349
30.8k
      SmallPtrSet<const BasicBlock *, 4> Dests;
350
30.8k
      for (auto I : SI.cases())
351
196k
        Dests.insert(I.getCaseSuccessor());
352
30.8k
353
30.8k
      if (TLI->isSuitableForBitTests(Dests.size(), N, MinCaseVal, MaxCaseVal,
354
30.8k
                                     DL))
355
3.38k
        return 1;
356
28.0k
    }
357
28.0k
358
28.0k
    // Check if suitable for a jump table.
359
28.0k
    if (IsJTAllowed) {
360
28.0k
      if (N < 2 || N < TLI->getMinimumJumpTableEntries())
361
17.5k
        return N;
362
10.5k
      uint64_t Range =
363
10.5k
          (MaxCaseVal - MinCaseVal)
364
10.5k
              .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1;
365
10.5k
      // Check whether a range of clusters is dense enough for a jump table
366
10.5k
      if (TLI->isSuitableForJumpTable(&SI, N, Range)) {
367
8.59k
        JumpTableSize = Range;
368
8.59k
        return 1;
369
8.59k
      }
370
1.90k
    }
371
1.90k
    return N;
372
1.90k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Line
Count
Source
318
23.7k
                                            unsigned &JumpTableSize) {
319
23.7k
    /// Try to find the estimated number of clusters. Note that the number of
320
23.7k
    /// clusters identified in this function could be different from the actural
321
23.7k
    /// numbers found in lowering. This function ignore switches that are
322
23.7k
    /// lowered with a mix of jump table / bit test / BTree. This function was
323
23.7k
    /// initially intended to be used when estimating the cost of switch in
324
23.7k
    /// inline cost heuristic, but it's a generic cost model to be used in other
325
23.7k
    /// places (e.g., in loop unrolling).
326
23.7k
    unsigned N = SI.getNumCases();
327
23.7k
    const TargetLoweringBase *TLI = getTLI();
328
23.7k
    const DataLayout &DL = this->getDataLayout();
329
23.7k
330
23.7k
    JumpTableSize = 0;
331
23.7k
    bool IsJTAllowed = TLI->areJTsAllowed(SI.getParent()->getParent());
332
23.7k
333
23.7k
    // Early exit if both a jump table and bit test are not allowed.
334
23.7k
    if (N < 1 || (!IsJTAllowed && 
DL.getIndexSizeInBits(0u) < N0
))
335
0
      return N;
336
23.7k
337
23.7k
    APInt MaxCaseVal = SI.case_begin()->getCaseValue()->getValue();
338
23.7k
    APInt MinCaseVal = MaxCaseVal;
339
270k
    for (auto CI : SI.cases()) {
340
270k
      const APInt &CaseVal = CI.getCaseValue()->getValue();
341
270k
      if (CaseVal.sgt(MaxCaseVal))
342
42.7k
        MaxCaseVal = CaseVal;
343
270k
      if (CaseVal.slt(MinCaseVal))
344
25.3k
        MinCaseVal = CaseVal;
345
270k
    }
346
23.7k
347
23.7k
    // Check if suitable for a bit test
348
23.7k
    if (N <= DL.getIndexSizeInBits(0u)) {
349
23.0k
      SmallPtrSet<const BasicBlock *, 4> Dests;
350
23.0k
      for (auto I : SI.cases())
351
163k
        Dests.insert(I.getCaseSuccessor());
352
23.0k
353
23.0k
      if (TLI->isSuitableForBitTests(Dests.size(), N, MinCaseVal, MaxCaseVal,
354
23.0k
                                     DL))
355
2.11k
        return 1;
356
21.5k
    }
357
21.5k
358
21.5k
    // Check if suitable for a jump table.
359
21.5k
    if (IsJTAllowed) {
360
21.5k
      if (N < 2 || N < TLI->getMinimumJumpTableEntries())
361
13.4k
        return N;
362
8.16k
      uint64_t Range =
363
8.16k
          (MaxCaseVal - MinCaseVal)
364
8.16k
              .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1;
365
8.16k
      // Check whether a range of clusters is dense enough for a jump table
366
8.16k
      if (TLI->isSuitableForJumpTable(&SI, N, Range)) {
367
6.66k
        JumpTableSize = Range;
368
6.66k
        return 1;
369
6.66k
      }
370
1.49k
    }
371
1.49k
    return N;
372
1.49k
  }
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
1.95k
                                            unsigned &JumpTableSize) {
319
1.95k
    /// Try to find the estimated number of clusters. Note that the number of
320
1.95k
    /// clusters identified in this function could be different from the actural
321
1.95k
    /// numbers found in lowering. This function ignore switches that are
322
1.95k
    /// lowered with a mix of jump table / bit test / BTree. This function was
323
1.95k
    /// initially intended to be used when estimating the cost of switch in
324
1.95k
    /// inline cost heuristic, but it's a generic cost model to be used in other
325
1.95k
    /// places (e.g., in loop unrolling).
326
1.95k
    unsigned N = SI.getNumCases();
327
1.95k
    const TargetLoweringBase *TLI = getTLI();
328
1.95k
    const DataLayout &DL = this->getDataLayout();
329
1.95k
330
1.95k
    JumpTableSize = 0;
331
1.95k
    bool IsJTAllowed = TLI->areJTsAllowed(SI.getParent()->getParent());
332
1.95k
333
1.95k
    // Early exit if both a jump table and bit test are not allowed.
334
1.95k
    if (N < 1 || (!IsJTAllowed && 
DL.getIndexSizeInBits(0u) < N0
))
335
0
      return N;
336
1.95k
337
1.95k
    APInt MaxCaseVal = SI.case_begin()->getCaseValue()->getValue();
338
1.95k
    APInt MinCaseVal = MaxCaseVal;
339
7.86k
    for (auto CI : SI.cases()) {
340
7.86k
      const APInt &CaseVal = CI.getCaseValue()->getValue();
341
7.86k
      if (CaseVal.sgt(MaxCaseVal))
342
3.60k
        MaxCaseVal = CaseVal;
343
7.86k
      if (CaseVal.slt(MinCaseVal))
344
1.34k
        MinCaseVal = CaseVal;
345
7.86k
    }
346
1.95k
347
1.95k
    // Check if suitable for a bit test
348
1.95k
    if (N <= DL.getIndexSizeInBits(0u)) {
349
1.95k
      SmallPtrSet<const BasicBlock *, 4> Dests;
350
1.95k
      for (auto I : SI.cases())
351
7.86k
        Dests.insert(I.getCaseSuccessor());
352
1.95k
353
1.95k
      if (TLI->isSuitableForBitTests(Dests.size(), N, MinCaseVal, MaxCaseVal,
354
1.95k
                                     DL))
355
90
        return 1;
356
1.86k
    }
357
1.86k
358
1.86k
    // Check if suitable for a jump table.
359
1.86k
    if (IsJTAllowed) {
360
1.86k
      if (N < 2 || N < TLI->getMinimumJumpTableEntries())
361
1.17k
        return N;
362
690
      uint64_t Range =
363
690
          (MaxCaseVal - MinCaseVal)
364
690
              .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1;
365
690
      // Check whether a range of clusters is dense enough for a jump table
366
690
      if (TLI->isSuitableForJumpTable(&SI, N, Range)) {
367
567
        JumpTableSize = Range;
368
567
        return 1;
369
567
      }
370
123
    }
371
123
    return N;
372
123
  }
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::RISCVTTIImpl>::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
5.78k
                                            unsigned &JumpTableSize) {
319
5.78k
    /// Try to find the estimated number of clusters. Note that the number of
320
5.78k
    /// clusters identified in this function could be different from the actural
321
5.78k
    /// numbers found in lowering. This function ignore switches that are
322
5.78k
    /// lowered with a mix of jump table / bit test / BTree. This function was
323
5.78k
    /// initially intended to be used when estimating the cost of switch in
324
5.78k
    /// inline cost heuristic, but it's a generic cost model to be used in other
325
5.78k
    /// places (e.g., in loop unrolling).
326
5.78k
    unsigned N = SI.getNumCases();
327
5.78k
    const TargetLoweringBase *TLI = getTLI();
328
5.78k
    const DataLayout &DL = this->getDataLayout();
329
5.78k
330
5.78k
    JumpTableSize = 0;
331
5.78k
    bool IsJTAllowed = TLI->areJTsAllowed(SI.getParent()->getParent());
332
5.78k
333
5.78k
    // Early exit if both a jump table and bit test are not allowed.
334
5.78k
    if (N < 1 || (!IsJTAllowed && 
DL.getIndexSizeInBits(0u) < N0
))
335
0
      return N;
336
5.78k
337
5.78k
    APInt MaxCaseVal = SI.case_begin()->getCaseValue()->getValue();
338
5.78k
    APInt MinCaseVal = MaxCaseVal;
339
24.8k
    for (auto CI : SI.cases()) {
340
24.8k
      const APInt &CaseVal = CI.getCaseValue()->getValue();
341
24.8k
      if (CaseVal.sgt(MaxCaseVal))
342
12.7k
        MaxCaseVal = CaseVal;
343
24.8k
      if (CaseVal.slt(MinCaseVal))
344
3.39k
        MinCaseVal = CaseVal;
345
24.8k
    }
346
5.78k
347
5.78k
    // Check if suitable for a bit test
348
5.78k
    if (N <= DL.getIndexSizeInBits(0u)) {
349
5.78k
      SmallPtrSet<const BasicBlock *, 4> Dests;
350
5.78k
      for (auto I : SI.cases())
351
24.7k
        Dests.insert(I.getCaseSuccessor());
352
5.78k
353
5.78k
      if (TLI->isSuitableForBitTests(Dests.size(), N, MinCaseVal, MaxCaseVal,
354
5.78k
                                     DL))
355
1.17k
        return 1;
356
4.60k
    }
357
4.60k
358
4.60k
    // Check if suitable for a jump table.
359
4.60k
    if (IsJTAllowed) {
360
4.60k
      if (N < 2 || N < TLI->getMinimumJumpTableEntries())
361
2.96k
        return N;
362
1.64k
      uint64_t Range =
363
1.64k
          (MaxCaseVal - MinCaseVal)
364
1.64k
              .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1;
365
1.64k
      // Check whether a range of clusters is dense enough for a jump table
366
1.64k
      if (TLI->isSuitableForJumpTable(&SI, N, Range)) {
367
1.36k
        JumpTableSize = Range;
368
1.36k
        return 1;
369
1.36k
      }
370
284
    }
371
284
    return N;
372
284
  }
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::RISCVTTIImpl>::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::RISCVTTIImpl>::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.53k
;
382
61.3k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::shouldBuildLookupTables()
Line
Count
Source
378
57.7k
  bool shouldBuildLookupTables() {
379
57.7k
    const TargetLoweringBase *TLI = getTLI();
380
57.7k
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
381
57.7k
           
TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other)0
;
382
57.7k
  }
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.11k
  bool shouldBuildLookupTables() {
379
1.11k
    const TargetLoweringBase *TLI = getTLI();
380
1.11k
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
381
1.11k
           
TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other)0
;
382
1.11k
  }
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::RISCVTTIImpl>::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.52k
  bool shouldBuildLookupTables() {
379
2.52k
    const TargetLoweringBase *TLI = getTLI();
380
2.52k
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
381
2.52k
           TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other);
382
2.52k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::shouldBuildLookupTables()
383
384
50
  bool haveFastSqrt(Type *Ty) {
385
50
    const TargetLoweringBase *TLI = getTLI();
386
50
    EVT VT = TLI->getValueType(DL, Ty);
387
50
    return TLI->isTypeLegal(VT) &&
388
50
           
TLI->isOperationLegalOrCustom(ISD::FSQRT, VT)48
;
389
50
  }
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
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::haveFastSqrt(llvm::Type*)
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
26
  bool haveFastSqrt(Type *Ty) {
385
26
    const TargetLoweringBase *TLI = getTLI();
386
26
    EVT VT = TLI->getValueType(DL, Ty);
387
26
    return TLI->isTypeLegal(VT) &&
388
26
           TLI->isOperationLegalOrCustom(ISD::FSQRT, VT);
389
26
  }
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
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::isFCmpOrdCheaperThanFCmpZero(llvm::Type*)
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
383k
  unsigned getFPOpCost(Type *Ty) {
396
383k
    // Check whether FADD is available, as a proxy for floating-point in
397
383k
    // general.
398
383k
    const TargetLoweringBase *TLI = getTLI();
399
383k
    EVT VT = TLI->getValueType(DL, Ty);
400
383k
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
401
382k
      return TargetTransformInfo::TCC_Basic;
402
1.27k
    return TargetTransformInfo::TCC_Expensive;
403
1.27k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getFPOpCost(llvm::Type*)
Line
Count
Source
395
381k
  unsigned getFPOpCost(Type *Ty) {
396
381k
    // Check whether FADD is available, as a proxy for floating-point in
397
381k
    // general.
398
381k
    const TargetLoweringBase *TLI = getTLI();
399
381k
    EVT VT = TLI->getValueType(DL, Ty);
400
381k
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
401
380k
      return TargetTransformInfo::TCC_Basic;
402
1.07k
    return TargetTransformInfo::TCC_Expensive;
403
1.07k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getFPOpCost(llvm::Type*)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getFPOpCost(llvm::Type*)
Line
Count
Source
395
36
  unsigned getFPOpCost(Type *Ty) {
396
36
    // Check whether FADD is available, as a proxy for floating-point in
397
36
    // general.
398
36
    const TargetLoweringBase *TLI = getTLI();
399
36
    EVT VT = TLI->getValueType(DL, Ty);
400
36
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
401
36
      return TargetTransformInfo::TCC_Basic;
402
0
    return TargetTransformInfo::TCC_Expensive;
403
0
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getFPOpCost(llvm::Type*)
Line
Count
Source
395
312
  unsigned getFPOpCost(Type *Ty) {
396
312
    // Check whether FADD is available, as a proxy for floating-point in
397
312
    // general.
398
312
    const TargetLoweringBase *TLI = getTLI();
399
312
    EVT VT = TLI->getValueType(DL, Ty);
400
312
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
401
114
      return TargetTransformInfo::TCC_Basic;
402
198
    return TargetTransformInfo::TCC_Expensive;
403
198
  }
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::RISCVTTIImpl>::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
2.15k
  unsigned getFPOpCost(Type *Ty) {
396
2.15k
    // Check whether FADD is available, as a proxy for floating-point in
397
2.15k
    // general.
398
2.15k
    const TargetLoweringBase *TLI = getTLI();
399
2.15k
    EVT VT = TLI->getValueType(DL, Ty);
400
2.15k
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
401
2.15k
      return TargetTransformInfo::TCC_Basic;
402
0
    return TargetTransformInfo::TCC_Expensive;
403
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getFPOpCost(llvm::Type*)
404
405
26.0M
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
26.0M
    const TargetLoweringBase *TLI = getTLI();
407
26.0M
    switch (Opcode) {
408
26.0M
    
default: break25.3M
;
409
26.0M
    case Instruction::Trunc:
410
710k
      if (TLI->isTruncateFree(OpTy, Ty))
411
664k
        return TargetTransformInfo::TCC_Free;
412
45.8k
      return TargetTransformInfo::TCC_Basic;
413
45.8k
    case Instruction::ZExt:
414
0
      if (TLI->isZExtFree(OpTy, Ty))
415
0
        return TargetTransformInfo::TCC_Free;
416
0
      return TargetTransformInfo::TCC_Basic;
417
0
418
204
    case Instruction::AddrSpaceCast:
419
204
      if (TLI->isFreeAddrSpaceCast(OpTy->getPointerAddressSpace(),
420
204
                                   Ty->getPointerAddressSpace()))
421
132
        return TargetTransformInfo::TCC_Free;
422
72
      return TargetTransformInfo::TCC_Basic;
423
25.3M
    }
424
25.3M
425
25.3M
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
426
25.3M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
405
23.8M
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
23.8M
    const TargetLoweringBase *TLI = getTLI();
407
23.8M
    switch (Opcode) {
408
23.8M
    
default: break23.2M
;
409
23.8M
    case Instruction::Trunc:
410
650k
      if (TLI->isTruncateFree(OpTy, Ty))
411
608k
        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
0
418
0
    case Instruction::AddrSpaceCast:
419
0
      if (TLI->isFreeAddrSpaceCast(OpTy->getPointerAddressSpace(),
420
0
                                   Ty->getPointerAddressSpace()))
421
0
        return TargetTransformInfo::TCC_Free;
422
0
      return TargetTransformInfo::TCC_Basic;
423
23.2M
    }
424
23.2M
425
23.2M
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
426
23.2M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
405
386
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
386
    const TargetLoweringBase *TLI = getTLI();
407
386
    switch (Opcode) {
408
386
    default: break;
409
386
    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
0
418
0
    case Instruction::AddrSpaceCast:
419
0
      if (TLI->isFreeAddrSpaceCast(OpTy->getPointerAddressSpace(),
420
0
                                   Ty->getPointerAddressSpace()))
421
0
        return TargetTransformInfo::TCC_Free;
422
0
      return TargetTransformInfo::TCC_Basic;
423
386
    }
424
386
425
386
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
426
386
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
405
6.53k
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
6.53k
    const TargetLoweringBase *TLI = getTLI();
407
6.53k
    switch (Opcode) {
408
6.53k
    
default: break6.28k
;
409
6.53k
    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
0
418
204
    case Instruction::AddrSpaceCast:
419
204
      if (TLI->isFreeAddrSpaceCast(OpTy->getPointerAddressSpace(),
420
204
                                   Ty->getPointerAddressSpace()))
421
132
        return TargetTransformInfo::TCC_Free;
422
72
      return TargetTransformInfo::TCC_Basic;
423
6.28k
    }
424
6.28k
425
6.28k
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
426
6.28k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
405
508k
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
508k
    const TargetLoweringBase *TLI = getTLI();
407
508k
    switch (Opcode) {
408
508k
    
default: break499k
;
409
508k
    case Instruction::Trunc:
410
8.90k
      if (TLI->isTruncateFree(OpTy, Ty))
411
5.81k
        return TargetTransformInfo::TCC_Free;
412
3.09k
      return TargetTransformInfo::TCC_Basic;
413
3.09k
    case Instruction::ZExt:
414
0
      if (TLI->isZExtFree(OpTy, Ty))
415
0
        return TargetTransformInfo::TCC_Free;
416
0
      return TargetTransformInfo::TCC_Basic;
417
0
418
0
    case Instruction::AddrSpaceCast:
419
0
      if (TLI->isFreeAddrSpaceCast(OpTy->getPointerAddressSpace(),
420
0
                                   Ty->getPointerAddressSpace()))
421
0
        return TargetTransformInfo::TCC_Free;
422
0
      return TargetTransformInfo::TCC_Basic;
423
499k
    }
424
499k
425
499k
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
426
499k
  }
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
0
418
0
    case Instruction::AddrSpaceCast:
419
0
      if (TLI->isFreeAddrSpaceCast(OpTy->getPointerAddressSpace(),
420
0
                                   Ty->getPointerAddressSpace()))
421
0
        return TargetTransformInfo::TCC_Free;
422
0
      return TargetTransformInfo::TCC_Basic;
423
185
    }
424
185
425
185
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
426
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
0
418
0
    case Instruction::AddrSpaceCast:
419
0
      if (TLI->isFreeAddrSpaceCast(OpTy->getPointerAddressSpace(),
420
0
                                   Ty->getPointerAddressSpace()))
421
0
        return TargetTransformInfo::TCC_Free;
422
0
      return TargetTransformInfo::TCC_Basic;
423
102
    }
424
102
425
102
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
426
102
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
405
6.46k
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
6.46k
    const TargetLoweringBase *TLI = getTLI();
407
6.46k
    switch (Opcode) {
408
6.46k
    
default: break6.18k
;
409
6.46k
    case Instruction::Trunc:
410
272
      if (TLI->isTruncateFree(OpTy, Ty))
411
217
        return TargetTransformInfo::TCC_Free;
412
55
      return TargetTransformInfo::TCC_Basic;
413
55
    case Instruction::ZExt:
414
0
      if (TLI->isZExtFree(OpTy, Ty))
415
0
        return TargetTransformInfo::TCC_Free;
416
0
      return TargetTransformInfo::TCC_Basic;
417
0
418
0
    case Instruction::AddrSpaceCast:
419
0
      if (TLI->isFreeAddrSpaceCast(OpTy->getPointerAddressSpace(),
420
0
                                   Ty->getPointerAddressSpace()))
421
0
        return TargetTransformInfo::TCC_Free;
422
0
      return TargetTransformInfo::TCC_Basic;
423
6.18k
    }
424
6.18k
425
6.18k
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
426
6.18k
  }
llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
405
4
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
4
    const TargetLoweringBase *TLI = getTLI();
407
4
    switch (Opcode) {
408
4
    
default: break3
;
409
4
    case Instruction::Trunc:
410
1
      if (TLI->isTruncateFree(OpTy, Ty))
411
1
        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
0
418
0
    case Instruction::AddrSpaceCast:
419
0
      if (TLI->isFreeAddrSpaceCast(OpTy->getPointerAddressSpace(),
420
0
                                   Ty->getPointerAddressSpace()))
421
0
        return TargetTransformInfo::TCC_Free;
422
0
      return TargetTransformInfo::TCC_Basic;
423
3
    }
424
3
425
3
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
426
3
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
405
1.08k
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
1.08k
    const TargetLoweringBase *TLI = getTLI();
407
1.08k
    switch (Opcode) {
408
1.08k
    
default: break1.06k
;
409
1.08k
    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
0
418
0
    case Instruction::AddrSpaceCast:
419
0
      if (TLI->isFreeAddrSpaceCast(OpTy->getPointerAddressSpace(),
420
0
                                   Ty->getPointerAddressSpace()))
421
0
        return TargetTransformInfo::TCC_Free;
422
0
      return TargetTransformInfo::TCC_Basic;
423
1.06k
    }
424
1.06k
425
1.06k
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
426
1.06k
  }
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.63M
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
406
1.63M
    const TargetLoweringBase *TLI = getTLI();
407
1.63M
    switch (Opcode) {
408
1.63M
    
default: break1.58M
;
409
1.63M
    case Instruction::Trunc:
410
50.1k
      if (TLI->isTruncateFree(OpTy, Ty))
411
50.1k
        return TargetTransformInfo::TCC_Free;
412
54
      return TargetTransformInfo::TCC_Basic;
413
54
    case Instruction::ZExt:
414
0
      if (TLI->isZExtFree(OpTy, Ty))
415
0
        return TargetTransformInfo::TCC_Free;
416
0
      return TargetTransformInfo::TCC_Basic;
417
0
418
0
    case Instruction::AddrSpaceCast:
419
0
      if (TLI->isFreeAddrSpaceCast(OpTy->getPointerAddressSpace(),
420
0
                                   Ty->getPointerAddressSpace()))
421
0
        return TargetTransformInfo::TCC_Free;
422
0
      return TargetTransformInfo::TCC_Basic;
423
1.58M
    }
424
1.58M
425
1.58M
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
426
1.58M
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
427
428
790k
  unsigned getInliningThresholdMultiplier() { return 1; }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
428
527k
  unsigned getInliningThresholdMultiplier() { return 1; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getInliningThresholdMultiplier()
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
428
61.9k
  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
428
7
  unsigned getInliningThresholdMultiplier() { return 1; }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
428
17
  unsigned getInliningThresholdMultiplier() { return 1; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getInliningThresholdMultiplier()
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
428
4
  unsigned getInliningThresholdMultiplier() { return 1; }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
428
200k
  unsigned getInliningThresholdMultiplier() { return 1; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getInliningThresholdMultiplier()
429
430
790k
  int getInlinerVectorBonusPercent() { return 150; }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getInlinerVectorBonusPercent()
Line
Count
Source
430
527k
  int getInlinerVectorBonusPercent() { return 150; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getInlinerVectorBonusPercent()
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getInlinerVectorBonusPercent()
Line
Count
Source
430
61.9k
  int getInlinerVectorBonusPercent() { return 150; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getInlinerVectorBonusPercent()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getInlinerVectorBonusPercent()
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getInlinerVectorBonusPercent()
Line
Count
Source
430
7
  int getInlinerVectorBonusPercent() { return 150; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getInlinerVectorBonusPercent()
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getInlinerVectorBonusPercent()
Line
Count
Source
430
17
  int getInlinerVectorBonusPercent() { return 150; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getInlinerVectorBonusPercent()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getInlinerVectorBonusPercent()
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getInlinerVectorBonusPercent()
Line
Count
Source
430
4
  int getInlinerVectorBonusPercent() { return 150; }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getInlinerVectorBonusPercent()
Line
Count
Source
430
200k
  int getInlinerVectorBonusPercent() { return 150; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getInlinerVectorBonusPercent()
431
432
  void getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
433
389k
                               TTI::UnrollingPreferences &UP) {
434
389k
    // This unrolling functionality is target independent, but to provide some
435
389k
    // motivation for its intended use, for x86:
436
389k
437
389k
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
438
389k
    // Manual, Intel Core models and later have a loop stream detector (and
439
389k
    // associated uop queue) that can benefit from partial unrolling.
440
389k
    // The relevant requirements are:
441
389k
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
442
389k
    //    taken, and none of them may be calls.
443
389k
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
444
389k
445
389k
    // According to the Software Optimization Guide for AMD Family 15h
446
389k
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
447
389k
    // and loop buffer which can benefit from partial unrolling.
448
389k
    // The relevant requirements are:
449
389k
    //  - The loop must have fewer than 16 branches
450
389k
    //  - The loop must have less than 40 uops in all executed loop branches
451
389k
452
389k
    // The number of taken branches in a loop is hard to estimate here, and
453
389k
    // benchmarking has revealed that it is better not to be conservative when
454
389k
    // estimating the branch count. As a result, we'll ignore the branch limits
455
389k
    // until someone finds a case where it matters in practice.
456
389k
457
389k
    unsigned MaxOps;
458
389k
    const TargetSubtargetInfo *ST = getST();
459
389k
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
460
0
      MaxOps = PartialUnrollingThreshold;
461
389k
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
462
22.8k
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
463
366k
    else
464
366k
      return;
465
22.8k
466
22.8k
    // Scan the loop: don't unroll loops with calls.
467
69.1k
    
for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); 22.8k
I != E;
468
56.4k
         
++I46.2k
) {
469
56.4k
      BasicBlock *BB = *I;
470
56.4k
471
380k
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; 
++J323k
)
472
333k
        if (isa<CallInst>(J) || 
isa<InvokeInst>(J)318k
) {
473
15.1k
          ImmutableCallSite CS(&*J);
474
15.1k
          if (const Function *F = CS.getCalledFunction()) {
475
13.8k
            if (!static_cast<T *>(this)->isLoweredToCall(F))
476
4.92k
              continue;
477
10.2k
          }
478
10.2k
479
10.2k
          return;
480
10.2k
        }
481
56.4k
    }
482
22.8k
483
22.8k
    // Enable runtime and partial unrolling up to the specified size.
484
22.8k
    // Enable using trip count upper bound to unroll loops.
485
22.8k
    UP.Partial = UP.Runtime = UP.UpperBound = true;
486
12.6k
    UP.PartialThreshold = MaxOps;
487
12.6k
488
12.6k
    // Avoid unrolling when optimizing for size.
489
12.6k
    UP.OptSizeThreshold = 0;
490
12.6k
    UP.PartialOptSizeThreshold = 0;
491
12.6k
492
12.6k
    // Set number of instructions optimized when "back edge"
493
12.6k
    // becomes "fall through" to default value of 2.
494
12.6k
    UP.BEInsns = 2;
495
12.6k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
Line
Count
Source
433
359k
                               TTI::UnrollingPreferences &UP) {
434
359k
    // This unrolling functionality is target independent, but to provide some
435
359k
    // motivation for its intended use, for x86:
436
359k
437
359k
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
438
359k
    // Manual, Intel Core models and later have a loop stream detector (and
439
359k
    // associated uop queue) that can benefit from partial unrolling.
440
359k
    // The relevant requirements are:
441
359k
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
442
359k
    //    taken, and none of them may be calls.
443
359k
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
444
359k
445
359k
    // According to the Software Optimization Guide for AMD Family 15h
446
359k
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
447
359k
    // and loop buffer which can benefit from partial unrolling.
448
359k
    // The relevant requirements are:
449
359k
    //  - The loop must have fewer than 16 branches
450
359k
    //  - The loop must have less than 40 uops in all executed loop branches
451
359k
452
359k
    // The number of taken branches in a loop is hard to estimate here, and
453
359k
    // benchmarking has revealed that it is better not to be conservative when
454
359k
    // estimating the branch count. As a result, we'll ignore the branch limits
455
359k
    // until someone finds a case where it matters in practice.
456
359k
457
359k
    unsigned MaxOps;
458
359k
    const TargetSubtargetInfo *ST = getST();
459
359k
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
460
0
      MaxOps = PartialUnrollingThreshold;
461
359k
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
462
28
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
463
359k
    else
464
359k
      return;
465
28
466
28
    // Scan the loop: don't unroll loops with calls.
467
68
    
for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); 28
I != E;
468
40
         ++I) {
469
40
      BasicBlock *BB = *I;
470
40
471
279
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; 
++J239
)
472
239
        if (isa<CallInst>(J) || 
isa<InvokeInst>(J)209
) {
473
30
          ImmutableCallSite CS(&*J);
474
30
          if (const Function *F = CS.getCalledFunction()) {
475
30
            if (!static_cast<T *>(this)->isLoweredToCall(F))
476
30
              continue;
477
0
          }
478
0
479
0
          return;
480
0
        }
481
40
    }
482
28
483
28
    // Enable runtime and partial unrolling up to the specified size.
484
28
    // Enable using trip count upper bound to unroll loops.
485
28
    UP.Partial = UP.Runtime = UP.UpperBound = true;
486
28
    UP.PartialThreshold = MaxOps;
487
28
488
28
    // Avoid unrolling when optimizing for size.
489
28
    UP.OptSizeThreshold = 0;
490
28
    UP.PartialOptSizeThreshold = 0;
491
28
492
28
    // Set number of instructions optimized when "back edge"
493
28
    // becomes "fall through" to default value of 2.
494
28
    UP.BEInsns = 2;
495
28
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
Line
Count
Source
433
6.89k
                               TTI::UnrollingPreferences &UP) {
434
6.89k
    // This unrolling functionality is target independent, but to provide some
435
6.89k
    // motivation for its intended use, for x86:
436
6.89k
437
6.89k
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
438
6.89k
    // Manual, Intel Core models and later have a loop stream detector (and
439
6.89k
    // associated uop queue) that can benefit from partial unrolling.
440
6.89k
    // The relevant requirements are:
441
6.89k
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
442
6.89k
    //    taken, and none of them may be calls.
443
6.89k
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
444
6.89k
445
6.89k
    // According to the Software Optimization Guide for AMD Family 15h
446
6.89k
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
447
6.89k
    // and loop buffer which can benefit from partial unrolling.
448
6.89k
    // The relevant requirements are:
449
6.89k
    //  - The loop must have fewer than 16 branches
450
6.89k
    //  - The loop must have less than 40 uops in all executed loop branches
451
6.89k
452
6.89k
    // The number of taken branches in a loop is hard to estimate here, and
453
6.89k
    // benchmarking has revealed that it is better not to be conservative when
454
6.89k
    // estimating the branch count. As a result, we'll ignore the branch limits
455
6.89k
    // until someone finds a case where it matters in practice.
456
6.89k
457
6.89k
    unsigned MaxOps;
458
6.89k
    const TargetSubtargetInfo *ST = getST();
459
6.89k
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
460
0
      MaxOps = PartialUnrollingThreshold;
461
6.89k
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
462
24
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
463
6.87k
    else
464
6.87k
      return;
465
24
466
24
    // Scan the loop: don't unroll loops with calls.
467
51
    
for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); 24
I != E;
468
30
         
++I27
) {
469
30
      BasicBlock *BB = *I;
470
30
471
276
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; 
++J246
)
472
249
        if (isa<CallInst>(J) || 
isa<InvokeInst>(J)234
) {
473
15
          ImmutableCallSite CS(&*J);
474
15
          if (const Function *F = CS.getCalledFunction()) {
475
15
            if (!static_cast<T *>(this)->isLoweredToCall(F))
476
12
              continue;
477
3
          }
478
3
479
3
          return;
480
3
        }
481
30
    }
482
24
483
24
    // Enable runtime and partial unrolling up to the specified size.
484
24
    // Enable using trip count upper bound to unroll loops.
485
24
    UP.Partial = UP.Runtime = UP.UpperBound = true;
486
21
    UP.PartialThreshold = MaxOps;
487
21
488
21
    // Avoid unrolling when optimizing for size.
489
21
    UP.OptSizeThreshold = 0;
490
21
    UP.PartialOptSizeThreshold = 0;
491
21
492
21
    // Set number of instructions optimized when "back edge"
493
21
    // becomes "fall through" to default value of 2.
494
21
    UP.BEInsns = 2;
495
21
  }
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
433
2
                               TTI::UnrollingPreferences &UP) {
434
2
    // This unrolling functionality is target independent, but to provide some
435
2
    // motivation for its intended use, for x86:
436
2
437
2
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
438
2
    // Manual, Intel Core models and later have a loop stream detector (and
439
2
    // associated uop queue) that can benefit from partial unrolling.
440
2
    // The relevant requirements are:
441
2
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
442
2
    //    taken, and none of them may be calls.
443
2
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
444
2
445
2
    // According to the Software Optimization Guide for AMD Family 15h
446
2
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
447
2
    // and loop buffer which can benefit from partial unrolling.
448
2
    // The relevant requirements are:
449
2
    //  - The loop must have fewer than 16 branches
450
2
    //  - The loop must have less than 40 uops in all executed loop branches
451
2
452
2
    // The number of taken branches in a loop is hard to estimate here, and
453
2
    // benchmarking has revealed that it is better not to be conservative when
454
2
    // estimating the branch count. As a result, we'll ignore the branch limits
455
2
    // until someone finds a case where it matters in practice.
456
2
457
2
    unsigned MaxOps;
458
2
    const TargetSubtargetInfo *ST = getST();
459
2
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
460
0
      MaxOps = PartialUnrollingThreshold;
461
2
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
462
0
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
463
2
    else
464
2
      return;
465
0
466
0
    // Scan the loop: don't unroll loops with calls.
467
0
    for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); I != E;
468
0
         ++I) {
469
0
      BasicBlock *BB = *I;
470
0
471
0
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; ++J)
472
0
        if (isa<CallInst>(J) || isa<InvokeInst>(J)) {
473
0
          ImmutableCallSite CS(&*J);
474
0
          if (const Function *F = CS.getCalledFunction()) {
475
0
            if (!static_cast<T *>(this)->isLoweredToCall(F))
476
0
              continue;
477
0
          }
478
0
479
0
          return;
480
0
        }
481
0
    }
482
0
483
0
    // Enable runtime and partial unrolling up to the specified size.
484
0
    // Enable using trip count upper bound to unroll loops.
485
0
    UP.Partial = UP.Runtime = UP.UpperBound = true;
486
0
    UP.PartialThreshold = MaxOps;
487
0
488
0
    // Avoid unrolling when optimizing for size.
489
0
    UP.OptSizeThreshold = 0;
490
0
    UP.PartialOptSizeThreshold = 0;
491
0
492
0
    // Set number of instructions optimized when "back edge"
493
0
    // becomes "fall through" to default value of 2.
494
0
    UP.BEInsns = 2;
495
0
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
Line
Count
Source
433
15
                               TTI::UnrollingPreferences &UP) {
434
15
    // This unrolling functionality is target independent, but to provide some
435
15
    // motivation for its intended use, for x86:
436
15
437
15
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
438
15
    // Manual, Intel Core models and later have a loop stream detector (and
439
15
    // associated uop queue) that can benefit from partial unrolling.
440
15
    // The relevant requirements are:
441
15
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
442
15
    //    taken, and none of them may be calls.
443
15
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
444
15
445
15
    // According to the Software Optimization Guide for AMD Family 15h
446
15
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
447
15
    // and loop buffer which can benefit from partial unrolling.
448
15
    // The relevant requirements are:
449
15
    //  - The loop must have fewer than 16 branches
450
15
    //  - The loop must have less than 40 uops in all executed loop branches
451
15
452
15
    // The number of taken branches in a loop is hard to estimate here, and
453
15
    // benchmarking has revealed that it is better not to be conservative when
454
15
    // estimating the branch count. As a result, we'll ignore the branch limits
455
15
    // until someone finds a case where it matters in practice.
456
15
457
15
    unsigned MaxOps;
458
15
    const TargetSubtargetInfo *ST = getST();
459
15
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
460
0
      MaxOps = PartialUnrollingThreshold;
461
15
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
462
9
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
463
6
    else
464
6
      return;
465
9
466
9
    // Scan the loop: don't unroll loops with calls.
467
18
    
for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); 9
I != E;
468
9
         ++I) {
469
9
      BasicBlock *BB = *I;
470
9
471
93
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; 
++J84
)
472
84
        if (isa<CallInst>(J) || isa<InvokeInst>(J)) {
473
0
          ImmutableCallSite CS(&*J);
474
0
          if (const Function *F = CS.getCalledFunction()) {
475
0
            if (!static_cast<T *>(this)->isLoweredToCall(F))
476
0
              continue;
477
0
          }
478
0
479
0
          return;
480
0
        }
481
9
    }
482
9
483
9
    // Enable runtime and partial unrolling up to the specified size.
484
9
    // Enable using trip count upper bound to unroll loops.
485
9
    UP.Partial = UP.Runtime = UP.UpperBound = true;
486
9
    UP.PartialThreshold = MaxOps;
487
9
488
9
    // Avoid unrolling when optimizing for size.
489
9
    UP.OptSizeThreshold = 0;
490
9
    UP.PartialOptSizeThreshold = 0;
491
9
492
9
    // Set number of instructions optimized when "back edge"
493
9
    // becomes "fall through" to default value of 2.
494
9
    UP.BEInsns = 2;
495
9
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
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
433
22.9k
                               TTI::UnrollingPreferences &UP) {
434
22.9k
    // This unrolling functionality is target independent, but to provide some
435
22.9k
    // motivation for its intended use, for x86:
436
22.9k
437
22.9k
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
438
22.9k
    // Manual, Intel Core models and later have a loop stream detector (and
439
22.9k
    // associated uop queue) that can benefit from partial unrolling.
440
22.9k
    // The relevant requirements are:
441
22.9k
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
442
22.9k
    //    taken, and none of them may be calls.
443
22.9k
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
444
22.9k
445
22.9k
    // According to the Software Optimization Guide for AMD Family 15h
446
22.9k
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
447
22.9k
    // and loop buffer which can benefit from partial unrolling.
448
22.9k
    // The relevant requirements are:
449
22.9k
    //  - The loop must have fewer than 16 branches
450
22.9k
    //  - The loop must have less than 40 uops in all executed loop branches
451
22.9k
452
22.9k
    // The number of taken branches in a loop is hard to estimate here, and
453
22.9k
    // benchmarking has revealed that it is better not to be conservative when
454
22.9k
    // estimating the branch count. As a result, we'll ignore the branch limits
455
22.9k
    // until someone finds a case where it matters in practice.
456
22.9k
457
22.9k
    unsigned MaxOps;
458
22.9k
    const TargetSubtargetInfo *ST = getST();
459
22.9k
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
460
0
      MaxOps = PartialUnrollingThreshold;
461
22.9k
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
462
22.8k
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
463
157
    else
464
157
      return;
465
22.8k
466
22.8k
    // Scan the loop: don't unroll loops with calls.
467
68.9k
    
for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); 22.8k
I != E;
468
56.3k
         
++I46.1k
) {
469
56.3k
      BasicBlock *BB = *I;
470
56.3k
471
379k
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; 
++J323k
)
472
333k
        if (isa<CallInst>(J) || 
isa<InvokeInst>(J)318k
) {
473
15.1k
          ImmutableCallSite CS(&*J);
474
15.1k
          if (const Function *F = CS.getCalledFunction()) {
475
13.7k
            if (!static_cast<T *>(this)->isLoweredToCall(F))
476
4.88k
              continue;
477
10.2k
          }
478
10.2k
479
10.2k
          return;
480
10.2k
        }
481
56.3k
    }
482
22.8k
483
22.8k
    // Enable runtime and partial unrolling up to the specified size.
484
22.8k
    // Enable using trip count upper bound to unroll loops.
485
22.8k
    UP.Partial = UP.Runtime = UP.UpperBound = true;
486
12.5k
    UP.PartialThreshold = MaxOps;
487
12.5k
488
12.5k
    // Avoid unrolling when optimizing for size.
489
12.5k
    UP.OptSizeThreshold = 0;
490
12.5k
    UP.PartialOptSizeThreshold = 0;
491
12.5k
492
12.5k
    // Set number of instructions optimized when "back edge"
493
12.5k
    // becomes "fall through" to default value of 2.
494
12.5k
    UP.BEInsns = 2;
495
12.5k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
496
497
  bool isHardwareLoopProfitable(Loop *L, ScalarEvolution &SE,
498
                                AssumptionCache &AC,
499
                                TargetLibraryInfo *LibInfo,
500
0
                                HardwareLoopInfo &HWLoopInfo) {
501
0
    return BaseT::isHardwareLoopProfitable(L, SE, AC, LibInfo, HWLoopInfo);
502
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isHardwareLoopProfitable(llvm::Loop*, llvm::ScalarEvolution&, llvm::AssumptionCache&, llvm::TargetLibraryInfo*, llvm::HardwareLoopInfo&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isHardwareLoopProfitable(llvm::Loop*, llvm::ScalarEvolution&, llvm::AssumptionCache&, llvm::TargetLibraryInfo*, llvm::HardwareLoopInfo&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isHardwareLoopProfitable(llvm::Loop*, llvm::ScalarEvolution&, llvm::AssumptionCache&, llvm::TargetLibraryInfo*, llvm::HardwareLoopInfo&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isHardwareLoopProfitable(llvm::Loop*, llvm::ScalarEvolution&, llvm::AssumptionCache&, llvm::TargetLibraryInfo*, llvm::HardwareLoopInfo&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isHardwareLoopProfitable(llvm::Loop*, llvm::ScalarEvolution&, llvm::AssumptionCache&, llvm::TargetLibraryInfo*, llvm::HardwareLoopInfo&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isHardwareLoopProfitable(llvm::Loop*, llvm::ScalarEvolution&, llvm::AssumptionCache&, llvm::TargetLibraryInfo*, llvm::HardwareLoopInfo&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isHardwareLoopProfitable(llvm::Loop*, llvm::ScalarEvolution&, llvm::AssumptionCache&, llvm::TargetLibraryInfo*, llvm::HardwareLoopInfo&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::isHardwareLoopProfitable(llvm::Loop*, llvm::ScalarEvolution&, llvm::AssumptionCache&, llvm::TargetLibraryInfo*, llvm::HardwareLoopInfo&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isHardwareLoopProfitable(llvm::Loop*, llvm::ScalarEvolution&, llvm::AssumptionCache&, llvm::TargetLibraryInfo*, llvm::HardwareLoopInfo&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::isHardwareLoopProfitable(llvm::Loop*, llvm::ScalarEvolution&, llvm::AssumptionCache&, llvm::TargetLibraryInfo*, llvm::HardwareLoopInfo&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isHardwareLoopProfitable(llvm::Loop*, llvm::ScalarEvolution&, llvm::AssumptionCache&, llvm::TargetLibraryInfo*, llvm::HardwareLoopInfo&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isHardwareLoopProfitable(llvm::Loop*, llvm::ScalarEvolution&, llvm::AssumptionCache&, llvm::TargetLibraryInfo*, llvm::HardwareLoopInfo&)
503
504
119
  int getInstructionLatency(const Instruction *I) {
505
119
    if (isa<LoadInst>(I))
506
41
      return getST()->getSchedModel().DefaultLoadLatency;
507
78
508
78
    return BaseT::getInstructionLatency(I);
509
78
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getInstructionLatency(llvm::Instruction const*)
Line
Count
Source
504
108
  int getInstructionLatency(const Instruction *I) {
505
108
    if (isa<LoadInst>(I))
506
40
      return getST()->getSchedModel().DefaultLoadLatency;
507
68
508
68
    return BaseT::getInstructionLatency(I);
509
68
  }
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::RISCVTTIImpl>::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
504
11
  int getInstructionLatency(const Instruction *I) {
505
11
    if (isa<LoadInst>(I))
506
1
      return getST()->getSchedModel().DefaultLoadLatency;
507
10
508
10
    return BaseT::getInstructionLatency(I);
509
10
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getInstructionLatency(llvm::Instruction const*)
510
511
  /// @}
512
513
  /// \name Vector TTI Implementations
514
  /// @{
515
516
867
  unsigned getNumberOfRegisters(bool Vector) { return Vector ? 
0286
:
1581
; }
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getNumberOfRegisters(bool)
Line
Count
Source
516
56
  unsigned getNumberOfRegisters(bool Vector) { return Vector ? 
00
: 1; }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getNumberOfRegisters(bool)
Line
Count
Source
516
335
  unsigned getNumberOfRegisters(bool Vector) { return Vector ? 
060
:
1275
; }
llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getNumberOfRegisters(bool)
Line
Count
Source
516
68
  unsigned getNumberOfRegisters(bool Vector) { return Vector ? 
06
:
162
; }
llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getNumberOfRegisters(bool)
Line
Count
Source
516
408
  unsigned getNumberOfRegisters(bool Vector) { return Vector ? 
0220
:
1188
; }
517
518
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::RISCVTTIImpl>::getRegisterBitWidth(bool) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getRegisterBitWidth(bool) const
519
520
  /// Estimate the overhead of scalarizing an instruction. Insert and Extract
521
  /// are set if the result needs to be inserted and/or extracted from vectors.
522
88.3k
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
523
88.3k
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
524
88.3k
    unsigned Cost = 0;
525
88.3k
526
395k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i307k
) {
527
307k
      if (Insert)
528
167k
        Cost += static_cast<T *>(this)
529
167k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
530
307k
      if (Extract)
531
144k
        Cost += static_cast<T *>(this)
532
144k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
533
307k
    }
534
88.3k
535
88.3k
    return Cost;
536
88.3k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
522
69.6k
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
523
69.6k
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
524
69.6k
    unsigned Cost = 0;
525
69.6k
526
254k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i185k
) {
527
185k
      if (Insert)
528
105k
        Cost += static_cast<T *>(this)
529
105k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
530
185k
      if (Extract)
531
80.0k
        Cost += static_cast<T *>(this)
532
80.0k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
533
185k
    }
534
69.6k
535
69.6k
    return Cost;
536
69.6k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
522
170
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
523
170
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
524
170
    unsigned Cost = 0;
525
170
526
720
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i550
) {
527
550
      if (Insert)
528
437
        Cost += static_cast<T *>(this)
529
437
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
530
550
      if (Extract)
531
117
        Cost += static_cast<T *>(this)
532
117
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
533
550
    }
534
170
535
170
    return Cost;
536
170
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
522
2.83k
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
523
2.83k
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
524
2.83k
    unsigned Cost = 0;
525
2.83k
526
9.78k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i6.95k
) {
527
6.95k
      if (Insert)
528
2.60k
        Cost += static_cast<T *>(this)
529
2.60k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
530
6.95k
      if (Extract)
531
4.58k
        Cost += static_cast<T *>(this)
532
4.58k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
533
6.95k
    }
534
2.83k
535
2.83k
    return Cost;
536
2.83k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
522
23
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
523
23
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
524
23
    unsigned Cost = 0;
525
23
526
311
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i288
) {
527
288
      if (Insert)
528
124
        Cost += static_cast<T *>(this)
529
124
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
530
288
      if (Extract)
531
164
        Cost += static_cast<T *>(this)
532
164
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
533
288
    }
534
23
535
23
    return Cost;
536
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
522
4
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
523
4
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
524
4
    unsigned Cost = 0;
525
4
526
12
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i8
) {
527
8
      if (Insert)
528
4
        Cost += static_cast<T *>(this)
529
4
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
530
8
      if (Extract)
531
4
        Cost += static_cast<T *>(this)
532
4
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
533
8
    }
534
4
535
4
    return Cost;
536
4
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
522
788
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
523
788
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
524
788
    unsigned Cost = 0;
525
788
526
2.99k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i2.21k
) {
527
2.21k
      if (Insert)
528
1.07k
        Cost += static_cast<T *>(this)
529
1.07k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
530
2.21k
      if (Extract)
531
1.13k
        Cost += static_cast<T *>(this)
532
1.13k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
533
2.21k
    }
534
788
535
788
    return Cost;
536
788
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
522
758
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
523
758
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
524
758
    unsigned Cost = 0;
525
758
526
5.53k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i4.77k
) {
527
4.77k
      if (Insert)
528
2.21k
        Cost += static_cast<T *>(this)
529
2.21k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
530
4.77k
      if (Extract)
531
2.11k
        Cost += static_cast<T *>(this)
532
2.11k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
533
4.77k
    }
534
758
535
758
    return Cost;
536
758
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::WebAssemblyTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
522
14.1k
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
523
14.1k
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
524
14.1k
    unsigned Cost = 0;
525
14.1k
526
121k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i107k
) {
527
107k
      if (Insert)
528
55.7k
        Cost += static_cast<T *>(this)
529
55.7k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
530
107k
      if (Extract)
531
55.9k
        Cost += static_cast<T *>(this)
532
55.9k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
533
107k
    }
534
14.1k
535
14.1k
    return Cost;
536
14.1k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
537
538
  /// Estimate the overhead of scalarizing an instructions unique
539
  /// non-constant operands. The types of the arguments are ordinarily
540
  /// scalar, in which case the costs are multiplied with VF.
541
  unsigned getOperandsScalarizationOverhead(ArrayRef<const Value *> Args,
542
24.4k
                                            unsigned VF) {
543
24.4k
    unsigned Cost = 0;
544
24.4k
    SmallPtrSet<const Value*, 4> UniqueOperands;
545
34.0k
    for (const Value *A : Args) {
546
34.0k
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second28.0k
) {
547
28.0k
        Type *VecTy = nullptr;
548
28.0k
        if (A->getType()->isVectorTy()) {
549
823
          VecTy = A->getType();
550
823
          // If A is a vector operand, VF should be 1 or correspond to A.
551
823
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
552
823
                 "Vector argument does not match VF");
553
823
        }
554
27.2k
        else
555
27.2k
          VecTy = VectorType::get(A->getType(), VF);
556
28.0k
557
28.0k
        Cost += getScalarizationOverhead(VecTy, false, true);
558
28.0k
      }
559
34.0k
    }
560
24.4k
561
24.4k
    return Cost;
562
24.4k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
542
17.6k
                                            unsigned VF) {
543
17.6k
    unsigned Cost = 0;
544
17.6k
    SmallPtrSet<const Value*, 4> UniqueOperands;
545
21.5k
    for (const Value *A : Args) {
546
21.5k
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second21.4k
) {
547
21.4k
        Type *VecTy = nullptr;
548
21.4k
        if (A->getType()->isVectorTy()) {
549
5
          VecTy = A->getType();
550
5
          // If A is a vector operand, VF should be 1 or correspond to A.
551
5
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
552
5
                 "Vector argument does not match VF");
553
5
        }
554
21.4k
        else
555
21.4k
          VecTy = VectorType::get(A->getType(), VF);
556
21.4k
557
21.4k
        Cost += getScalarizationOverhead(VecTy, false, true);
558
21.4k
      }
559
21.5k
    }
560
17.6k
561
17.6k
    return Cost;
562
17.6k
  }
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
542
19
                                            unsigned VF) {
543
19
    unsigned Cost = 0;
544
19
    SmallPtrSet<const Value*, 4> UniqueOperands;
545
31
    for (const Value *A : Args) {
546
31
      if (!isa<Constant>(A) && UniqueOperands.insert(A).second) {
547
31
        Type *VecTy = nullptr;
548
31
        if (A->getType()->isVectorTy()) {
549
7
          VecTy = A->getType();
550
7
          // If A is a vector operand, VF should be 1 or correspond to A.
551
7
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
552
7
                 "Vector argument does not match VF");
553
7
        }
554
24
        else
555
24
          VecTy = VectorType::get(A->getType(), VF);
556
31
557
31
        Cost += getScalarizationOverhead(VecTy, false, true);
558
31
      }
559
31
    }
560
19
561
19
    return Cost;
562
19
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
542
613
                                            unsigned VF) {
543
613
    unsigned Cost = 0;
544
613
    SmallPtrSet<const Value*, 4> UniqueOperands;
545
943
    for (const Value *A : Args) {
546
943
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second835
) {
547
835
        Type *VecTy = nullptr;
548
835
        if (A->getType()->isVectorTy()) {
549
0
          VecTy = A->getType();
550
0
          // If A is a vector operand, VF should be 1 or correspond to A.
551
0
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
552
0
                 "Vector argument does not match VF");
553
0
        }
554
835
        else
555
835
          VecTy = VectorType::get(A->getType(), VF);
556
835
557
835
        Cost += getScalarizationOverhead(VecTy, false, true);
558
835
      }
559
943
    }
560
613
561
613
    return Cost;
562
613
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
542
5
                                            unsigned VF) {
543
5
    unsigned Cost = 0;
544
5
    SmallPtrSet<const Value*, 4> UniqueOperands;
545
10
    for (const Value *A : Args) {
546
10
      if (!isa<Constant>(A) && UniqueOperands.insert(A).second) {
547
10
        Type *VecTy = nullptr;
548
10
        if (A->getType()->isVectorTy()) {
549
0
          VecTy = A->getType();
550
0
          // If A is a vector operand, VF should be 1 or correspond to A.
551
0
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
552
0
                 "Vector argument does not match VF");
553
0
        }
554
10
        else
555
10
          VecTy = VectorType::get(A->getType(), VF);
556
10
557
10
        Cost += getScalarizationOverhead(VecTy, false, true);
558
10
      }
559
10
    }
560
5
561
5
    return Cost;
562
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
542
354
                                            unsigned VF) {
543
354
    unsigned Cost = 0;
544
354
    SmallPtrSet<const Value*, 4> UniqueOperands;
545
379
    for (const Value *A : Args) {
546
379
      if (!isa<Constant>(A) && UniqueOperands.insert(A).second) {
547
379
        Type *VecTy = nullptr;
548
379
        if (A->getType()->isVectorTy()) {
549
1
          VecTy = A->getType();
550
1
          // If A is a vector operand, VF should be 1 or correspond to A.
551
1
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
552
1
                 "Vector argument does not match VF");
553
1
        }
554
378
        else
555
378
          VecTy = VectorType::get(A->getType(), VF);
556
379
557
379
        Cost += getScalarizationOverhead(VecTy, false, true);
558
379
      }
559
379
    }
560
354
561
354
    return Cost;
562
354
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
542
72
                                            unsigned VF) {
543
72
    unsigned Cost = 0;
544
72
    SmallPtrSet<const Value*, 4> UniqueOperands;
545
136
    for (const Value *A : Args) {
546
136
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second60
) {
547
60
        Type *VecTy = nullptr;
548
60
        if (A->getType()->isVectorTy()) {
549
60
          VecTy = A->getType();
550
60
          // If A is a vector operand, VF should be 1 or correspond to A.
551
60
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
552
60
                 "Vector argument does not match VF");
553
60
        }
554
0
        else
555
0
          VecTy = VectorType::get(A->getType(), VF);
556
60
557
60
        Cost += getScalarizationOverhead(VecTy, false, true);
558
60
      }
559
136
    }
560
72
561
72
    return Cost;
562
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
542
5.77k
                                            unsigned VF) {
543
5.77k
    unsigned Cost = 0;
544
5.77k
    SmallPtrSet<const Value*, 4> UniqueOperands;
545
10.9k
    for (const Value *A : Args) {
546
10.9k
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second5.28k
) {
547
5.28k
        Type *VecTy = nullptr;
548
5.28k
        if (A->getType()->isVectorTy()) {
549
750
          VecTy = A->getType();
550
750
          // If A is a vector operand, VF should be 1 or correspond to A.
551
750
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
552
750
                 "Vector argument does not match VF");
553
750
        }
554
4.53k
        else
555
4.53k
          VecTy = VectorType::get(A->getType(), VF);
556
5.28k
557
5.28k
        Cost += getScalarizationOverhead(VecTy, false, true);
558
5.28k
      }
559
10.9k
    }
560
5.77k
561
5.77k
    return Cost;
562
5.77k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
563
564
6.23k
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
565
6.23k
    assert(VecTy->isVectorTy());
566
6.23k
567
6.23k
    unsigned Cost = 0;
568
6.23k
569
6.23k
    Cost += getScalarizationOverhead(VecTy, true, false);
570
6.23k
    if (!Args.empty())
571
64
      Cost += getOperandsScalarizationOverhead(Args,
572
64
                                               VecTy->getVectorNumElements());
573
6.17k
    else
574
6.17k
      // When no information on arguments is provided, we add the cost
575
6.17k
      // associated with one argument as a heuristic.
576
6.17k
      Cost += getScalarizationOverhead(VecTy, false, true);
577
6.23k
578
6.23k
    return Cost;
579
6.23k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
564
5.40k
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
565
5.40k
    assert(VecTy->isVectorTy());
566
5.40k
567
5.40k
    unsigned Cost = 0;
568
5.40k
569
5.40k
    Cost += getScalarizationOverhead(VecTy, true, false);
570
5.40k
    if (!Args.empty())
571
0
      Cost += getOperandsScalarizationOverhead(Args,
572
0
                                               VecTy->getVectorNumElements());
573
5.40k
    else
574
5.40k
      // When no information on arguments is provided, we add the cost
575
5.40k
      // associated with one argument as a heuristic.
576
5.40k
      Cost += getScalarizationOverhead(VecTy, false, true);
577
5.40k
578
5.40k
    return Cost;
579
5.40k
  }
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
564
15
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
565
15
    assert(VecTy->isVectorTy());
566
15
567
15
    unsigned Cost = 0;
568
15
569
15
    Cost += getScalarizationOverhead(VecTy, true, false);
570
15
    if (!Args.empty())
571
0
      Cost += getOperandsScalarizationOverhead(Args,
572
0
                                               VecTy->getVectorNumElements());
573
15
    else
574
15
      // When no information on arguments is provided, we add the cost
575
15
      // associated with one argument as a heuristic.
576
15
      Cost += getScalarizationOverhead(VecTy, false, true);
577
15
578
15
    return Cost;
579
15
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
564
694
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
565
694
    assert(VecTy->isVectorTy());
566
694
567
694
    unsigned Cost = 0;
568
694
569
694
    Cost += getScalarizationOverhead(VecTy, true, false);
570
694
    if (!Args.empty())
571
0
      Cost += getOperandsScalarizationOverhead(Args,
572
0
                                               VecTy->getVectorNumElements());
573
694
    else
574
694
      // When no information on arguments is provided, we add the cost
575
694
      // associated with one argument as a heuristic.
576
694
      Cost += getScalarizationOverhead(VecTy, false, true);
577
694
578
694
    return Cost;
579
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
564
2
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
565
2
    assert(VecTy->isVectorTy());
566
2
567
2
    unsigned Cost = 0;
568
2
569
2
    Cost += getScalarizationOverhead(VecTy, true, false);
570
2
    if (!Args.empty())
571
0
      Cost += getOperandsScalarizationOverhead(Args,
572
0
                                               VecTy->getVectorNumElements());
573
2
    else
574
2
      // When no information on arguments is provided, we add the cost
575
2
      // associated with one argument as a heuristic.
576
2
      Cost += getScalarizationOverhead(VecTy, false, true);
577
2
578
2
    return Cost;
579
2
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
564
64
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
565
64
    assert(VecTy->isVectorTy());
566
64
567
64
    unsigned Cost = 0;
568
64
569
64
    Cost += getScalarizationOverhead(VecTy, true, false);
570
64
    if (!Args.empty())
571
64
      Cost += getOperandsScalarizationOverhead(Args,
572
64
                                               VecTy->getVectorNumElements());
573
0
    else
574
0
      // When no information on arguments is provided, we add the cost
575
0
      // associated with one argument as a heuristic.
576
0
      Cost += getScalarizationOverhead(VecTy, false, true);
577
64
578
64
    return Cost;
579
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
564
60
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
565
60
    assert(VecTy->isVectorTy());
566
60
567
60
    unsigned Cost = 0;
568
60
569
60
    Cost += getScalarizationOverhead(VecTy, true, false);
570
60
    if (!Args.empty())
571
0
      Cost += getOperandsScalarizationOverhead(Args,
572
0
                                               VecTy->getVectorNumElements());
573
60
    else
574
60
      // When no information on arguments is provided, we add the cost
575
60
      // associated with one argument as a heuristic.
576
60
      Cost += getScalarizationOverhead(VecTy, false, true);
577
60
578
60
    return Cost;
579
60
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
580
581
76
  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
581
46
  unsigned getMaxInterleaveFactor(unsigned VF) { return 1; }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getMaxInterleaveFactor(unsigned int)
Line
Count
Source
581
1
  unsigned getMaxInterleaveFactor(unsigned VF) { return 1; }
llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getMaxInterleaveFactor(unsigned int)
Line
Count
Source
581
6
  unsigned getMaxInterleaveFactor(unsigned VF) { return 1; }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getMaxInterleaveFactor(unsigned int)
Line
Count
Source
581
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
581
1
  unsigned getMaxInterleaveFactor(unsigned VF) { return 1; }
582
583
  unsigned getArithmeticInstrCost(
584
      unsigned Opcode, Type *Ty,
585
      TTI::OperandValueKind Opd1Info = TTI::OK_AnyValue,
586
      TTI::OperandValueKind Opd2Info = TTI::OK_AnyValue,
587
      TTI::OperandValueProperties Opd1PropInfo = TTI::OP_None,
588
      TTI::OperandValueProperties Opd2PropInfo = TTI::OP_None,
589
530k
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
590
530k
    // Check if any of the operands are vector operands.
591
530k
    const TargetLoweringBase *TLI = getTLI();
592
530k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
593
530k
    assert(ISD && "Invalid opcode");
594
530k
595
530k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
596
530k
597
530k
    bool IsFloat = Ty->isFPOrFPVectorTy();
598
530k
    // Assume that floating point arithmetic operations cost twice as much as
599
530k
    // integer operations.
600
530k
    unsigned OpCost = (IsFloat ? 
2264k
:
1265k
);
601
530k
602
530k
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
603
465k
      // The operation is legal. Assume it costs 1.
604
465k
      // TODO: Once we have extract/insert subvector cost we need to use them.
605
465k
      return LT.first * OpCost;
606
465k
    }
607
65.1k
608
65.1k
    if (!TLI->isOperationExpand(ISD, LT.second)) {
609
50.7k
      // If the operation is custom lowered, then assume that the code is twice
610
50.7k
      // as expensive.
611
50.7k
      return LT.first * 2 * OpCost;
612
50.7k
    }
613
14.3k
614
14.3k
    // Else, assume that we need to scalarize this op.
615
14.3k
    // TODO: If one of the types get legalized by splitting, handle this
616
14.3k
    // similarly to what getCastInstrCost() does.
617
14.3k
    if (Ty->isVectorTy()) {
618
6.19k
      unsigned Num = Ty->getVectorNumElements();
619
6.19k
      unsigned Cost = static_cast<T *>(this)
620
6.19k
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
621
6.19k
      // Return the cost of multiple scalar invocation plus the cost of
622
6.19k
      // inserting and extracting the values.
623
6.19k
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
624
6.19k
    }
625
8.14k
626
8.14k
    // We don't know anything about this scalar instruction.
627
8.14k
    return OpCost;
628
8.14k
  }
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
589
420k
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
590
420k
    // Check if any of the operands are vector operands.
591
420k
    const TargetLoweringBase *TLI = getTLI();
592
420k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
593
420k
    assert(ISD && "Invalid opcode");
594
420k
595
420k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
596
420k
597
420k
    bool IsFloat = Ty->isFPOrFPVectorTy();
598
420k
    // Assume that floating point arithmetic operations cost twice as much as
599
420k
    // integer operations.
600
420k
    unsigned OpCost = (IsFloat ? 
2260k
:
1160k
);
601
420k
602
420k
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
603
364k
      // The operation is legal. Assume it costs 1.
604
364k
      // TODO: Once we have extract/insert subvector cost we need to use them.
605
364k
      return LT.first * OpCost;
606
364k
    }
607
55.6k
608
55.6k
    if (!TLI->isOperationExpand(ISD, LT.second)) {
609
48.6k
      // If the operation is custom lowered, then assume that the code is twice
610
48.6k
      // as expensive.
611
48.6k
      return LT.first * 2 * OpCost;
612
48.6k
    }
613
7.01k
614
7.01k
    // Else, assume that we need to scalarize this op.
615
7.01k
    // TODO: If one of the types get legalized by splitting, handle this
616
7.01k
    // similarly to what getCastInstrCost() does.
617
7.01k
    if (Ty->isVectorTy()) {
618
5.40k
      unsigned Num = Ty->getVectorNumElements();
619
5.40k
      unsigned Cost = static_cast<T *>(this)
620
5.40k
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
621
5.40k
      // Return the cost of multiple scalar invocation plus the cost of
622
5.40k
      // inserting and extracting the values.
623
5.40k
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
624
5.40k
    }
625
1.61k
626
1.61k
    // We don't know anything about this scalar instruction.
627
1.61k
    return OpCost;
628
1.61k
  }
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
589
16
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
590
16
    // Check if any of the operands are vector operands.
591
16
    const TargetLoweringBase *TLI = getTLI();
592
16
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
593
16
    assert(ISD && "Invalid opcode");
594
16
595
16
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
596
16
597
16
    bool IsFloat = Ty->isFPOrFPVectorTy();
598
16
    // Assume that floating point arithmetic operations cost twice as much as
599
16
    // integer operations.
600
16
    unsigned OpCost = (IsFloat ? 
212
:
14
);
601
16
602
16
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
603
1
      // The operation is legal. Assume it costs 1.
604
1
      // TODO: Once we have extract/insert subvector cost we need to use them.
605
1
      return LT.first * OpCost;
606
1
    }
607
15
608
15
    if (!TLI->isOperationExpand(ISD, LT.second)) {
609
0
      // If the operation is custom lowered, then assume that the code is twice
610
0
      // as expensive.
611
0
      return LT.first * 2 * OpCost;
612
0
    }
613
15
614
15
    // Else, assume that we need to scalarize this op.
615
15
    // TODO: If one of the types get legalized by splitting, handle this
616
15
    // similarly to what getCastInstrCost() does.
617
15
    if (Ty->isVectorTy()) {
618
15
      unsigned Num = Ty->getVectorNumElements();
619
15
      unsigned Cost = static_cast<T *>(this)
620
15
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
621
15
      // Return the cost of multiple scalar invocation plus the cost of
622
15
      // inserting and extracting the values.
623
15
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
624
15
    }
625
0
626
0
    // We don't know anything about this scalar instruction.
627
0
    return OpCost;
628
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
589
20.4k
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
590
20.4k
    // Check if any of the operands are vector operands.
591
20.4k
    const TargetLoweringBase *TLI = getTLI();
592
20.4k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
593
20.4k
    assert(ISD && "Invalid opcode");
594
20.4k
595
20.4k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
596
20.4k
597
20.4k
    bool IsFloat = Ty->isFPOrFPVectorTy();
598
20.4k
    // Assume that floating point arithmetic operations cost twice as much as
599
20.4k
    // integer operations.
600
20.4k
    unsigned OpCost = (IsFloat ? 
22.93k
:
117.4k
);
601
20.4k
602
20.4k
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
603
17.6k
      // The operation is legal. Assume it costs 1.
604
17.6k
      // TODO: Once we have extract/insert subvector cost we need to use them.
605
17.6k
      return LT.first * OpCost;
606
17.6k
    }
607
2.76k
608
2.76k
    if (!TLI->isOperationExpand(ISD, LT.second)) {
609
2.05k
      // If the operation is custom lowered, then assume that the code is twice
610
2.05k
      // as expensive.
611
2.05k
      return LT.first * 2 * OpCost;
612
2.05k
    }
613
712
614
712
    // Else, assume that we need to scalarize this op.
615
712
    // TODO: If one of the types get legalized by splitting, handle this
616
712
    // similarly to what getCastInstrCost() does.
617
712
    if (Ty->isVectorTy()) {
618
694
      unsigned Num = Ty->getVectorNumElements();
619
694
      unsigned Cost = static_cast<T *>(this)
620
694
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
621
694
      // Return the cost of multiple scalar invocation plus the cost of
622
694
      // inserting and extracting the values.
623
694
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
624
694
    }
625
18
626
18
    // We don't know anything about this scalar instruction.
627
18
    return OpCost;
628
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
589
42
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
590
42
    // Check if any of the operands are vector operands.
591
42
    const TargetLoweringBase *TLI = getTLI();
592
42
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
593
42
    assert(ISD && "Invalid opcode");
594
42
595
42
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
596
42
597
42
    bool IsFloat = Ty->isFPOrFPVectorTy();
598
42
    // Assume that floating point arithmetic operations cost twice as much as
599
42
    // integer operations.
600
42
    unsigned OpCost = (IsFloat ? 
20
: 1);
601
42
602
42
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
603
42
      // The operation is legal. Assume it costs 1.
604
42
      // TODO: Once we have extract/insert subvector cost we need to use them.
605
42
      return LT.first * OpCost;
606
42
    }
607
0
608
0
    if (!TLI->isOperationExpand(ISD, LT.second)) {
609
0
      // If the operation is custom lowered, then assume that the code is twice
610
0
      // as expensive.
611
0
      return LT.first * 2 * OpCost;
612
0
    }
613
0
614
0
    // Else, assume that we need to scalarize this op.
615
0
    // TODO: If one of the types get legalized by splitting, handle this
616
0
    // similarly to what getCastInstrCost() does.
617
0
    if (Ty->isVectorTy()) {
618
0
      unsigned Num = Ty->getVectorNumElements();
619
0
      unsigned Cost = static_cast<T *>(this)
620
0
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
621
0
      // Return the cost of multiple scalar invocation plus the cost of
622
0
      // inserting and extracting the values.
623
0
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
624
0
    }
625
0
626
0
    // We don't know anything about this scalar instruction.
627
0
    return OpCost;
628
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
589
13
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
590
13
    // Check if any of the operands are vector operands.
591
13
    const TargetLoweringBase *TLI = getTLI();
592
13
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
593
13
    assert(ISD && "Invalid opcode");
594
13
595
13
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
596
13
597
13
    bool IsFloat = Ty->isFPOrFPVectorTy();
598
13
    // Assume that floating point arithmetic operations cost twice as much as
599
13
    // integer operations.
600
13
    unsigned OpCost = (IsFloat ? 
210
:
13
);
601
13
602
13
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
603
11
      // The operation is legal. Assume it costs 1.
604
11
      // TODO: Once we have extract/insert subvector cost we need to use them.
605
11
      return LT.first * OpCost;
606
11
    }
607
2
608
2
    if (!TLI->isOperationExpand(ISD, LT.second)) {
609
0
      // If the operation is custom lowered, then assume that the code is twice
610
0
      // as expensive.
611
0
      return LT.first * 2 * OpCost;
612
0
    }
613
2
614
2
    // Else, assume that we need to scalarize this op.
615
2
    // TODO: If one of the types get legalized by splitting, handle this
616
2
    // similarly to what getCastInstrCost() does.
617
2
    if (Ty->isVectorTy()) {
618
2
      unsigned Num = Ty->getVectorNumElements();
619
2
      unsigned Cost = static_cast<T *>(this)
620
2
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
621
2
      // Return the cost of multiple scalar invocation plus the cost of
622
2
      // inserting and extracting the values.
623
2
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
624
2
    }
625
0
626
0
    // We don't know anything about this scalar instruction.
627
0
    return OpCost;
628
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
589
288
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
590
288
    // Check if any of the operands are vector operands.
591
288
    const TargetLoweringBase *TLI = getTLI();
592
288
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
593
288
    assert(ISD && "Invalid opcode");
594
288
595
288
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
596
288
597
288
    bool IsFloat = Ty->isFPOrFPVectorTy();
598
288
    // Assume that floating point arithmetic operations cost twice as much as
599
288
    // integer operations.
600
288
    unsigned OpCost = (IsFloat ? 
270
:
1218
);
601
288
602
288
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
603
288
      // The operation is legal. Assume it costs 1.
604
288
      // TODO: Once we have extract/insert subvector cost we need to use them.
605
288
      return LT.first * OpCost;
606
288
    }
607
0
608
0
    if (!TLI->isOperationExpand(ISD, LT.second)) {
609
0
      // If the operation is custom lowered, then assume that the code is twice
610
0
      // as expensive.
611
0
      return LT.first * 2 * OpCost;
612
0
    }
613
0
614
0
    // Else, assume that we need to scalarize this op.
615
0
    // TODO: If one of the types get legalized by splitting, handle this
616
0
    // similarly to what getCastInstrCost() does.
617
0
    if (Ty->isVectorTy()) {
618
0
      unsigned Num = Ty->getVectorNumElements();
619
0
      unsigned Cost = static_cast<T *>(this)
620
0
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
621
0
      // Return the cost of multiple scalar invocation plus the cost of
622
0
      // inserting and extracting the values.
623
0
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
624
0
    }
625
0
626
0
    // We don't know anything about this scalar instruction.
627
0
    return OpCost;
628
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::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::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
589
378
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
590
378
    // Check if any of the operands are vector operands.
591
378
    const TargetLoweringBase *TLI = getTLI();
592
378
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
593
378
    assert(ISD && "Invalid opcode");
594
378
595
378
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
596
378
597
378
    bool IsFloat = Ty->isFPOrFPVectorTy();
598
378
    // Assume that floating point arithmetic operations cost twice as much as
599
378
    // integer operations.
600
378
    unsigned OpCost = (IsFloat ? 
20
: 1);
601
378
602
378
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
603
358
      // The operation is legal. Assume it costs 1.
604
358
      // TODO: Once we have extract/insert subvector cost we need to use them.
605
358
      return LT.first * OpCost;
606
358
    }
607
20
608
20
    if (!TLI->isOperationExpand(ISD, LT.second)) {
609
0
      // If the operation is custom lowered, then assume that the code is twice
610
0
      // as expensive.
611
0
      return LT.first * 2 * OpCost;
612
0
    }
613
20
614
20
    // Else, assume that we need to scalarize this op.
615
20
    // TODO: If one of the types get legalized by splitting, handle this
616
20
    // similarly to what getCastInstrCost() does.
617
20
    if (Ty->isVectorTy()) {
618
20
      unsigned Num = Ty->getVectorNumElements();
619
20
      unsigned Cost = static_cast<T *>(this)
620
20
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
621
20
      // Return the cost of multiple scalar invocation plus the cost of
622
20
      // inserting and extracting the values.
623
20
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
624
20
    }
625
0
626
0
    // We don't know anything about this scalar instruction.
627
0
    return OpCost;
628
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
589
88.5k
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
590
88.5k
    // Check if any of the operands are vector operands.
591
88.5k
    const TargetLoweringBase *TLI = getTLI();
592
88.5k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
593
88.5k
    assert(ISD && "Invalid opcode");
594
88.5k
595
88.5k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
596
88.5k
597
88.5k
    bool IsFloat = Ty->isFPOrFPVectorTy();
598
88.5k
    // Assume that floating point arithmetic operations cost twice as much as
599
88.5k
    // integer operations.
600
88.5k
    unsigned OpCost = (IsFloat ? 
21.15k
:
187.3k
);
601
88.5k
602
88.5k
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
603
81.8k
      // The operation is legal. Assume it costs 1.
604
81.8k
      // TODO: Once we have extract/insert subvector cost we need to use them.
605
81.8k
      return LT.first * OpCost;
606
81.8k
    }
607
6.65k
608
6.65k
    if (!TLI->isOperationExpand(ISD, LT.second)) {
609
82
      // If the operation is custom lowered, then assume that the code is twice
610
82
      // as expensive.
611
82
      return LT.first * 2 * OpCost;
612
82
    }
613
6.56k
614
6.56k
    // Else, assume that we need to scalarize this op.
615
6.56k
    // TODO: If one of the types get legalized by splitting, handle this
616
6.56k
    // similarly to what getCastInstrCost() does.
617
6.56k
    if (Ty->isVectorTy()) {
618
60
      unsigned Num = Ty->getVectorNumElements();
619
60
      unsigned Cost = static_cast<T *>(this)
620
60
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
621
60
      // Return the cost of multiple scalar invocation plus the cost of
622
60
      // inserting and extracting the values.
623
60
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
624
60
    }
625
6.50k
626
6.50k
    // We don't know anything about this scalar instruction.
627
6.50k
    return OpCost;
628
6.50k
  }
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*>)
629
630
  unsigned getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index,
631
8.01k
                          Type *SubTp) {
632
8.01k
    switch (Kind) {
633
8.01k
    case TTI::SK_Broadcast:
634
51
      return getBroadcastShuffleOverhead(Tp);
635
8.01k
    case TTI::SK_Select:
636
3.96k
    case TTI::SK_Reverse:
637
3.96k
    case TTI::SK_Transpose:
638
3.96k
    case TTI::SK_PermuteSingleSrc:
639
3.96k
    case TTI::SK_PermuteTwoSrc:
640
3.96k
      return getPermuteShuffleOverhead(Tp);
641
3.96k
    case TTI::SK_ExtractSubvector:
642
3.93k
      return getExtractSubvectorOverhead(Tp, Index, SubTp);
643
3.96k
    case TTI::SK_InsertSubvector:
644
73
      return getInsertSubvectorOverhead(Tp, Index, SubTp);
645
0
    }
646
0
    llvm_unreachable("Unknown TTI::ShuffleKind");
647
0
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
Line
Count
Source
631
7.21k
                          Type *SubTp) {
632
7.21k
    switch (Kind) {
633
7.21k
    case TTI::SK_Broadcast:
634
2
      return getBroadcastShuffleOverhead(Tp);
635
7.21k
    case TTI::SK_Select:
636
3.32k
    case TTI::SK_Reverse:
637
3.32k
    case TTI::SK_Transpose:
638
3.32k
    case TTI::SK_PermuteSingleSrc:
639
3.32k
    case TTI::SK_PermuteTwoSrc:
640
3.32k
      return getPermuteShuffleOverhead(Tp);
641
3.89k
    case TTI::SK_ExtractSubvector:
642
3.89k
      return getExtractSubvectorOverhead(Tp, Index, SubTp);
643
3.32k
    case TTI::SK_InsertSubvector:
644
0
      return getInsertSubvectorOverhead(Tp, Index, SubTp);
645
0
    }
646
0
    llvm_unreachable("Unknown TTI::ShuffleKind");
647
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
631
81
                          Type *SubTp) {
632
81
    switch (Kind) {
633
81
    case TTI::SK_Broadcast:
634
2
      return getBroadcastShuffleOverhead(Tp);
635
81
    case TTI::SK_Select:
636
54
    case TTI::SK_Reverse:
637
54
    case TTI::SK_Transpose:
638
54
    case TTI::SK_PermuteSingleSrc:
639
54
    case TTI::SK_PermuteTwoSrc:
640
54
      return getPermuteShuffleOverhead(Tp);
641
54
    case TTI::SK_ExtractSubvector:
642
25
      return getExtractSubvectorOverhead(Tp, Index, SubTp);
643
54
    case TTI::SK_InsertSubvector:
644
0
      return getInsertSubvectorOverhead(Tp, Index, SubTp);
645
0
    }
646
0
    llvm_unreachable("Unknown TTI::ShuffleKind");
647
0
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
Line
Count
Source
631
96
                          Type *SubTp) {
632
96
    switch (Kind) {
633
96
    case TTI::SK_Broadcast:
634
0
      return getBroadcastShuffleOverhead(Tp);
635
96
    case TTI::SK_Select:
636
96
    case TTI::SK_Reverse:
637
96
    case TTI::SK_Transpose:
638
96
    case TTI::SK_PermuteSingleSrc:
639
96
    case TTI::SK_PermuteTwoSrc:
640
96
      return getPermuteShuffleOverhead(Tp);
641
96
    case TTI::SK_ExtractSubvector:
642
0
      return getExtractSubvectorOverhead(Tp, Index, SubTp);
643
96
    case TTI::SK_InsertSubvector:
644
0
      return getInsertSubvectorOverhead(Tp, Index, SubTp);
645
0
    }
646
0
    llvm_unreachable("Unknown TTI::ShuffleKind");
647
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::RISCVTTIImpl>::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
631
619
                          Type *SubTp) {
632
619
    switch (Kind) {
633
619
    case TTI::SK_Broadcast:
634
47
      return getBroadcastShuffleOverhead(Tp);
635
619
    case TTI::SK_Select:
636
487
    case TTI::SK_Reverse:
637
487
    case TTI::SK_Transpose:
638
487
    case TTI::SK_PermuteSingleSrc:
639
487
    case TTI::SK_PermuteTwoSrc:
640
487
      return getPermuteShuffleOverhead(Tp);
641
487
    case TTI::SK_ExtractSubvector:
642
12
      return getExtractSubvectorOverhead(Tp, Index, SubTp);
643
487
    case TTI::SK_InsertSubvector:
644
73
      return getInsertSubvectorOverhead(Tp, Index, SubTp);
645
0
    }
646
0
    llvm_unreachable("Unknown TTI::ShuffleKind");
647
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
648
649
  unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
650
120k
                            const Instruction *I = nullptr) {
651
120k
    const TargetLoweringBase *TLI = getTLI();
652
120k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
653
120k
    assert(ISD && "Invalid opcode");
654
120k
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
655
120k
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
656
120k
657
120k
    // Check for NOOP conversions.
658
120k
    if (SrcLT.first == DstLT.first &&
659
120k
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()113k
) {
660
41.2k
661
41.2k
      // Bitcast between types that are legalized to the same type are free.
662
41.2k
      if (Opcode == Instruction::BitCast || 
Opcode == Instruction::Trunc29.3k
)
663
14.2k
        return 0;
664
106k
    }
665
106k
666
106k
    if (Opcode == Instruction::Trunc &&
667
106k
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)44.4k
)
668
24.4k
      return 0;
669
81.6k
670
81.6k
    if (Opcode == Instruction::ZExt &&
671
81.6k
        
TLI->isZExtFree(SrcLT.second, DstLT.second)20.6k
)
672
4.28k
      return 0;
673
77.3k
674
77.3k
    if (Opcode == Instruction::AddrSpaceCast &&
675
77.3k
        TLI->isFreeAddrSpaceCast(Src->getPointerAddressSpace(),
676
15
                                 Dst->getPointerAddressSpace()))
677
6
      return 0;
678
77.3k
679
77.3k
    // If this is a zext/sext of a load, return 0 if the corresponding
680
77.3k
    // extending load exists on target.
681
77.3k
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt60.9k
) &&
682
77.3k
        
I30.8k
&&
isa<LoadInst>(I->getOperand(0))3.10k
) {
683
785
        EVT ExtVT = EVT::getEVT(Dst);
684
785
        EVT LoadVT = EVT::getEVT(Src);
685
785
        unsigned LType =
686
785
          ((Opcode == Instruction::ZExt) ? 
ISD::ZEXTLOAD519
:
ISD::SEXTLOAD266
);
687
785
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
688
572
          return 0;
689
76.7k
    }
690
76.7k
691
76.7k
    // If the cast is marked as legal (or promote) then assume low cost.
692
76.7k
    if (SrcLT.first == DstLT.first &&
693
76.7k
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)69.8k
)
694
65.4k
      return 1;
695
11.3k
696
11.3k
    // Handle scalar conversions.
697
11.3k
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()3.34k
) {
698
3.34k
      // Scalar bitcasts are usually free.
699
3.34k
      if (Opcode == Instruction::BitCast)
700
67
        return 0;
701
3.28k
702
3.28k
      // Just check the op cost. If the operation is legal then assume it costs
703
3.28k
      // 1.
704
3.28k
      if (!TLI->isOperationExpand(ISD, DstLT.second))
705
2.98k
        return 1;
706
298
707
298
      // Assume that illegal scalar instruction are expensive.
708
298
      return 4;
709
298
    }
710
7.99k
711
7.99k
    // Check vector-to-vector casts.
712
7.99k
    if (Dst->isVectorTy() && Src->isVectorTy()) {
713
7.99k
      // If the cast is between same-sized registers, then the check is simple.
714
7.99k
      if (SrcLT.first == DstLT.first &&
715
7.99k
          
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()2.59k
) {
716
2.22k
717
2.22k
        // Assume that Zext is done using AND.
718
2.22k
        if (Opcode == Instruction::ZExt)
719
1.07k
          return 1;
720
1.15k
721
1.15k
        // Assume that sext is done using SHL and SRA.
722
1.15k
        if (Opcode == Instruction::SExt)
723
256
          return 2;
724
896
725
896
        // Just check the op cost. If the operation is legal then assume it
726
896
        // costs
727
896
        // 1 and multiply by the type-legalization overhead.
728
896
        if (!TLI->isOperationExpand(ISD, DstLT.second))
729
36
          return SrcLT.first * 1;
730
6.62k
      }
731
6.62k
732
6.62k
      // If we are legalizing by splitting, query the concrete TTI for the cost
733
6.62k
      // of casting the original vector twice. We also need to factor in the
734
6.62k
      // cost of the split itself. Count that as 1, to be consistent with
735
6.62k
      // TLI->getTypeLegalizationCost().
736
6.62k
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
737
6.62k
           TargetLowering::TypeSplitVector) ||
738
6.62k
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
739
4.79k
           TargetLowering::TypeSplitVector)) {
740
4.79k
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
741
4.79k
                                         Dst->getVectorNumElements() / 2);
742
4.79k
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
743
4.79k
                                         Src->getVectorNumElements() / 2);
744
4.79k
        T *TTI = static_cast<T *>(this);
745
4.79k
        return TTI->getVectorSplitCost() +
746
4.79k
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
747
4.79k
      }
748
1.83k
749
1.83k
      // In other cases where the source or destination are illegal, assume
750
1.83k
      // the operation will get scalarized.
751
1.83k
      unsigned Num = Dst->getVectorNumElements();
752
1.83k
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
753
1.83k
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
754
1.83k
755
1.83k
      // Return the cost of multiple scalar invocation plus the cost of
756
1.83k
      // inserting and extracting the values.
757
1.83k
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
758
1.83k
    }
759
0
760
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
761
0
    // This
762
0
    // is where we handle bitcast between vectors and scalars. We need to assume
763
0
    //  that the conversion is scalarized in one way or another.
764
0
    if (Opcode == Instruction::BitCast)
765
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
766
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
767
0
                                : 0) +
768
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
769
0
                                : 0);
770
0
771
0
    llvm_unreachable("Unhandled cast");
772
0
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
650
102k
                            const Instruction *I = nullptr) {
651
102k
    const TargetLoweringBase *TLI = getTLI();
652
102k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
653
102k
    assert(ISD && "Invalid opcode");
654
102k
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
655
102k
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
656
102k
657
102k
    // Check for NOOP conversions.
658
102k
    if (SrcLT.first == DstLT.first &&
659
102k
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()100k
) {
660
34.0k
661
34.0k
      // Bitcast between types that are legalized to the same type are free.
662
34.0k
      if (Opcode == Instruction::BitCast || 
Opcode == Instruction::Trunc23.3k
)
663
12.3k
        return 0;
664
89.9k
    }
665
89.9k
666
89.9k
    if (Opcode == Instruction::Trunc &&
667
89.9k
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)40.1k
)
668
23.3k
      return 0;
669
66.6k
670
66.6k
    if (Opcode == Instruction::ZExt &&
671
66.6k
        
TLI->isZExtFree(SrcLT.second, DstLT.second)16.9k
)
672
3.97k
      return 0;
673
62.6k
674
62.6k
    if (Opcode == Instruction::AddrSpaceCast &&
675
62.6k
        TLI->isFreeAddrSpaceCast(Src->getPointerAddressSpace(),
676
0
                                 Dst->getPointerAddressSpace()))
677
0
      return 0;
678
62.6k
679
62.6k
    // If this is a zext/sext of a load, return 0 if the corresponding
680
62.6k
    // extending load exists on target.
681
62.6k
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt49.7k
) &&
682
62.6k
        
I26.0k
&&
isa<LoadInst>(I->getOperand(0))0
) {
683
0
        EVT ExtVT = EVT::getEVT(Dst);
684
0
        EVT LoadVT = EVT::getEVT(Src);
685
0
        unsigned LType =
686
0
          ((Opcode == Instruction::ZExt) ? ISD::ZEXTLOAD : ISD::SEXTLOAD);
687
0
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
688
0
          return 0;
689
62.6k
    }
690
62.6k
691
62.6k
    // If the cast is marked as legal (or promote) then assume low cost.
692
62.6k
    if (SrcLT.first == DstLT.first &&
693
62.6k
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)61.1k
)
694
60.1k
      return 1;
695
2.52k
696
2.52k
    // Handle scalar conversions.
697
2.52k
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()1.10k
) {
698
1.10k
      // Scalar bitcasts are usually free.
699
1.10k
      if (Opcode == Instruction::BitCast)
700
0
        return 0;
701
1.10k
702
1.10k
      // Just check the op cost. If the operation is legal then assume it costs
703
1.10k
      // 1.
704
1.10k
      if (!TLI->isOperationExpand(ISD, DstLT.second))
705
1.10k
        return 1;
706
0
707
0
      // Assume that illegal scalar instruction are expensive.
708
0
      return 4;
709
0
    }
710
1.42k
711
1.42k
    // Check vector-to-vector casts.
712
1.42k
    if (Dst->isVectorTy() && Src->isVectorTy()) {
713
1.42k
      // If the cast is between same-sized registers, then the check is simple.
714
1.42k
      if (SrcLT.first == DstLT.first &&
715
1.42k
          
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()0
) {
716
0
717
0
        // Assume that Zext is done using AND.
718
0
        if (Opcode == Instruction::ZExt)
719
0
          return 1;
720
0
721
0
        // Assume that sext is done using SHL and SRA.
722
0
        if (Opcode == Instruction::SExt)
723
0
          return 2;
724
0
725
0
        // Just check the op cost. If the operation is legal then assume it
726
0
        // costs
727
0
        // 1 and multiply by the type-legalization overhead.
728
0
        if (!TLI->isOperationExpand(ISD, DstLT.second))
729
0
          return SrcLT.first * 1;
730
1.42k
      }
731
1.42k
732
1.42k
      // If we are legalizing by splitting, query the concrete TTI for the cost
733
1.42k
      // of casting the original vector twice. We also need to factor in the
734
1.42k
      // cost of the split itself. Count that as 1, to be consistent with
735
1.42k
      // TLI->getTypeLegalizationCost().
736
1.42k
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
737
1.42k
           TargetLowering::TypeSplitVector) ||
738
1.42k
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
739
1.38k
           TargetLowering::TypeSplitVector)) {
740
1.38k
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
741
1.38k
                                         Dst->getVectorNumElements() / 2);
742
1.38k
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
743
1.38k
                                         Src->getVectorNumElements() / 2);
744
1.38k
        T *TTI = static_cast<T *>(this);
745
1.38k
        return TTI->getVectorSplitCost() +
746
1.38k
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
747
1.38k
      }
748
36
749
36
      // In other cases where the source or destination are illegal, assume
750
36
      // the operation will get scalarized.
751
36
      unsigned Num = Dst->getVectorNumElements();
752
36
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
753
36
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
754
36
755
36
      // Return the cost of multiple scalar invocation plus the cost of
756
36
      // inserting and extracting the values.
757
36
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
758
36
    }
759
0
760
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
761
0
    // This
762
0
    // is where we handle bitcast between vectors and scalars. We need to assume
763
0
    //  that the conversion is scalarized in one way or another.
764
0
    if (Opcode == Instruction::BitCast)
765
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
766
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
767
0
                                : 0) +
768
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
769
0
                                : 0);
770
0
771
0
    llvm_unreachable("Unhandled cast");
772
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
650
17
                            const Instruction *I = nullptr) {
651
17
    const TargetLoweringBase *TLI = getTLI();
652
17
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
653
17
    assert(ISD && "Invalid opcode");
654
17
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
655
17
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
656
17
657
17
    // Check for NOOP conversions.
658
17
    if (SrcLT.first == DstLT.first &&
659
17
        SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()) {
660
15
661
15
      // Bitcast between types that are legalized to the same type are free.
662
15
      if (Opcode == Instruction::BitCast || Opcode == Instruction::Trunc)
663
0
        return 0;
664
17
    }
665
17
666
17
    if (Opcode == Instruction::Trunc &&
667
17
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)0
)
668
0
      return 0;
669
17
670
17
    if (Opcode == Instruction::ZExt &&
671
17
        
TLI->isZExtFree(SrcLT.second, DstLT.second)2
)
672
2
      return 0;
673
15
674
15
    if (Opcode == Instruction::AddrSpaceCast &&
675
15
        TLI->isFreeAddrSpaceCast(Src->getPointerAddressSpace(),
676
15
                                 Dst->getPointerAddressSpace()))
677
6
      return 0;
678
9
679
9
    // If this is a zext/sext of a load, return 0 if the corresponding
680
9
    // extending load exists on target.
681
9
    if ((Opcode == Instruction::ZExt || Opcode == Instruction::SExt) &&
682
9
        
I0
&&
isa<LoadInst>(I->getOperand(0))0
) {
683
0
        EVT ExtVT = EVT::getEVT(Dst);
684
0
        EVT LoadVT = EVT::getEVT(Src);
685
0
        unsigned LType =
686
0
          ((Opcode == Instruction::ZExt) ? ISD::ZEXTLOAD : ISD::SEXTLOAD);
687
0
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
688
0
          return 0;
689
9
    }
690
9
691
9
    // If the cast is marked as legal (or promote) then assume low cost.
692
9
    if (SrcLT.first == DstLT.first &&
693
9
        TLI->isOperationLegalOrPromote(ISD, DstLT.second))
694
0
      return 1;
695
9
696
9
    // Handle scalar conversions.
697
9
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()3
) {
698
3
      // Scalar bitcasts are usually free.
699
3
      if (Opcode == Instruction::BitCast)
700
0
        return 0;
701
3
702
3
      // Just check the op cost. If the operation is legal then assume it costs
703
3
      // 1.
704
3
      if (!TLI->isOperationExpand(ISD, DstLT.second))
705
3
        return 1;
706
0
707
0
      // Assume that illegal scalar instruction are expensive.
708
0
      return 4;
709
0
    }
710
6
711
6
    // Check vector-to-vector casts.
712
6
    if (Dst->isVectorTy() && Src->isVectorTy()) {
713
6
      // If the cast is between same-sized registers, then the check is simple.
714
6
      if (SrcLT.first == DstLT.first &&
715
6
          SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()) {
716
6
717
6
        // Assume that Zext is done using AND.
718
6
        if (Opcode == Instruction::ZExt)
719
0
          return 1;
720
6
721
6
        // Assume that sext is done using SHL and SRA.
722
6
        if (Opcode == Instruction::SExt)
723
0
          return 2;
724
6
725
6
        // Just check the op cost. If the operation is legal then assume it
726
6
        // costs
727
6
        // 1 and multiply by the type-legalization overhead.
728
6
        if (!TLI->isOperationExpand(ISD, DstLT.second))
729
0
          return SrcLT.first * 1;
730
6
      }
731
6
732
6
      // If we are legalizing by splitting, query the concrete TTI for the cost
733
6
      // of casting the original vector twice. We also need to factor in the
734
6
      // cost of the split itself. Count that as 1, to be consistent with
735
6
      // TLI->getTypeLegalizationCost().
736
6
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
737
6
           TargetLowering::TypeSplitVector) ||
738
6
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
739
4
           TargetLowering::TypeSplitVector)) {
740
4
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
741
4
                                         Dst->getVectorNumElements() / 2);
742
4
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
743
4
                                         Src->getVectorNumElements() / 2);
744
4
        T *TTI = static_cast<T *>(this);
745
4
        return TTI->getVectorSplitCost() +
746
4
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
747
4
      }
748
2
749
2
      // In other cases where the source or destination are illegal, assume
750
2
      // the operation will get scalarized.
751
2
      unsigned Num = Dst->getVectorNumElements();
752
2
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
753
2
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
754
2
755
2
      // Return the cost of multiple scalar invocation plus the cost of
756
2
      // inserting and extracting the values.
757
2
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
758
2
    }
759
0
760
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
761
0
    // This
762
0
    // is where we handle bitcast between vectors and scalars. We need to assume
763
0
    //  that the conversion is scalarized in one way or another.
764
0
    if (Opcode == Instruction::BitCast)
765
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
766
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
767
0
                                : 0) +
768
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
769
0
                                : 0);
770
0
771
0
    llvm_unreachable("Unhandled cast");
772
0
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
650
1.18k
                            const Instruction *I = nullptr) {
651
1.18k
    const TargetLoweringBase *TLI = getTLI();
652
1.18k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
653
1.18k
    assert(ISD && "Invalid opcode");
654
1.18k
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
655
1.18k
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
656
1.18k
657
1.18k
    // Check for NOOP conversions.
658
1.18k
    if (SrcLT.first == DstLT.first &&
659
1.18k
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()856
) {
660
606
661
606
      // Bitcast between types that are legalized to the same type are free.
662
606
      if (Opcode == Instruction::BitCast || 
Opcode == Instruction::Trunc302
)
663
316
        return 0;
664
865
    }
665
865
666
865
    if (Opcode == Instruction::Trunc &&
667
865
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)168
)
668
0
      return 0;
669
865
670
865
    if (Opcode == Instruction::ZExt &&
671
865
        
TLI->isZExtFree(SrcLT.second, DstLT.second)258
)
672
0
      return 0;
673
865
674
865
    if (Opcode == Instruction::AddrSpaceCast &&
675
865
        TLI->isFreeAddrSpaceCast(Src->getPointerAddressSpace(),
676
0
                                 Dst->getPointerAddressSpace()))
677
0
      return 0;
678
865
679
865
    // If this is a zext/sext of a load, return 0 if the corresponding
680
865
    // extending load exists on target.
681
865
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt607
) &&
682
865
        
I335
&&
isa<LoadInst>(I->getOperand(0))0
) {
683
0
        EVT ExtVT = EVT::getEVT(Dst);
684
0
        EVT LoadVT = EVT::getEVT(Src);
685
0
        unsigned LType =
686
0
          ((Opcode == Instruction::ZExt) ? ISD::ZEXTLOAD : ISD::SEXTLOAD);
687
0
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
688
0
          return 0;
689
865
    }
690
865
691
865
    // If the cast is marked as legal (or promote) then assume low cost.
692
865
    if (SrcLT.first == DstLT.first &&
693
865
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)540
)
694
395
      return 1;
695
470
696
470
    // Handle scalar conversions.
697
470
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()116
) {
698
116
      // Scalar bitcasts are usually free.
699
116
      if (Opcode == Instruction::BitCast)
700
58
        return 0;
701
58
702
58
      // Just check the op cost. If the operation is legal then assume it costs
703
58
      // 1.
704
58
      if (!TLI->isOperationExpand(ISD, DstLT.second))
705
58
        return 1;
706
0
707
0
      // Assume that illegal scalar instruction are expensive.
708
0
      return 4;
709
0
    }
710
354
711
354
    // Check vector-to-vector casts.
712
354
    if (Dst->isVectorTy() && Src->isVectorTy()) {
713
354
      // If the cast is between same-sized registers, then the check is simple.
714
354
      if (SrcLT.first == DstLT.first &&
715
354
          
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()144
) {
716
66
717
66
        // Assume that Zext is done using AND.
718
66
        if (Opcode == Instruction::ZExt)
719
0
          return 1;
720
66
721
66
        // Assume that sext is done using SHL and SRA.
722
66
        if (Opcode == Instruction::SExt)
723
0
          return 2;
724
66
725
66
        // Just check the op cost. If the operation is legal then assume it
726
66
        // costs
727
66
        // 1 and multiply by the type-legalization overhead.
728
66
        if (!TLI->isOperationExpand(ISD, DstLT.second))
729
12
          return SrcLT.first * 1;
730
342
      }
731
342
732
342
      // If we are legalizing by splitting, query the concrete TTI for the cost
733
342
      // of casting the original vector twice. We also need to factor in the
734
342
      // cost of the split itself. Count that as 1, to be consistent with
735
342
      // TLI->getTypeLegalizationCost().
736
342
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
737
342
           TargetLowering::TypeSplitVector) ||
738
342
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
739
228
           TargetLowering::TypeSplitVector)) {
740
228
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
741
228
                                         Dst->getVectorNumElements() / 2);
742
228
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
743
228
                                         Src->getVectorNumElements() / 2);
744
228
        T *TTI = static_cast<T *>(this);
745
228
        return TTI->getVectorSplitCost() +
746
228
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
747
228
      }
748
114
749
114
      // In other cases where the source or destination are illegal, assume
750
114
      // the operation will get scalarized.
751
114
      unsigned Num = Dst->getVectorNumElements();
752
114
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
753
114
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
754
114
755
114
      // Return the cost of multiple scalar invocation plus the cost of
756
114
      // inserting and extracting the values.
757
114
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
758
114
    }
759
0
760
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
761
0
    // This
762
0
    // is where we handle bitcast between vectors and scalars. We need to assume
763
0
    //  that the conversion is scalarized in one way or another.
764
0
    if (Opcode == Instruction::BitCast)
765
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
766
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
767
0
                                : 0) +
768
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
769
0
                                : 0);
770
0
771
0
    llvm_unreachable("Unhandled cast");
772
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
650
373
                            const Instruction *I = nullptr) {
651
373
    const TargetLoweringBase *TLI = getTLI();
652
373
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
653
373
    assert(ISD && "Invalid opcode");
654
373
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
655
373
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
656
373
657
373
    // Check for NOOP conversions.
658
373
    if (SrcLT.first == DstLT.first &&
659
373
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()372
) {
660
159
661
159
      // Bitcast between types that are legalized to the same type are free.
662
159
      if (Opcode == Instruction::BitCast || Opcode == Instruction::Trunc)
663
0
        return 0;
664
373
    }
665
373
666
373
    if (Opcode == Instruction::Trunc &&
667
373
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)172
)
668
172
      return 0;
669
201
670
201
    if (Opcode == Instruction::ZExt &&
671
201
        
TLI->isZExtFree(SrcLT.second, DstLT.second)16
)
672
0
      return 0;
673
201
674
201
    if (Opcode == Instruction::AddrSpaceCast &&
675
201
        TLI->isFreeAddrSpaceCast(Src->getPointerAddressSpace(),
676
0
                                 Dst->getPointerAddressSpace()))
677
0
      return 0;
678
201
679
201
    // If this is a zext/sext of a load, return 0 if the corresponding
680
201
    // extending load exists on target.
681
201
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt185
) &&
682
201
        
I21
&&
isa<LoadInst>(I->getOperand(0))0
) {
683
0
        EVT ExtVT = EVT::getEVT(Dst);
684
0
        EVT LoadVT = EVT::getEVT(Src);
685
0
        unsigned LType =
686
0
          ((Opcode == Instruction::ZExt) ? ISD::ZEXTLOAD : ISD::SEXTLOAD);
687
0
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
688
0
          return 0;
689
201
    }
690
201
691
201
    // If the cast is marked as legal (or promote) then assume low cost.
692
201
    if (SrcLT.first == DstLT.first &&
693
201
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)200
)
694
200
      return 1;
695
1
696
1
    // Handle scalar conversions.
697
1
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()0
) {
698
0
      // Scalar bitcasts are usually free.
699
0
      if (Opcode == Instruction::BitCast)
700
0
        return 0;
701
0
702
0
      // Just check the op cost. If the operation is legal then assume it costs
703
0
      // 1.
704
0
      if (!TLI->isOperationExpand(ISD, DstLT.second))
705
0
        return 1;
706
0
707
0
      // Assume that illegal scalar instruction are expensive.
708
0
      return 4;
709
0
    }
710
1
711
1
    // Check vector-to-vector casts.
712
1
    if (Dst->isVectorTy() && Src->isVectorTy()) {
713
1
      // If the cast is between same-sized registers, then the check is simple.
714
1
      if (SrcLT.first == DstLT.first &&
715
1
          
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()0
) {
716
0
717
0
        // Assume that Zext is done using AND.
718
0
        if (Opcode == Instruction::ZExt)
719
0
          return 1;
720
0
721
0
        // Assume that sext is done using SHL and SRA.
722
0
        if (Opcode == Instruction::SExt)
723
0
          return 2;
724
0
725
0
        // Just check the op cost. If the operation is legal then assume it
726
0
        // costs
727
0
        // 1 and multiply by the type-legalization overhead.
728
0
        if (!TLI->isOperationExpand(ISD, DstLT.second))
729
0
          return SrcLT.first * 1;
730
1
      }
731
1
732
1
      // If we are legalizing by splitting, query the concrete TTI for the cost
733
1
      // of casting the original vector twice. We also need to factor in the
734
1
      // cost of the split itself. Count that as 1, to be consistent with
735
1
      // TLI->getTypeLegalizationCost().
736
1
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
737
1
           TargetLowering::TypeSplitVector) ||
738
1
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
739
1
           TargetLowering::TypeSplitVector)) {
740
1
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
741
1
                                         Dst->getVectorNumElements() / 2);
742
1
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
743
1
                                         Src->getVectorNumElements() / 2);
744
1
        T *TTI = static_cast<T *>(this);
745
1
        return TTI->getVectorSplitCost() +
746
1
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
747
1
      }
748
0
749
0
      // In other cases where the source or destination are illegal, assume
750
0
      // the operation will get scalarized.
751
0
      unsigned Num = Dst->getVectorNumElements();
752
0
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
753
0
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
754
0
755
0
      // Return the cost of multiple scalar invocation plus the cost of
756
0
      // inserting and extracting the values.
757
0
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
758
0
    }
759
0
760
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
761
0
    // This
762
0
    // is where we handle bitcast between vectors and scalars. We need to assume
763
0
    //  that the conversion is scalarized in one way or another.
764
0
    if (Opcode == Instruction::BitCast)
765
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
766
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
767
0
                                : 0) +
768
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
769
0
                                : 0);
770
0
771
0
    llvm_unreachable("Unhandled cast");
772
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::RISCVTTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
650
351
                            const Instruction *I = nullptr) {
651
351
    const TargetLoweringBase *TLI = getTLI();
652
351
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
653
351
    assert(ISD && "Invalid opcode");
654
351
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
655
351
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
656
351
657
351
    // Check for NOOP conversions.
658
351
    if (SrcLT.first == DstLT.first &&
659
351
        SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()) {
660
104
661
104
      // Bitcast between types that are legalized to the same type are free.
662
104
      if (Opcode == Instruction::BitCast || Opcode == Instruction::Trunc)
663
10
        return 0;
664
341
    }
665
341
666
341
    if (Opcode == Instruction::Trunc &&
667
341
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)41
)
668
41
      return 0;
669
300
670
300
    if (Opcode == Instruction::ZExt &&
671
300
        
TLI->isZExtFree(SrcLT.second, DstLT.second)22
)
672
0
      return 0;
673
300
674
300
    if (Opcode == Instruction::AddrSpaceCast &&
675
300
        TLI->isFreeAddrSpaceCast(Src->getPointerAddressSpace(),
676
0
                                 Dst->getPointerAddressSpace()))
677
0
      return 0;
678
300
679
300
    // If this is a zext/sext of a load, return 0 if the corresponding
680
300
    // extending load exists on target.
681
300
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt278
) &&
682
300
        
I88
&&
isa<LoadInst>(I->getOperand(0))88
) {
683
76
        EVT ExtVT = EVT::getEVT(Dst);
684
76
        EVT LoadVT = EVT::getEVT(Src);
685
76
        unsigned LType =
686
76
          ((Opcode == Instruction::ZExt) ? 
ISD::ZEXTLOAD16
:
ISD::SEXTLOAD60
);
687
76
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
688
76
          return 0;
689
224
    }
690
224
691
224
    // If the cast is marked as legal (or promote) then assume low cost.
692
224
    if (SrcLT.first == DstLT.first &&
693
224
        TLI->isOperationLegalOrPromote(ISD, DstLT.second))
694
224
      return 1;
695
0
696
0
    // Handle scalar conversions.
697
0
    if (!Src->isVectorTy() && !Dst->isVectorTy()) {
698
0
      // Scalar bitcasts are usually free.
699
0
      if (Opcode == Instruction::BitCast)
700
0
        return 0;
701
0
702
0
      // Just check the op cost. If the operation is legal then assume it costs
703
0
      // 1.
704
0
      if (!TLI->isOperationExpand(ISD, DstLT.second))
705
0
        return 1;
706
0
707
0
      // Assume that illegal scalar instruction are expensive.
708
0
      return 4;
709
0
    }
710
0
711
0
    // Check vector-to-vector casts.
712
0
    if (Dst->isVectorTy() && Src->isVectorTy()) {
713
0
      // If the cast is between same-sized registers, then the check is simple.
714
0
      if (SrcLT.first == DstLT.first &&
715
0
          SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()) {
716
0
717
0
        // Assume that Zext is done using AND.
718
0
        if (Opcode == Instruction::ZExt)
719
0
          return 1;
720
0
721
0
        // Assume that sext is done using SHL and SRA.
722
0
        if (Opcode == Instruction::SExt)
723
0
          return 2;
724
0
725
0
        // Just check the op cost. If the operation is legal then assume it
726
0
        // costs
727
0
        // 1 and multiply by the type-legalization overhead.
728
0
        if (!TLI->isOperationExpand(ISD, DstLT.second))
729
0
          return SrcLT.first * 1;
730
0
      }
731
0
732
0
      // If we are legalizing by splitting, query the concrete TTI for the cost
733
0
      // of casting the original vector twice. We also need to factor in the
734
0
      // cost of the split itself. Count that as 1, to be consistent with
735
0
      // TLI->getTypeLegalizationCost().
736
0
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
737
0
           TargetLowering::TypeSplitVector) ||
738
0
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
739
0
           TargetLowering::TypeSplitVector)) {
740
0
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
741
0
                                         Dst->getVectorNumElements() / 2);
742
0
        Type *SplitS