Coverage Report

Created: 2018-09-19 08:35

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/CodeGen/BasicTTIImpl.h
Line
Count
Source (jump to first uncovered line)
1
//===- BasicTTIImpl.h -------------------------------------------*- C++ -*-===//
2
//
3
//                     The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
/// \file
11
/// This file provides a helper that implements much of the TTI interface in
12
/// terms of the target-independent code generator and TargetLowering
13
/// interfaces.
14
//
15
//===----------------------------------------------------------------------===//
16
17
#ifndef LLVM_CODEGEN_BASICTTIIMPL_H
18
#define LLVM_CODEGEN_BASICTTIIMPL_H
19
20
#include "llvm/ADT/APInt.h"
21
#include "llvm/ADT/ArrayRef.h"
22
#include "llvm/ADT/BitVector.h"
23
#include "llvm/ADT/SmallPtrSet.h"
24
#include "llvm/ADT/SmallVector.h"
25
#include "llvm/Analysis/LoopInfo.h"
26
#include "llvm/Analysis/TargetTransformInfo.h"
27
#include "llvm/Analysis/TargetTransformInfoImpl.h"
28
#include "llvm/CodeGen/ISDOpcodes.h"
29
#include "llvm/CodeGen/TargetLowering.h"
30
#include "llvm/CodeGen/TargetSubtargetInfo.h"
31
#include "llvm/CodeGen/ValueTypes.h"
32
#include "llvm/IR/BasicBlock.h"
33
#include "llvm/IR/CallSite.h"
34
#include "llvm/IR/Constant.h"
35
#include "llvm/IR/Constants.h"
36
#include "llvm/IR/DataLayout.h"
37
#include "llvm/IR/DerivedTypes.h"
38
#include "llvm/IR/InstrTypes.h"
39
#include "llvm/IR/Instruction.h"
40
#include "llvm/IR/Instructions.h"
41
#include "llvm/IR/Intrinsics.h"
42
#include "llvm/IR/Operator.h"
43
#include "llvm/IR/Type.h"
44
#include "llvm/IR/Value.h"
45
#include "llvm/MC/MCSchedule.h"
46
#include "llvm/Support/Casting.h"
47
#include "llvm/Support/CommandLine.h"
48
#include "llvm/Support/ErrorHandling.h"
49
#include "llvm/Support/MachineValueType.h"
50
#include "llvm/Support/MathExtras.h"
51
#include <algorithm>
52
#include <cassert>
53
#include <cstdint>
54
#include <limits>
55
#include <utility>
56
57
namespace llvm {
58
59
class Function;
60
class GlobalValue;
61
class LLVMContext;
62
class ScalarEvolution;
63
class SCEV;
64
class TargetMachine;
65
66
extern cl::opt<unsigned> PartialUnrollingThreshold;
67
68
/// Base class which can be used to help build a TTI implementation.
69
///
70
/// This class provides as much implementation of the TTI interface as is
71
/// possible using the target independent parts of the code generator.
72
///
73
/// In order to subclass it, your class must implement a getST() method to
74
/// return the subtarget, and a getTLI() method to return the target lowering.
75
/// We need these methods implemented in the derived class so that this class
76
/// doesn't have to duplicate storage for them.
77
template <typename T>
78
class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
79
private:
80
  using BaseT = TargetTransformInfoImplCRTPBase<T>;
81
  using TTI = TargetTransformInfo;
82
83
  /// Estimate a cost of shuffle as a sequence of extract and insert
84
  /// operations.
85
870
  unsigned getPermuteShuffleOverhead(Type *Ty) {
86
870
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
87
870
    unsigned Cost = 0;
88
870
    // Shuffle cost is equal to the cost of extracting element from its argument
89
870
    // plus the cost of inserting them onto the result vector.
90
870
91
870
    // e.g. <4 x float> has a mask of <0,5,2,7> i.e we need to extract from
92
870
    // index 0 of first vector, index 1 of second vector,index 2 of first
93
870
    // vector and finally index 3 of second vector and insert them at index
94
870
    // <0,1,2,3> of result vector.
95
5.22k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i4.35k
) {
96
4.35k
      Cost += static_cast<T *>(this)
97
4.35k
                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
98
4.35k
      Cost += static_cast<T *>(this)
99
4.35k
                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
100
4.35k
    }
101
870
    return Cost;
102
870
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Line
Count
Source
85
694
  unsigned getPermuteShuffleOverhead(Type *Ty) {
86
694
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
87
694
    unsigned Cost = 0;
88
694
    // Shuffle cost is equal to the cost of extracting element from its argument
89
694
    // plus the cost of inserting them onto the result vector.
90
694
91
694
    // e.g. <4 x float> has a mask of <0,5,2,7> i.e we need to extract from
92
694
    // index 0 of first vector, index 1 of second vector,index 2 of first
93
694
    // vector and finally index 3 of second vector and insert them at index
94
694
    // <0,1,2,3> of result vector.
95
4.29k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i3.59k
) {
96
3.59k
      Cost += static_cast<T *>(this)
97
3.59k
                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
98
3.59k
      Cost += static_cast<T *>(this)
99
3.59k
                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
100
3.59k
    }
101
694
    return Cost;
102
694
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Line
Count
Source
85
3
  unsigned getPermuteShuffleOverhead(Type *Ty) {
86
3
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
87
3
    unsigned Cost = 0;
88
3
    // Shuffle cost is equal to the cost of extracting element from its argument
89
3
    // plus the cost of inserting them onto the result vector.
90
3
91
3
    // e.g. <4 x float> has a mask of <0,5,2,7> i.e we need to extract from
92
3
    // index 0 of first vector, index 1 of second vector,index 2 of first
93
3
    // vector and finally index 3 of second vector and insert them at index
94
3
    // <0,1,2,3> of result vector.
95
9
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i6
) {
96
6
      Cost += static_cast<T *>(this)
97
6
                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
98
6
      Cost += static_cast<T *>(this)
99
6
                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
100
6
    }
101
3
    return Cost;
102
3
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Line
Count
Source
85
36
  unsigned getPermuteShuffleOverhead(Type *Ty) {
86
36
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
87
36
    unsigned Cost = 0;
88
36
    // Shuffle cost is equal to the cost of extracting element from its argument
89
36
    // plus the cost of inserting them onto the result vector.
90
36
91
36
    // e.g. <4 x float> has a mask of <0,5,2,7> i.e we need to extract from
92
36
    // index 0 of first vector, index 1 of second vector,index 2 of first
93
36
    // vector and finally index 3 of second vector and insert them at index
94
36
    // <0,1,2,3> of result vector.
95
180
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i144
) {
96
144
      Cost += static_cast<T *>(this)
97
144
                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
98
144
      Cost += static_cast<T *>(this)
99
144
                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
100
144
    }
101
36
    return Cost;
102
36
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Line
Count
Source
85
137
  unsigned getPermuteShuffleOverhead(Type *Ty) {
86
137
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
87
137
    unsigned Cost = 0;
88
137
    // Shuffle cost is equal to the cost of extracting element from its argument
89
137
    // plus the cost of inserting them onto the result vector.
90
137
91
137
    // e.g. <4 x float> has a mask of <0,5,2,7> i.e we need to extract from
92
137
    // index 0 of first vector, index 1 of second vector,index 2 of first
93
137
    // vector and finally index 3 of second vector and insert them at index
94
137
    // <0,1,2,3> of result vector.
95
745
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i608
) {
96
608
      Cost += static_cast<T *>(this)
97
608
                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
98
608
      Cost += static_cast<T *>(this)
99
608
                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
100
608
    }
101
137
    return Cost;
102
137
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
103
104
  /// Local query method delegates up to T which *must* implement this!
105
388k
  const TargetSubtargetInfo *getST() const {
106
388k
    return static_cast<const T *>(this)->getST();
107
388k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getST() const
Line
Count
Source
105
357k
  const TargetSubtargetInfo *getST() const {
106
357k
    return static_cast<const T *>(this)->getST();
107
357k
  }
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
105
6.77k
  const TargetSubtargetInfo *getST() const {
106
6.77k
    return static_cast<const T *>(this)->getST();
107
6.77k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getST() const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getST() const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getST() const
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getST() const
Line
Count
Source
105
2
  const TargetSubtargetInfo *getST() const {
106
2
    return static_cast<const T *>(this)->getST();
107
2
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getST() const
Line
Count
Source
105
528
  const TargetSubtargetInfo *getST() const {
106
528
    return static_cast<const T *>(this)->getST();
107
528
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getST() const
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getST() const
Line
Count
Source
105
23.0k
  const TargetSubtargetInfo *getST() const {
106
23.0k
    return static_cast<const T *>(this)->getST();
107
23.0k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getST() const
108
109
  /// Local query method delegates up to T which *must* implement this!
110
97.0M
  const TargetLoweringBase *getTLI() const {
111
97.0M
    return static_cast<const T *>(this)->getTLI();
112
97.0M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getTLI() const
Line
Count
Source
110
88.1M
  const TargetLoweringBase *getTLI() const {
111
88.1M
    return static_cast<const T *>(this)->getTLI();
112
88.1M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getTLI() const
Line
Count
Source
110
2.92k
  const TargetLoweringBase *getTLI() const {
111
2.92k
    return static_cast<const T *>(this)->getTLI();
112
2.92k
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getTLI() const
Line
Count
Source
110
59.0k
  const TargetLoweringBase *getTLI() const {
111
59.0k
    return static_cast<const T *>(this)->getTLI();
112
59.0k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getTLI() const
Line
Count
Source
110
1.27M
  const TargetLoweringBase *getTLI() const {
111
1.27M
    return static_cast<const T *>(this)->getTLI();
112
1.27M
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getTLI() const
Line
Count
Source
110
40.5k
  const TargetLoweringBase *getTLI() const {
111
40.5k
    return static_cast<const T *>(this)->getTLI();
112
40.5k
  }
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getTLI() const
Line
Count
Source
110
44
  const TargetLoweringBase *getTLI() const {
111
44
    return static_cast<const T *>(this)->getTLI();
112
44
  }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getTLI() const
Line
Count
Source
110
455
  const TargetLoweringBase *getTLI() const {
111
455
    return static_cast<const T *>(this)->getTLI();
112
455
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getTLI() const
Line
Count
Source
110
1.21k
  const TargetLoweringBase *getTLI() const {
111
1.21k
    return static_cast<const T *>(this)->getTLI();
112
1.21k
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getTLI() const
Line
Count
Source
110
58.3k
  const TargetLoweringBase *getTLI() const {
111
58.3k
    return static_cast<const T *>(this)->getTLI();
112
58.3k
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getTLI() const
Line
Count
Source
110
10.4k
  const TargetLoweringBase *getTLI() const {
111
10.4k
    return static_cast<const T *>(this)->getTLI();
112
10.4k
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getTLI() const
Line
Count
Source
110
7.44M
  const TargetLoweringBase *getTLI() const {
111
7.44M
    return static_cast<const T *>(this)->getTLI();
112
7.44M
  }
llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getTLI() const
Line
Count
Source
110
10
  const TargetLoweringBase *getTLI() const {
111
10
    return static_cast<const T *>(this)->getTLI();
112
10
  }
113
114
7.71k
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
115
7.71k
    switch (M) {
116
7.71k
      case TTI::MIM_Unindexed:
117
0
        return ISD::UNINDEXED;
118
7.71k
      case TTI::MIM_PreInc:
119
0
        return ISD::PRE_INC;
120
7.71k
      case TTI::MIM_PreDec:
121
0
        return ISD::PRE_DEC;
122
7.71k
      case TTI::MIM_PostInc:
123
7.71k
        return ISD::POST_INC;
124
7.71k
      case TTI::MIM_PostDec:
125
0
        return ISD::POST_DEC;
126
0
    }
127
0
    llvm_unreachable("Unexpected MemIndexedMode");
128
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Line
Count
Source
114
7.71k
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
115
7.71k
    switch (M) {
116
7.71k
      case TTI::MIM_Unindexed:
117
0
        return ISD::UNINDEXED;
118
7.71k
      case TTI::MIM_PreInc:
119
0
        return ISD::PRE_INC;
120
7.71k
      case TTI::MIM_PreDec:
121
0
        return ISD::PRE_DEC;
122
7.71k
      case TTI::MIM_PostInc:
123
7.71k
        return ISD::POST_INC;
124
7.71k
      case TTI::MIM_PostDec:
125
0
        return ISD::POST_DEC;
126
0
    }
127
0
    llvm_unreachable("Unexpected MemIndexedMode");
128
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getISDIndexedMode(llvm::TargetTransformInfo::MemIndexedMode)
129
130
protected:
131
  explicit BasicTTIImplBase(const TargetMachine *TM, const DataLayout &DL)
132
17.1M
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
12.5M
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
40.6k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::AMDGPUTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
451k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
411k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
706k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
36.7k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
742
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
20.6k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
94.1k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
85.6k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
2.68M
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
2.24k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
107k
      : BaseT(DL) {}
133
134
  using TargetTransformInfoImplBase::DL;
135
136
public:
137
  /// \name Scalar TTI Implementations
138
  /// @{
139
  bool allowsMisalignedMemoryAccesses(LLVMContext &Context,
140
                                      unsigned BitWidth, unsigned AddressSpace,
141
8.22k
                                      unsigned Alignment, bool *Fast) const {
142
8.22k
    EVT E = EVT::getIntegerVT(Context, BitWidth);
143
8.22k
    return getTLI()->allowsMisalignedMemoryAccesses(E, AddressSpace, Alignment, Fast);
144
8.22k
  }
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
141
118
                                      unsigned Alignment, bool *Fast) const {
142
118
    EVT E = EVT::getIntegerVT(Context, BitWidth);
143
118
    return getTLI()->allowsMisalignedMemoryAccesses(E, AddressSpace, Alignment, Fast);
144
118
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
Line
Count
Source
141
8.06k
                                      unsigned Alignment, bool *Fast) const {
142
8.06k
    EVT E = EVT::getIntegerVT(Context, BitWidth);
143
8.06k
    return getTLI()->allowsMisalignedMemoryAccesses(E, AddressSpace, Alignment, Fast);
144
8.06k
  }
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
141
21
                                      unsigned Alignment, bool *Fast) const {
142
21
    EVT E = EVT::getIntegerVT(Context, BitWidth);
143
21
    return getTLI()->allowsMisalignedMemoryAccesses(E, AddressSpace, Alignment, Fast);
144
21
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
Line
Count
Source
141
24
                                      unsigned Alignment, bool *Fast) const {
142
24
    EVT E = EVT::getIntegerVT(Context, BitWidth);
143
24
    return getTLI()->allowsMisalignedMemoryAccesses(E, AddressSpace, Alignment, Fast);
144
24
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
145
146
7.92M
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::hasBranchDivergence()
Line
Count
Source
146
5.40M
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::hasBranchDivergence()
Line
Count
Source
146
14.2k
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::hasBranchDivergence()
Line
Count
Source
146
508k
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::hasBranchDivergence()
Line
Count
Source
146
488
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::hasBranchDivergence()
Line
Count
Source
146
64.5k
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::hasBranchDivergence()
Line
Count
Source
146
52.1k
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::hasBranchDivergence()
Line
Count
Source
146
38.3k
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::hasBranchDivergence()
Line
Count
Source
146
1.83M
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::hasBranchDivergence()
Line
Count
Source
146
1.54k
  bool hasBranchDivergence() { return false; }
147
148
0
  bool isSourceOfDivergence(const Value *V) { return false; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isSourceOfDivergence(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isSourceOfDivergence(llvm::Value const*)
149
150
28
  bool isAlwaysUniform(const Value *V) { return false; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isAlwaysUniform(llvm::Value const*)
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isAlwaysUniform(llvm::Value const*)
Line
Count
Source
150
28
  bool isAlwaysUniform(const Value *V) { return false; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isAlwaysUniform(llvm::Value const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isAlwaysUniform(llvm::Value const*)
151
152
2.38k
  unsigned getFlatAddressSpace() {
153
2.38k
    // Return an invalid address space.
154
2.38k
    return -1;
155
2.38k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getFlatAddressSpace()
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getFlatAddressSpace()
Line
Count
Source
152
2.38k
  unsigned getFlatAddressSpace() {
153
2.38k
    // Return an invalid address space.
154
2.38k
    return -1;
155
2.38k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getFlatAddressSpace()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getFlatAddressSpace()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getFlatAddressSpace()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getFlatAddressSpace()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getFlatAddressSpace()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getFlatAddressSpace()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getFlatAddressSpace()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getFlatAddressSpace()
156
157
2.62M
  bool isLegalAddImmediate(int64_t imm) {
158
2.62M
    return getTLI()->isLegalAddImmediate(imm);
159
2.62M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
157
2.55M
  bool isLegalAddImmediate(int64_t imm) {
158
2.55M
    return getTLI()->isLegalAddImmediate(imm);
159
2.55M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
157
14
  bool isLegalAddImmediate(int64_t imm) {
158
14
    return getTLI()->isLegalAddImmediate(imm);
159
14
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
157
296
  bool isLegalAddImmediate(int64_t imm) {
158
296
    return getTLI()->isLegalAddImmediate(imm);
159
296
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
157
24.1k
  bool isLegalAddImmediate(int64_t imm) {
158
24.1k
    return getTLI()->isLegalAddImmediate(imm);
159
24.1k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
157
1.22k
  bool isLegalAddImmediate(int64_t imm) {
158
1.22k
    return getTLI()->isLegalAddImmediate(imm);
159
1.22k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isLegalAddImmediate(long long)
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
157
5
  bool isLegalAddImmediate(int64_t imm) {
158
5
    return getTLI()->isLegalAddImmediate(imm);
159
5
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
157
19
  bool isLegalAddImmediate(int64_t imm) {
158
19
    return getTLI()->isLegalAddImmediate(imm);
159
19
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
157
2.76k
  bool isLegalAddImmediate(int64_t imm) {
158
2.76k
    return getTLI()->isLegalAddImmediate(imm);
159
2.76k
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
157
21
  bool isLegalAddImmediate(int64_t imm) {
158
21
    return getTLI()->isLegalAddImmediate(imm);
159
21
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
157
36.1k
  bool isLegalAddImmediate(int64_t imm) {
158
36.1k
    return getTLI()->isLegalAddImmediate(imm);
159
36.1k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isLegalAddImmediate(long long)
160
161
533k
  bool isLegalICmpImmediate(int64_t imm) {
162
533k
    return getTLI()->isLegalICmpImmediate(imm);
163
533k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
161
451k
  bool isLegalICmpImmediate(int64_t imm) {
162
451k
    return getTLI()->isLegalICmpImmediate(imm);
163
451k
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
161
74
  bool isLegalICmpImmediate(int64_t imm) {
162
74
    return getTLI()->isLegalICmpImmediate(imm);
163
74
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
161
470
  bool isLegalICmpImmediate(int64_t imm) {
162
470
    return getTLI()->isLegalICmpImmediate(imm);
163
470
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
161
11.1k
  bool isLegalICmpImmediate(int64_t imm) {
162
11.1k
    return getTLI()->isLegalICmpImmediate(imm);
163
11.1k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
161
1.28k
  bool isLegalICmpImmediate(int64_t imm) {
162
1.28k
    return getTLI()->isLegalICmpImmediate(imm);
163
1.28k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isLegalICmpImmediate(long long)
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
161
22
  bool isLegalICmpImmediate(int64_t imm) {
162
22
    return getTLI()->isLegalICmpImmediate(imm);
163
22
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
161
48
  bool isLegalICmpImmediate(int64_t imm) {
162
48
    return getTLI()->isLegalICmpImmediate(imm);
163
48
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
161
2.78k
  bool isLegalICmpImmediate(int64_t imm) {
162
2.78k
    return getTLI()->isLegalICmpImmediate(imm);
163
2.78k
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
161
222
  bool isLegalICmpImmediate(int64_t imm) {
162
222
    return getTLI()->isLegalICmpImmediate(imm);
163
222
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
161
66.4k
  bool isLegalICmpImmediate(int64_t imm) {
162
66.4k
    return getTLI()->isLegalICmpImmediate(imm);
163
66.4k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isLegalICmpImmediate(long long)
164
165
  bool isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset,
166
                             bool HasBaseReg, int64_t Scale,
167
55.7M
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
55.7M
    TargetLoweringBase::AddrMode AM;
169
55.7M
    AM.BaseGV = BaseGV;
170
55.7M
    AM.BaseOffs = BaseOffset;
171
55.7M
    AM.HasBaseReg = HasBaseReg;
172
55.7M
    AM.Scale = Scale;
173
55.7M
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
55.7M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
50.9M
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
50.9M
    TargetLoweringBase::AddrMode AM;
169
50.9M
    AM.BaseGV = BaseGV;
170
50.9M
    AM.BaseOffs = BaseOffset;
171
50.9M
    AM.HasBaseReg = HasBaseReg;
172
50.9M
    AM.Scale = Scale;
173
50.9M
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
50.9M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
2.36k
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
2.36k
    TargetLoweringBase::AddrMode AM;
169
2.36k
    AM.BaseGV = BaseGV;
170
2.36k
    AM.BaseOffs = BaseOffset;
171
2.36k
    AM.HasBaseReg = HasBaseReg;
172
2.36k
    AM.Scale = Scale;
173
2.36k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
2.36k
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
42.0k
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
42.0k
    TargetLoweringBase::AddrMode AM;
169
42.0k
    AM.BaseGV = BaseGV;
170
42.0k
    AM.BaseOffs = BaseOffset;
171
42.0k
    AM.HasBaseReg = HasBaseReg;
172
42.0k
    AM.Scale = Scale;
173
42.0k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
42.0k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
445k
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
445k
    TargetLoweringBase::AddrMode AM;
169
445k
    AM.BaseGV = BaseGV;
170
445k
    AM.BaseOffs = BaseOffset;
171
445k
    AM.HasBaseReg = HasBaseReg;
172
445k
    AM.Scale = Scale;
173
445k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
445k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
21.7k
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
21.7k
    TargetLoweringBase::AddrMode AM;
169
21.7k
    AM.BaseGV = BaseGV;
170
21.7k
    AM.BaseOffs = BaseOffset;
171
21.7k
    AM.HasBaseReg = HasBaseReg;
172
21.7k
    AM.Scale = Scale;
173
21.7k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
21.7k
  }
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
32
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
32
    TargetLoweringBase::AddrMode AM;
169
32
    AM.BaseGV = BaseGV;
170
32
    AM.BaseOffs = BaseOffset;
171
32
    AM.HasBaseReg = HasBaseReg;
172
32
    AM.Scale = Scale;
173
32
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
32
  }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
333
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
333
    TargetLoweringBase::AddrMode AM;
169
333
    AM.BaseGV = BaseGV;
170
333
    AM.BaseOffs = BaseOffset;
171
333
    AM.HasBaseReg = HasBaseReg;
172
333
    AM.Scale = Scale;
173
333
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
333
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
881
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
881
    TargetLoweringBase::AddrMode AM;
169
881
    AM.BaseGV = BaseGV;
170
881
    AM.BaseOffs = BaseOffset;
171
881
    AM.HasBaseReg = HasBaseReg;
172
881
    AM.Scale = Scale;
173
881
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
881
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
38.6k
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
38.6k
    TargetLoweringBase::AddrMode AM;
169
38.6k
    AM.BaseGV = BaseGV;
170
38.6k
    AM.BaseOffs = BaseOffset;
171
38.6k
    AM.HasBaseReg = HasBaseReg;
172
38.6k
    AM.Scale = Scale;
173
38.6k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
38.6k
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
4.13k
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
4.13k
    TargetLoweringBase::AddrMode AM;
169
4.13k
    AM.BaseGV = BaseGV;
170
4.13k
    AM.BaseOffs = BaseOffset;
171
4.13k
    AM.HasBaseReg = HasBaseReg;
172
4.13k
    AM.Scale = Scale;
173
4.13k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
4.13k
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
4.19M
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
4.19M
    TargetLoweringBase::AddrMode AM;
169
4.19M
    AM.BaseGV = BaseGV;
170
4.19M
    AM.BaseOffs = BaseOffset;
171
4.19M
    AM.HasBaseReg = HasBaseReg;
172
4.19M
    AM.Scale = Scale;
173
4.19M
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
4.19M
  }
llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
10
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
10
    TargetLoweringBase::AddrMode AM;
169
10
    AM.BaseGV = BaseGV;
170
10
    AM.BaseOffs = BaseOffset;
171
10
    AM.HasBaseReg = HasBaseReg;
172
10
    AM.Scale = Scale;
173
10
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
10
  }
175
176
  bool isIndexedLoadLegal(TTI::MemIndexedMode M, Type *Ty,
177
7.71k
                          const DataLayout &DL) const {
178
7.71k
    EVT VT = getTLI()->getValueType(DL, Ty);
179
7.71k
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
180
7.71k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Line
Count
Source
177
7.71k
                          const DataLayout &DL) const {
178
7.71k
    EVT VT = getTLI()->getValueType(DL, Ty);
179
7.71k
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
180
7.71k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isIndexedLoadLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
181
182
  bool isIndexedStoreLegal(TTI::MemIndexedMode M, Type *Ty,
183
0
                           const DataLayout &DL) const {
184
0
    EVT VT = getTLI()->getValueType(DL, Ty);
185
0
    return getTLI()->isIndexedStoreLegal(getISDIndexedMode(M), VT);
186
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isIndexedStoreLegal(llvm::TargetTransformInfo::MemIndexedMode, llvm::Type*, llvm::DataLayout const&) const
187
188
3.83M
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
189
3.83M
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
190
3.83M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
188
3.76M
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
189
3.76M
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
190
3.76M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
188
74
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
189
74
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
190
74
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
188
842
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
189
842
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
190
842
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
188
59.2k
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
189
59.2k
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
190
59.2k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
188
4.38k
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
189
4.38k
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
190
4.38k
  }
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
188
28
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
189
28
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
190
28
  }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
188
142
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
189
142
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
190
142
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
188
130
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
189
130
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
190
130
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
188
4.10k
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
189
4.10k
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
190
4.10k
  }
llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
188
2
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
189
2
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
190
2
  }
191
192
  int getScalingFactorCost(Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset,
193
5.60M
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
194
5.60M
    TargetLoweringBase::AddrMode AM;
195
5.60M
    AM.BaseGV = BaseGV;
196
5.60M
    AM.BaseOffs = BaseOffset;
197
5.60M
    AM.HasBaseReg = HasBaseReg;
198
5.60M
    AM.Scale = Scale;
199
5.60M
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
200
5.60M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
193
4.83M
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
194
4.83M
    TargetLoweringBase::AddrMode AM;
195
4.83M
    AM.BaseGV = BaseGV;
196
4.83M
    AM.BaseOffs = BaseOffset;
197
4.83M
    AM.HasBaseReg = HasBaseReg;
198
4.83M
    AM.Scale = Scale;
199
4.83M
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
200
4.83M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
193
10
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
194
10
    TargetLoweringBase::AddrMode AM;
195
10
    AM.BaseGV = BaseGV;
196
10
    AM.BaseOffs = BaseOffset;
197
10
    AM.HasBaseReg = HasBaseReg;
198
10
    AM.Scale = Scale;
199
10
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
200
10
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
193
434
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
194
434
    TargetLoweringBase::AddrMode AM;
195
434
    AM.BaseGV = BaseGV;
196
434
    AM.BaseOffs = BaseOffset;
197
434
    AM.HasBaseReg = HasBaseReg;
198
434
    AM.Scale = Scale;
199
434
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
200
434
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
193
61.5k
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
194
61.5k
    TargetLoweringBase::AddrMode AM;
195
61.5k
    AM.BaseGV = BaseGV;
196
61.5k
    AM.BaseOffs = BaseOffset;
197
61.5k
    AM.HasBaseReg = HasBaseReg;
198
61.5k
    AM.Scale = Scale;
199
61.5k
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
200
61.5k
  }
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
193
4
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
194
4
    TargetLoweringBase::AddrMode AM;
195
4
    AM.BaseGV = BaseGV;
196
4
    AM.BaseOffs = BaseOffset;
197
4
    AM.HasBaseReg = HasBaseReg;
198
4
    AM.Scale = Scale;
199
4
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
200
4
  }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
193
14
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
194
14
    TargetLoweringBase::AddrMode AM;
195
14
    AM.BaseGV = BaseGV;
196
14
    AM.BaseOffs = BaseOffset;
197
14
    AM.HasBaseReg = HasBaseReg;
198
14
    AM.Scale = Scale;
199
14
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
200
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
193
6.44k
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
194
6.44k
    TargetLoweringBase::AddrMode AM;
195
6.44k
    AM.BaseGV = BaseGV;
196
6.44k
    AM.BaseOffs = BaseOffset;
197
6.44k
    AM.HasBaseReg = HasBaseReg;
198
6.44k
    AM.Scale = Scale;
199
6.44k
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
200
6.44k
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
193
662
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
194
662
    TargetLoweringBase::AddrMode AM;
195
662
    AM.BaseGV = BaseGV;
196
662
    AM.BaseOffs = BaseOffset;
197
662
    AM.HasBaseReg = HasBaseReg;
198
662
    AM.Scale = Scale;
199
662
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
200
662
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
193
698k
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
194
698k
    TargetLoweringBase::AddrMode AM;
195
698k
    AM.BaseGV = BaseGV;
196
698k
    AM.BaseOffs = BaseOffset;
197
698k
    AM.HasBaseReg = HasBaseReg;
198
698k
    AM.Scale = Scale;
199
698k
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
200
698k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
201
202
1.38M
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
1.38M
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
1.38M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
202
1.35M
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
1.35M
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
1.35M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
202
26
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
26
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
26
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
202
425
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
425
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
425
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
202
3.78k
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
3.78k
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
3.78k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
202
471
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
471
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
471
  }
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
202
8
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
8
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
8
  }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
202
65
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
65
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
65
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
202
97
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
97
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
97
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
202
1.62k
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
1.62k
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
1.62k
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
202
209
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
209
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
209
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
202
21.9k
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
21.9k
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
21.9k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
205
206
121k
  bool isProfitableToHoist(Instruction *I) {
207
121k
    return getTLI()->isProfitableToHoist(I);
208
121k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isProfitableToHoist(llvm::Instruction*)
Line
Count
Source
206
76.6k
  bool isProfitableToHoist(Instruction *I) {
207
76.6k
    return getTLI()->isProfitableToHoist(I);
208
76.6k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isProfitableToHoist(llvm::Instruction*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isProfitableToHoist(llvm::Instruction*)
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isProfitableToHoist(llvm::Instruction*)
Line
Count
Source
206
8.69k
  bool isProfitableToHoist(Instruction *I) {
207
8.69k
    return getTLI()->isProfitableToHoist(I);
208
8.69k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isProfitableToHoist(llvm::Instruction*)
Line
Count
Source
206
16
  bool isProfitableToHoist(Instruction *I) {
207
16
    return getTLI()->isProfitableToHoist(I);
208
16
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::isProfitableToHoist(llvm::Instruction*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::isProfitableToHoist(llvm::Instruction*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isProfitableToHoist(llvm::Instruction*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isProfitableToHoist(llvm::Instruction*)
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isProfitableToHoist(llvm::Instruction*)
Line
Count
Source
206
32
  bool isProfitableToHoist(Instruction *I) {
207
32
    return getTLI()->isProfitableToHoist(I);
208
32
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isProfitableToHoist(llvm::Instruction*)
Line
Count
Source
206
35.8k
  bool isProfitableToHoist(Instruction *I) {
207
35.8k
    return getTLI()->isProfitableToHoist(I);
208
35.8k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isProfitableToHoist(llvm::Instruction*)
209
210
552
  bool useAA() const { return getST()->useAA(); }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::useAA() const
Line
Count
Source
210
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
210
517
  bool useAA() const { return getST()->useAA(); }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::useAA() const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::useAA() const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::useAA() const
211
212
17.8k
  bool isTypeLegal(Type *Ty) {
213
17.8k
    EVT VT = getTLI()->getValueType(DL, Ty);
214
17.8k
    return getTLI()->isTypeLegal(VT);
215
17.8k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isTypeLegal(llvm::Type*)
Line
Count
Source
212
17.0k
  bool isTypeLegal(Type *Ty) {
213
17.0k
    EVT VT = getTLI()->getValueType(DL, Ty);
214
17.0k
    return getTLI()->isTypeLegal(VT);
215
17.0k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isTypeLegal(llvm::Type*)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isTypeLegal(llvm::Type*)
Line
Count
Source
212
2
  bool isTypeLegal(Type *Ty) {
213
2
    EVT VT = getTLI()->getValueType(DL, Ty);
214
2
    return getTLI()->isTypeLegal(VT);
215
2
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isTypeLegal(llvm::Type*)
Line
Count
Source
212
158
  bool isTypeLegal(Type *Ty) {
213
158
    EVT VT = getTLI()->getValueType(DL, Ty);
214
158
    return getTLI()->isTypeLegal(VT);
215
158
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isTypeLegal(llvm::Type*)
Line
Count
Source
212
3
  bool isTypeLegal(Type *Ty) {
213
3
    EVT VT = getTLI()->getValueType(DL, Ty);
214
3
    return getTLI()->isTypeLegal(VT);
215
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
212
7
  bool isTypeLegal(Type *Ty) {
213
7
    EVT VT = getTLI()->getValueType(DL, Ty);
214
7
    return getTLI()->isTypeLegal(VT);
215
7
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isTypeLegal(llvm::Type*)
Line
Count
Source
212
5
  bool isTypeLegal(Type *Ty) {
213
5
    EVT VT = getTLI()->getValueType(DL, Ty);
214
5
    return getTLI()->isTypeLegal(VT);
215
5
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isTypeLegal(llvm::Type*)
Line
Count
Source
212
646
  bool isTypeLegal(Type *Ty) {
213
646
    EVT VT = getTLI()->getValueType(DL, Ty);
214
646
    return getTLI()->isTypeLegal(VT);
215
646
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isTypeLegal(llvm::Type*)
216
217
  int getGEPCost(Type *PointeeType, const Value *Ptr,
218
6.13M
                 ArrayRef<const Value *> Operands) {
219
6.13M
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
6.13M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
218
5.55M
                 ArrayRef<const Value *> Operands) {
219
5.55M
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
5.55M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
218
1.83k
                 ArrayRef<const Value *> Operands) {
219
1.83k
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
1.83k
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
218
32.5k
                 ArrayRef<const Value *> Operands) {
219
32.5k
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
32.5k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
218
98.6k
                 ArrayRef<const Value *> Operands) {
219
98.6k
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
98.6k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
218
27
                 ArrayRef<const Value *> Operands) {
219
27
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
27
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
218
329
                 ArrayRef<const Value *> Operands) {
219
329
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
329
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
218
855
                 ArrayRef<const Value *> Operands) {
219
855
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
855
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
218
75
                 ArrayRef<const Value *> Operands) {
219
75
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
75
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
218
452k
                 ArrayRef<const Value *> Operands) {
219
452k
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
452k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
221
222
1.70M
  int getExtCost(const Instruction *I, const Value *Src) {
223
1.70M
    if (getTLI()->isExtFree(I))
224
666k
      return TargetTransformInfo::TCC_Free;
225
1.03M
226
1.03M
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)676k
)
227
965k
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
228
658k
        if (getTLI()->isExtLoad(LI, I, DL))
229
649k
          return TargetTransformInfo::TCC_Free;
230
388k
231
388k
    return TargetTransformInfo::TCC_Basic;
232
388k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
222
1.44M
  int getExtCost(const Instruction *I, const Value *Src) {
223
1.44M
    if (getTLI()->isExtFree(I))
224
634k
      return TargetTransformInfo::TCC_Free;
225
810k
226
810k
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)544k
)
227
737k
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
228
505k
        if (getTLI()->isExtLoad(LI, I, DL))
229
497k
          return TargetTransformInfo::TCC_Free;
230
313k
231
313k
    return TargetTransformInfo::TCC_Basic;
232
313k
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
222
1
  int getExtCost(const Instruction *I, const Value *Src) {
223
1
    if (getTLI()->isExtFree(I))
224
0
      return TargetTransformInfo::TCC_Free;
225
1
226
1
    if (isa<ZExtInst>(I) || isa<SExtInst>(I))
227
1
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
228
0
        if (getTLI()->isExtLoad(LI, I, DL))
229
0
          return TargetTransformInfo::TCC_Free;
230
1
231
1
    return TargetTransformInfo::TCC_Basic;
232
1
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
222
167
  int getExtCost(const Instruction *I, const Value *Src) {
223
167
    if (getTLI()->isExtFree(I))
224
82
      return TargetTransformInfo::TCC_Free;
225
85
226
85
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)77
)
227
85
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
228
33
        if (getTLI()->isExtLoad(LI, I, DL))
229
29
          return TargetTransformInfo::TCC_Free;
230
56
231
56
    return TargetTransformInfo::TCC_Basic;
232
56
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
222
86.7k
  int getExtCost(const Instruction *I, const Value *Src) {
223
86.7k
    if (getTLI()->isExtFree(I))
224
0
      return TargetTransformInfo::TCC_Free;
225
86.7k
226
86.7k
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)43.2k
)
227
86.7k
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
228
57.2k
        if (getTLI()->isExtLoad(LI, I, DL))
229
56.8k
          return TargetTransformInfo::TCC_Free;
230
29.9k
231
29.9k
    return TargetTransformInfo::TCC_Basic;
232
29.9k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
222
12
  int getExtCost(const Instruction *I, const Value *Src) {
223
12
    if (getTLI()->isExtFree(I))
224
0
      return TargetTransformInfo::TCC_Free;
225
12
226
12
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)2
)
227
12
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
228
2
        if (getTLI()->isExtLoad(LI, I, DL))
229
2
          return TargetTransformInfo::TCC_Free;
230
10
231
10
    return TargetTransformInfo::TCC_Basic;
232
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
222
1
  int getExtCost(const Instruction *I, const Value *Src) {
223
1
    if (getTLI()->isExtFree(I))
224
0
      return TargetTransformInfo::TCC_Free;
225
1
226
1
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)0
)
227
1
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
228
0
        if (getTLI()->isExtLoad(LI, I, DL))
229
0
          return TargetTransformInfo::TCC_Free;
230
1
231
1
    return TargetTransformInfo::TCC_Basic;
232
1
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
222
222
  int getExtCost(const Instruction *I, const Value *Src) {
223
222
    if (getTLI()->isExtFree(I))
224
6
      return TargetTransformInfo::TCC_Free;
225
216
226
216
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)92
)
227
216
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
228
112
        if (getTLI()->isExtLoad(LI, I, DL))
229
107
          return TargetTransformInfo::TCC_Free;
230
109
231
109
    return TargetTransformInfo::TCC_Basic;
232
109
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
222
17
  int getExtCost(const Instruction *I, const Value *Src) {
223
17
    if (getTLI()->isExtFree(I))
224
0
      return TargetTransformInfo::TCC_Free;
225
17
226
17
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)4
)
227
17
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
228
9
        if (getTLI()->isExtLoad(LI, I, DL))
229
9
          return TargetTransformInfo::TCC_Free;
230
8
231
8
    return TargetTransformInfo::TCC_Basic;
232
8
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
222
171k
  int getExtCost(const Instruction *I, const Value *Src) {
223
171k
    if (getTLI()->isExtFree(I))
224
31.4k
      return TargetTransformInfo::TCC_Free;
225
140k
226
140k
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)88.8k
)
227
140k
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
228
95.7k
        if (getTLI()->isExtLoad(LI, I, DL))
229
95.4k
          return TargetTransformInfo::TCC_Free;
230
44.7k
231
44.7k
    return TargetTransformInfo::TCC_Basic;
232
44.7k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
233
234
  unsigned getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,
235
4
                            ArrayRef<const Value *> Arguments) {
236
4
    return BaseT::getIntrinsicCost(IID, RetTy, Arguments);
237
4
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
235
2
                            ArrayRef<const Value *> Arguments) {
236
2
    return BaseT::getIntrinsicCost(IID, RetTy, Arguments);
237
2
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
235
2
                            ArrayRef<const Value *> Arguments) {
236
2
    return BaseT::getIntrinsicCost(IID, RetTy, Arguments);
237
2
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
238
239
  unsigned getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,
240
1.28M
                            ArrayRef<Type *> ParamTys) {
241
1.28M
    if (IID == Intrinsic::cttz) {
242
9.99k
      if (getTLI()->isCheapToSpeculateCttz())
243
4.74k
        return TargetTransformInfo::TCC_Basic;
244
5.25k
      return TargetTransformInfo::TCC_Expensive;
245
5.25k
    }
246
1.27M
247
1.27M
    if (IID == Intrinsic::ctlz) {
248
15.2k
      if (getTLI()->isCheapToSpeculateCtlz())
249
8.78k
        return TargetTransformInfo::TCC_Basic;
250
6.42k
      return TargetTransformInfo::TCC_Expensive;
251
6.42k
    }
252
1.26M
253
1.26M
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
254
1.26M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
240
1.00M
                            ArrayRef<Type *> ParamTys) {
241
1.00M
    if (IID == Intrinsic::cttz) {
242
858
      if (getTLI()->isCheapToSpeculateCttz())
243
858
        return TargetTransformInfo::TCC_Basic;
244
0
      return TargetTransformInfo::TCC_Expensive;
245
0
    }
246
1.00M
247
1.00M
    if (IID == Intrinsic::ctlz) {
248
1.77k
      if (getTLI()->isCheapToSpeculateCtlz())
249
1.77k
        return TargetTransformInfo::TCC_Basic;
250
0
      return TargetTransformInfo::TCC_Expensive;
251
0
    }
252
999k
253
999k
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
254
999k
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
240
2
                            ArrayRef<Type *> ParamTys) {
241
2
    if (IID == Intrinsic::cttz) {
242
0
      if (getTLI()->isCheapToSpeculateCttz())
243
0
        return TargetTransformInfo::TCC_Basic;
244
0
      return TargetTransformInfo::TCC_Expensive;
245
0
    }
246
2
247
2
    if (IID == Intrinsic::ctlz) {
248
0
      if (getTLI()->isCheapToSpeculateCtlz())
249
0
        return TargetTransformInfo::TCC_Basic;
250
0
      return TargetTransformInfo::TCC_Expensive;
251
0
    }
252
2
253
2
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
254
2
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
240
805
                            ArrayRef<Type *> ParamTys) {
241
805
    if (IID == Intrinsic::cttz) {
242
12
      if (getTLI()->isCheapToSpeculateCttz())
243
12
        return TargetTransformInfo::TCC_Basic;
244
0
      return TargetTransformInfo::TCC_Expensive;
245
0
    }
246
793
247
793
    if (IID == Intrinsic::ctlz) {
248
12
      if (getTLI()->isCheapToSpeculateCtlz())
249
12
        return TargetTransformInfo::TCC_Basic;
250
0
      return TargetTransformInfo::TCC_Expensive;
251
0
    }
252
781
253
781
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
254
781
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
240
78.4k
                            ArrayRef<Type *> ParamTys) {
241
78.4k
    if (IID == Intrinsic::cttz) {
242
2.59k
      if (getTLI()->isCheapToSpeculateCttz())
243
2.53k
        return TargetTransformInfo::TCC_Basic;
244
60
      return TargetTransformInfo::TCC_Expensive;
245
60
    }
246
75.8k
247
75.8k
    if (IID == Intrinsic::ctlz) {
248
6.22k
      if (getTLI()->isCheapToSpeculateCtlz())
249
5.69k
        return TargetTransformInfo::TCC_Basic;
250
525
      return TargetTransformInfo::TCC_Expensive;
251
525
    }
252
69.6k
253
69.6k
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
254
69.6k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
240
14
                            ArrayRef<Type *> ParamTys) {
241
14
    if (IID == Intrinsic::cttz) {
242
0
      if (getTLI()->isCheapToSpeculateCttz())
243
0
        return TargetTransformInfo::TCC_Basic;
244
0
      return TargetTransformInfo::TCC_Expensive;
245
0
    }
246
14
247
14
    if (IID == Intrinsic::ctlz) {
248
0
      if (getTLI()->isCheapToSpeculateCtlz())
249
0
        return TargetTransformInfo::TCC_Basic;
250
0
      return TargetTransformInfo::TCC_Expensive;
251
0
    }
252
14
253
14
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
254
14
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
240
5
                            ArrayRef<Type *> ParamTys) {
241
5
    if (IID == Intrinsic::cttz) {
242
1
      if (getTLI()->isCheapToSpeculateCttz())
243
1
        return TargetTransformInfo::TCC_Basic;
244
0
      return TargetTransformInfo::TCC_Expensive;
245
0
    }
246
4
247
4
    if (IID == Intrinsic::ctlz) {
248
1
      if (getTLI()->isCheapToSpeculateCtlz())
249
1
        return TargetTransformInfo::TCC_Basic;
250
0
      return TargetTransformInfo::TCC_Expensive;
251
0
    }
252
3
253
3
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
254
3
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
240
16
                            ArrayRef<Type *> ParamTys) {
241
16
    if (IID == Intrinsic::cttz) {
242
0
      if (getTLI()->isCheapToSpeculateCttz())
243
0
        return TargetTransformInfo::TCC_Basic;
244
0
      return TargetTransformInfo::TCC_Expensive;
245
0
    }
246
16
247
16
    if (IID == Intrinsic::ctlz) {
248
0
      if (getTLI()->isCheapToSpeculateCtlz())
249
0
        return TargetTransformInfo::TCC_Basic;
250
0
      return TargetTransformInfo::TCC_Expensive;
251
0
    }
252
16
253
16
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
254
16
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
240
59
                            ArrayRef<Type *> ParamTys) {
241
59
    if (IID == Intrinsic::cttz) {
242
1
      if (getTLI()->isCheapToSpeculateCttz())
243
1
        return TargetTransformInfo::TCC_Basic;
244
0
      return TargetTransformInfo::TCC_Expensive;
245
0
    }
246
58
247
58
    if (IID == Intrinsic::ctlz) {
248
1
      if (getTLI()->isCheapToSpeculateCtlz())
249
1
        return TargetTransformInfo::TCC_Basic;
250
0
      return TargetTransformInfo::TCC_Expensive;
251
0
    }
252
57
253
57
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
254
57
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
240
20
                            ArrayRef<Type *> ParamTys) {
241
20
    if (IID == Intrinsic::cttz) {
242
0
      if (getTLI()->isCheapToSpeculateCttz())
243
0
        return TargetTransformInfo::TCC_Basic;
244
0
      return TargetTransformInfo::TCC_Expensive;
245
0
    }
246
20
247
20
    if (IID == Intrinsic::ctlz) {
248
0
      if (getTLI()->isCheapToSpeculateCtlz())
249
0
        return TargetTransformInfo::TCC_Basic;
250
0
      return TargetTransformInfo::TCC_Expensive;
251
0
    }
252
20
253
20
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
254
20
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
240
204k
                            ArrayRef<Type *> ParamTys) {
241
204k
    if (IID == Intrinsic::cttz) {
242
6.53k
      if (getTLI()->isCheapToSpeculateCttz())
243
1.33k
        return TargetTransformInfo::TCC_Basic;
244
5.19k
      return TargetTransformInfo::TCC_Expensive;
245
5.19k
    }
246
198k
247
198k
    if (IID == Intrinsic::ctlz) {
248
7.19k
      if (getTLI()->isCheapToSpeculateCtlz())
249
1.29k
        return TargetTransformInfo::TCC_Basic;
250
5.90k
      return TargetTransformInfo::TCC_Expensive;
251
5.90k
    }
252
190k
253
190k
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
254
190k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
255
256
  unsigned getEstimatedNumberOfCaseClusters(const SwitchInst &SI,
257
40.1k
                                            unsigned &JumpTableSize) {
258
40.1k
    /// Try to find the estimated number of clusters. Note that the number of
259
40.1k
    /// clusters identified in this function could be different from the actural
260
40.1k
    /// numbers found in lowering. This function ignore switches that are
261
40.1k
    /// lowered with a mix of jump table / bit test / BTree. This function was
262
40.1k
    /// initially intended to be used when estimating the cost of switch in
263
40.1k
    /// inline cost heuristic, but it's a generic cost model to be used in other
264
40.1k
    /// places (e.g., in loop unrolling).
265
40.1k
    unsigned N = SI.getNumCases();
266
40.1k
    const TargetLoweringBase *TLI = getTLI();
267
40.1k
    const DataLayout &DL = this->getDataLayout();
268
40.1k
269
40.1k
    JumpTableSize = 0;
270
40.1k
    bool IsJTAllowed = TLI->areJTsAllowed(SI.getParent()->getParent());
271
40.1k
272
40.1k
    // Early exit if both a jump table and bit test are not allowed.
273
40.1k
    if (N < 1 || (!IsJTAllowed && 
DL.getIndexSizeInBits(0u) < N0
))
274
0
      return N;
275
40.1k
276
40.1k
    APInt MaxCaseVal = SI.case_begin()->getCaseValue()->getValue();
277
40.1k
    APInt MinCaseVal = MaxCaseVal;
278
386k
    for (auto CI : SI.cases()) {
279
386k
      const APInt &CaseVal = CI.getCaseValue()->getValue();
280
386k
      if (CaseVal.sgt(MaxCaseVal))
281
69.8k
        MaxCaseVal = CaseVal;
282
386k
      if (CaseVal.slt(MinCaseVal))
283
41.7k
        MinCaseVal = CaseVal;
284
386k
    }
285
40.1k
286
40.1k
    // Check if suitable for a bit test
287
40.1k
    if (N <= DL.getIndexSizeInBits(0u)) {
288
39.3k
      SmallPtrSet<const BasicBlock *, 4> Dests;
289
39.3k
      for (auto I : SI.cases())
290
245k
        Dests.insert(I.getCaseSuccessor());
291
39.3k
292
39.3k
      if (TLI->isSuitableForBitTests(Dests.size(), N, MinCaseVal, MaxCaseVal,
293
39.3k
                                     DL))
294
5.24k
        return 1;
295
34.9k
    }
296
34.9k
297
34.9k
    // Check if suitable for a jump table.
298
34.9k
    if (IsJTAllowed) {
299
34.9k
      if (N < 2 || N < TLI->getMinimumJumpTableEntries())
300
21.9k
        return N;
301
13.0k
      uint64_t Range =
302
13.0k
          (MaxCaseVal - MinCaseVal)
303
13.0k
              .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1;
304
13.0k
      // Check whether a range of clusters is dense enough for a jump table
305
13.0k
      if (TLI->isSuitableForJumpTable(&SI, N, Range)) {
306
10.7k
        JumpTableSize = Range;
307
10.7k
        return 1;
308
10.7k
      }
309
2.22k
    }
310
2.22k
    return N;
311
2.22k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Line
Count
Source
257
29.1k
                                            unsigned &JumpTableSize) {
258
29.1k
    /// Try to find the estimated number of clusters. Note that the number of
259
29.1k
    /// clusters identified in this function could be different from the actural
260
29.1k
    /// numbers found in lowering. This function ignore switches that are
261
29.1k
    /// lowered with a mix of jump table / bit test / BTree. This function was
262
29.1k
    /// initially intended to be used when estimating the cost of switch in
263
29.1k
    /// inline cost heuristic, but it's a generic cost model to be used in other
264
29.1k
    /// places (e.g., in loop unrolling).
265
29.1k
    unsigned N = SI.getNumCases();
266
29.1k
    const TargetLoweringBase *TLI = getTLI();
267
29.1k
    const DataLayout &DL = this->getDataLayout();
268
29.1k
269
29.1k
    JumpTableSize = 0;
270
29.1k
    bool IsJTAllowed = TLI->areJTsAllowed(SI.getParent()->getParent());
271
29.1k
272
29.1k
    // Early exit if both a jump table and bit test are not allowed.
273
29.1k
    if (N < 1 || (!IsJTAllowed && 
DL.getIndexSizeInBits(0u) < N0
))
274
0
      return N;
275
29.1k
276
29.1k
    APInt MaxCaseVal = SI.case_begin()->getCaseValue()->getValue();
277
29.1k
    APInt MinCaseVal = MaxCaseVal;
278
341k
    for (auto CI : SI.cases()) {
279
341k
      const APInt &CaseVal = CI.getCaseValue()->getValue();
280
341k
      if (CaseVal.sgt(MaxCaseVal))
281
50.9k
        MaxCaseVal = CaseVal;
282
341k
      if (CaseVal.slt(MinCaseVal))
283
32.8k
        MinCaseVal = CaseVal;
284
341k
    }
285
29.1k
286
29.1k
    // Check if suitable for a bit test
287
29.1k
    if (N <= DL.getIndexSizeInBits(0u)) {
288
28.4k
      SmallPtrSet<const BasicBlock *, 4> Dests;
289
28.4k
      for (auto I : SI.cases())
290
200k
        Dests.insert(I.getCaseSuccessor());
291
28.4k
292
28.4k
      if (TLI->isSuitableForBitTests(Dests.size(), N, MinCaseVal, MaxCaseVal,
293
28.4k
                                     DL))
294
2.68k
        return 1;
295
26.5k
    }
296
26.5k
297
26.5k
    // Check if suitable for a jump table.
298
26.5k
    if (IsJTAllowed) {
299
26.5k
      if (N < 2 || N < TLI->getMinimumJumpTableEntries())
300
16.6k
        return N;
301
9.91k
      uint64_t Range =
302
9.91k
          (MaxCaseVal - MinCaseVal)
303
9.91k
              .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1;
304
9.91k
      // Check whether a range of clusters is dense enough for a jump table
305
9.91k
      if (TLI->isSuitableForJumpTable(&SI, N, Range)) {
306
8.18k
        JumpTableSize = Range;
307
8.18k
        return 1;
308
8.18k
      }
309
1.72k
    }
310
1.72k
    return N;
311
1.72k
  }
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
257
2.11k
                                            unsigned &JumpTableSize) {
258
2.11k
    /// Try to find the estimated number of clusters. Note that the number of
259
2.11k
    /// clusters identified in this function could be different from the actural
260
2.11k
    /// numbers found in lowering. This function ignore switches that are
261
2.11k
    /// lowered with a mix of jump table / bit test / BTree. This function was
262
2.11k
    /// initially intended to be used when estimating the cost of switch in
263
2.11k
    /// inline cost heuristic, but it's a generic cost model to be used in other
264
2.11k
    /// places (e.g., in loop unrolling).
265
2.11k
    unsigned N = SI.getNumCases();
266
2.11k
    const TargetLoweringBase *TLI = getTLI();
267
2.11k
    const DataLayout &DL = this->getDataLayout();
268
2.11k
269
2.11k
    JumpTableSize = 0;
270
2.11k
    bool IsJTAllowed = TLI->areJTsAllowed(SI.getParent()->getParent());
271
2.11k
272
2.11k
    // Early exit if both a jump table and bit test are not allowed.
273
2.11k
    if (N < 1 || (!IsJTAllowed && 
DL.getIndexSizeInBits(0u) < N0
))
274
0
      return N;
275
2.11k
276
2.11k
    APInt MaxCaseVal = SI.case_begin()->getCaseValue()->getValue();
277
2.11k
    APInt MinCaseVal = MaxCaseVal;
278
9.01k
    for (auto CI : SI.cases()) {
279
9.01k
      const APInt &CaseVal = CI.getCaseValue()->getValue();
280
9.01k
      if (CaseVal.sgt(MaxCaseVal))
281
3.47k
        MaxCaseVal = CaseVal;
282
9.01k
      if (CaseVal.slt(MinCaseVal))
283
1.74k
        MinCaseVal = CaseVal;
284
9.01k
    }
285
2.11k
286
2.11k
    // Check if suitable for a bit test
287
2.11k
    if (N <= DL.getIndexSizeInBits(0u)) {
288
2.11k
      SmallPtrSet<const BasicBlock *, 4> Dests;
289
2.11k
      for (auto I : SI.cases())
290
9.01k
        Dests.insert(I.getCaseSuccessor());
291
2.11k
292
2.11k
      if (TLI->isSuitableForBitTests(Dests.size(), N, MinCaseVal, MaxCaseVal,
293
2.11k
                                     DL))
294
138
        return 1;
295
1.97k
    }
296
1.97k
297
1.97k
    // Check if suitable for a jump table.
298
1.97k
    if (IsJTAllowed) {
299
1.97k
      if (N < 2 || N < TLI->getMinimumJumpTableEntries())
300
1.18k
        return N;
301
792
      uint64_t Range =
302
792
          (MaxCaseVal - MinCaseVal)
303
792
              .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1;
304
792
      // Check whether a range of clusters is dense enough for a jump table
305
792
      if (TLI->isSuitableForJumpTable(&SI, N, Range)) {
306
657
        JumpTableSize = Range;
307
657
        return 1;
308
657
      }
309
135
    }
310
135
    return N;
311
135
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
Line
Count
Source
257
8.85k
                                            unsigned &JumpTableSize) {
258
8.85k
    /// Try to find the estimated number of clusters. Note that the number of
259
8.85k
    /// clusters identified in this function could be different from the actural
260
8.85k
    /// numbers found in lowering. This function ignore switches that are
261
8.85k
    /// lowered with a mix of jump table / bit test / BTree. This function was
262
8.85k
    /// initially intended to be used when estimating the cost of switch in
263
8.85k
    /// inline cost heuristic, but it's a generic cost model to be used in other
264
8.85k
    /// places (e.g., in loop unrolling).
265
8.85k
    unsigned N = SI.getNumCases();
266
8.85k
    const TargetLoweringBase *TLI = getTLI();
267
8.85k
    const DataLayout &DL = this->getDataLayout();
268
8.85k
269
8.85k
    JumpTableSize = 0;
270
8.85k
    bool IsJTAllowed = TLI->areJTsAllowed(SI.getParent()->getParent());
271
8.85k
272
8.85k
    // Early exit if both a jump table and bit test are not allowed.
273
8.85k
    if (N < 1 || (!IsJTAllowed && 
DL.getIndexSizeInBits(0u) < N0
))
274
0
      return N;
275
8.85k
276
8.85k
    APInt MaxCaseVal = SI.case_begin()->getCaseValue()->getValue();
277
8.85k
    APInt MinCaseVal = MaxCaseVal;
278
36.1k
    for (auto CI : SI.cases()) {
279
36.1k
      const APInt &CaseVal = CI.getCaseValue()->getValue();
280
36.1k
      if (CaseVal.sgt(MaxCaseVal))
281
15.3k
        MaxCaseVal = CaseVal;
282
36.1k
      if (CaseVal.slt(MinCaseVal))
283
7.17k
        MinCaseVal = CaseVal;
284
36.1k
    }
285
8.85k
286
8.85k
    // Check if suitable for a bit test
287
8.85k
    if (N <= DL.getIndexSizeInBits(0u)) {
288
8.85k
      SmallPtrSet<const BasicBlock *, 4> Dests;
289
8.85k
      for (auto I : SI.cases())
290
36.0k
        Dests.insert(I.getCaseSuccessor());
291
8.85k
292
8.85k
      if (TLI->isSuitableForBitTests(Dests.size(), N, MinCaseVal, MaxCaseVal,
293
8.85k
                                     DL))
294
2.42k
        return 1;
295
6.43k
    }
296
6.43k
297
6.43k
    // Check if suitable for a jump table.
298
6.43k
    if (IsJTAllowed) {
299
6.43k
      if (N < 2 || N < TLI->getMinimumJumpTableEntries())
300
4.13k
        return N;
301
2.29k
      uint64_t Range =
302
2.29k
          (MaxCaseVal - MinCaseVal)
303
2.29k
              .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1;
304
2.29k
      // Check whether a range of clusters is dense enough for a jump table
305
2.29k
      if (TLI->isSuitableForJumpTable(&SI, N, Range)) {
306
1.92k
        JumpTableSize = Range;
307
1.92k
        return 1;
308
1.92k
      }
309
369
    }
310
369
    return N;
311
369
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getEstimatedNumberOfCaseClusters(llvm::SwitchInst const&, unsigned int&)
312
313
0
  unsigned getJumpBufAlignment() { return getTLI()->getJumpBufAlignment(); }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getJumpBufAlignment()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getJumpBufAlignment()
314
315
0
  unsigned getJumpBufSize() { return getTLI()->getJumpBufSize(); }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getJumpBufSize()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getJumpBufSize()
316
317
61.9k
  bool shouldBuildLookupTables() {
318
61.9k
    const TargetLoweringBase *TLI = getTLI();
319
61.9k
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
320
61.9k
           
TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other)60.8k
;
321
61.9k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::shouldBuildLookupTables()
Line
Count
Source
317
57.7k
  bool shouldBuildLookupTables() {
318
57.7k
    const TargetLoweringBase *TLI = getTLI();
319
57.7k
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
320
57.7k
           TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other);
321
57.7k
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::shouldBuildLookupTables()
Line
Count
Source
317
6
  bool shouldBuildLookupTables() {
318
6
    const TargetLoweringBase *TLI = getTLI();
319
6
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
320
6
           TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other);
321
6
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::shouldBuildLookupTables()
Line
Count
Source
317
6
  bool shouldBuildLookupTables() {
318
6
    const TargetLoweringBase *TLI = getTLI();
319
6
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
320
6
           TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other);
321
6
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::shouldBuildLookupTables()
Line
Count
Source
317
1.10k
  bool shouldBuildLookupTables() {
318
1.10k
    const TargetLoweringBase *TLI = getTLI();
319
1.10k
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
320
1.10k
           
TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other)0
;
321
1.10k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::shouldBuildLookupTables()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::shouldBuildLookupTables()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::shouldBuildLookupTables()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::shouldBuildLookupTables()
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::shouldBuildLookupTables()
Line
Count
Source
317
3.00k
  bool shouldBuildLookupTables() {
318
3.00k
    const TargetLoweringBase *TLI = getTLI();
319
3.00k
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
320
3.00k
           TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other);
321
3.00k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::shouldBuildLookupTables()
322
323
54
  bool haveFastSqrt(Type *Ty) {
324
54
    const TargetLoweringBase *TLI = getTLI();
325
54
    EVT VT = TLI->getValueType(DL, Ty);
326
54
    return TLI->isTypeLegal(VT) &&
327
54
           
TLI->isOperationLegalOrCustom(ISD::FSQRT, VT)52
;
328
54
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::haveFastSqrt(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::haveFastSqrt(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::haveFastSqrt(llvm::Type*)
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::haveFastSqrt(llvm::Type*)
Line
Count
Source
323
2
  bool haveFastSqrt(Type *Ty) {
324
2
    const TargetLoweringBase *TLI = getTLI();
325
2
    EVT VT = TLI->getValueType(DL, Ty);
326
2
    return TLI->isTypeLegal(VT) &&
327
2
           
TLI->isOperationLegalOrCustom(ISD::FSQRT, VT)0
;
328
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
323
14
  bool haveFastSqrt(Type *Ty) {
324
14
    const TargetLoweringBase *TLI = getTLI();
325
14
    EVT VT = TLI->getValueType(DL, Ty);
326
14
    return TLI->isTypeLegal(VT) &&
327
14
           TLI->isOperationLegalOrCustom(ISD::FSQRT, VT);
328
14
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::haveFastSqrt(llvm::Type*)
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::haveFastSqrt(llvm::Type*)
Line
Count
Source
323
4
  bool haveFastSqrt(Type *Ty) {
324
4
    const TargetLoweringBase *TLI = getTLI();
325
4
    EVT VT = TLI->getValueType(DL, Ty);
326
4
    return TLI->isTypeLegal(VT) &&
327
4
           TLI->isOperationLegalOrCustom(ISD::FSQRT, VT);
328
4
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::haveFastSqrt(llvm::Type*)
Line
Count
Source
323
4
  bool haveFastSqrt(Type *Ty) {
324
4
    const TargetLoweringBase *TLI = getTLI();
325
4
    EVT VT = TLI->getValueType(DL, Ty);
326
4
    return TLI->isTypeLegal(VT) &&
327
4
           TLI->isOperationLegalOrCustom(ISD::FSQRT, VT);
328
4
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::haveFastSqrt(llvm::Type*)
Line
Count
Source
323
30
  bool haveFastSqrt(Type *Ty) {
324
30
    const TargetLoweringBase *TLI = getTLI();
325
30
    EVT VT = TLI->getValueType(DL, Ty);
326
30
    return TLI->isTypeLegal(VT) &&
327
30
           TLI->isOperationLegalOrCustom(ISD::FSQRT, VT);
328
30
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::haveFastSqrt(llvm::Type*)
329
330
22
  bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) {
331
22
    return true;
332
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
330
14
  bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) {
331
14
    return true;
332
14
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::isFCmpOrdCheaperThanFCmpZero(llvm::Type*)
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isFCmpOrdCheaperThanFCmpZero(llvm::Type*)
Line
Count
Source
330
4
  bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) {
331
4
    return true;
332
4
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isFCmpOrdCheaperThanFCmpZero(llvm::Type*)
Line
Count
Source
330
4
  bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) {
331
4
    return true;
332
4
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isFCmpOrdCheaperThanFCmpZero(llvm::Type*)
333
334
546k
  unsigned getFPOpCost(Type *Ty) {
335
546k
    // Check whether FADD is available, as a proxy for floating-point in
336
546k
    // general.
337
546k
    const TargetLoweringBase *TLI = getTLI();
338
546k
    EVT VT = TLI->getValueType(DL, Ty);
339
546k
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
340
544k
      return TargetTransformInfo::TCC_Basic;
341
2.03k
    return TargetTransformInfo::TCC_Expensive;
342
2.03k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getFPOpCost(llvm::Type*)
Line
Count
Source
334
545k
  unsigned getFPOpCost(Type *Ty) {
335
545k
    // Check whether FADD is available, as a proxy for floating-point in
336
545k
    // general.
337
545k
    const TargetLoweringBase *TLI = getTLI();
338
545k
    EVT VT = TLI->getValueType(DL, Ty);
339
545k
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
340
543k
      return TargetTransformInfo::TCC_Basic;
341
1.97k
    return TargetTransformInfo::TCC_Expensive;
342
1.97k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getFPOpCost(llvm::Type*)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getFPOpCost(llvm::Type*)
Line
Count
Source
334
12
  unsigned getFPOpCost(Type *Ty) {
335
12
    // Check whether FADD is available, as a proxy for floating-point in
336
12
    // general.
337
12
    const TargetLoweringBase *TLI = getTLI();
338
12
    EVT VT = TLI->getValueType(DL, Ty);
339
12
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
340
12
      return TargetTransformInfo::TCC_Basic;
341
0
    return TargetTransformInfo::TCC_Expensive;
342
0
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getFPOpCost(llvm::Type*)
Line
Count
Source
334
90
  unsigned getFPOpCost(Type *Ty) {
335
90
    // Check whether FADD is available, as a proxy for floating-point in
336
90
    // general.
337
90
    const TargetLoweringBase *TLI = getTLI();
338
90
    EVT VT = TLI->getValueType(DL, Ty);
339
90
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
340
30
      return TargetTransformInfo::TCC_Basic;
341
60
    return TargetTransformInfo::TCC_Expensive;
342
60
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getFPOpCost(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getFPOpCost(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getFPOpCost(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getFPOpCost(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getFPOpCost(llvm::Type*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getFPOpCost(llvm::Type*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getFPOpCost(llvm::Type*)
Line
Count
Source
334
855
  unsigned getFPOpCost(Type *Ty) {
335
855
    // Check whether FADD is available, as a proxy for floating-point in
336
855
    // general.
337
855
    const TargetLoweringBase *TLI = getTLI();
338
855
    EVT VT = TLI->getValueType(DL, Ty);
339
855
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
340
855
      return TargetTransformInfo::TCC_Basic;
341
0
    return TargetTransformInfo::TCC_Expensive;
342
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getFPOpCost(llvm::Type*)
343
344
26.2M
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
26.2M
    const TargetLoweringBase *TLI = getTLI();
346
26.2M
    switch (Opcode) {
347
26.2M
    
default: break25.4M
;
348
26.2M
    case Instruction::Trunc:
349
751k
      if (TLI->isTruncateFree(OpTy, Ty))
350
703k
        return TargetTransformInfo::TCC_Free;
351
47.1k
      return TargetTransformInfo::TCC_Basic;
352
47.1k
    case Instruction::ZExt:
353
0
      if (TLI->isZExtFree(OpTy, Ty))
354
0
        return TargetTransformInfo::TCC_Free;
355
0
      return TargetTransformInfo::TCC_Basic;
356
25.4M
    }
357
25.4M
358
25.4M
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
25.4M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
344
24.0M
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
24.0M
    const TargetLoweringBase *TLI = getTLI();
346
24.0M
    switch (Opcode) {
347
24.0M
    
default: break23.3M
;
348
24.0M
    case Instruction::Trunc:
349
662k
      if (TLI->isTruncateFree(OpTy, Ty))
350
619k
        return TargetTransformInfo::TCC_Free;
351
42.6k
      return TargetTransformInfo::TCC_Basic;
352
42.6k
    case Instruction::ZExt:
353
0
      if (TLI->isZExtFree(OpTy, Ty))
354
0
        return TargetTransformInfo::TCC_Free;
355
0
      return TargetTransformInfo::TCC_Basic;
356
23.3M
    }
357
23.3M
358
23.3M
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
23.3M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
344
314
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
314
    const TargetLoweringBase *TLI = getTLI();
346
314
    switch (Opcode) {
347
314
    default: break;
348
314
    case Instruction::Trunc:
349
0
      if (TLI->isTruncateFree(OpTy, Ty))
350
0
        return TargetTransformInfo::TCC_Free;
351
0
      return TargetTransformInfo::TCC_Basic;
352
0
    case Instruction::ZExt:
353
0
      if (TLI->isZExtFree(OpTy, Ty))
354
0
        return TargetTransformInfo::TCC_Free;
355
0
      return TargetTransformInfo::TCC_Basic;
356
314
    }
357
314
358
314
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
314
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
344
5.18k
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
5.18k
    const TargetLoweringBase *TLI = getTLI();
346
5.18k
    switch (Opcode) {
347
5.18k
    
default: break5.14k
;
348
5.18k
    case Instruction::Trunc:
349
39
      if (TLI->isTruncateFree(OpTy, Ty))
350
33
        return TargetTransformInfo::TCC_Free;
351
6
      return TargetTransformInfo::TCC_Basic;
352
6
    case Instruction::ZExt:
353
0
      if (TLI->isZExtFree(OpTy, Ty))
354
0
        return TargetTransformInfo::TCC_Free;
355
0
      return TargetTransformInfo::TCC_Basic;
356
5.14k
    }
357
5.14k
358
5.14k
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
5.14k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
344
522k
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
522k
    const TargetLoweringBase *TLI = getTLI();
346
522k
    switch (Opcode) {
347
522k
    
default: break509k
;
348
522k
    case Instruction::Trunc:
349
13.1k
      if (TLI->isTruncateFree(OpTy, Ty))
350
8.83k
        return TargetTransformInfo::TCC_Free;
351
4.35k
      return TargetTransformInfo::TCC_Basic;
352
4.35k
    case Instruction::ZExt:
353
0
      if (TLI->isZExtFree(OpTy, Ty))
354
0
        return TargetTransformInfo::TCC_Free;
355
0
      return TargetTransformInfo::TCC_Basic;
356
509k
    }
357
509k
358
509k
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
509k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
344
197
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
197
    const TargetLoweringBase *TLI = getTLI();
346
197
    switch (Opcode) {
347
197
    
default: break185
;
348
197
    case Instruction::Trunc:
349
12
      if (TLI->isTruncateFree(OpTy, Ty))
350
1
        return TargetTransformInfo::TCC_Free;
351
11
      return TargetTransformInfo::TCC_Basic;
352
11
    case Instruction::ZExt:
353
0
      if (TLI->isZExtFree(OpTy, Ty))
354
0
        return TargetTransformInfo::TCC_Free;
355
0
      return TargetTransformInfo::TCC_Basic;
356
185
    }
357
185
358
185
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
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
344
102
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
102
    const TargetLoweringBase *TLI = getTLI();
346
102
    switch (Opcode) {
347
102
    default: break;
348
102
    case Instruction::Trunc:
349
0
      if (TLI->isTruncateFree(OpTy, Ty))
350
0
        return TargetTransformInfo::TCC_Free;
351
0
      return TargetTransformInfo::TCC_Basic;
352
0
    case Instruction::ZExt:
353
0
      if (TLI->isZExtFree(OpTy, Ty))
354
0
        return TargetTransformInfo::TCC_Free;
355
0
      return TargetTransformInfo::TCC_Basic;
356
102
    }
357
102
358
102
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
102
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
344
5.06k
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
5.06k
    const TargetLoweringBase *TLI = getTLI();
346
5.06k
    switch (Opcode) {
347
5.06k
    
default: break4.91k
;
348
5.06k
    case Instruction::Trunc:
349
153
      if (TLI->isTruncateFree(OpTy, Ty))
350
101
        return TargetTransformInfo::TCC_Free;
351
52
      return TargetTransformInfo::TCC_Basic;
352
52
    case Instruction::ZExt:
353
0
      if (TLI->isZExtFree(OpTy, Ty))
354
0
        return TargetTransformInfo::TCC_Free;
355
0
      return TargetTransformInfo::TCC_Basic;
356
4.91k
    }
357
4.91k
358
4.91k
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
4.91k
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
344
1.05k
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
1.05k
    const TargetLoweringBase *TLI = getTLI();
346
1.05k
    switch (Opcode) {
347
1.05k
    
default: break1.03k
;
348
1.05k
    case Instruction::Trunc:
349
18
      if (TLI->isTruncateFree(OpTy, Ty))
350
15
        return TargetTransformInfo::TCC_Free;
351
3
      return TargetTransformInfo::TCC_Basic;
352
3
    case Instruction::ZExt:
353
0
      if (TLI->isZExtFree(OpTy, Ty))
354
0
        return TargetTransformInfo::TCC_Free;
355
0
      return TargetTransformInfo::TCC_Basic;
356
1.03k
    }
357
1.03k
358
1.03k
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
1.03k
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
344
1.70M
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
1.70M
    const TargetLoweringBase *TLI = getTLI();
346
1.70M
    switch (Opcode) {
347
1.70M
    
default: break1.62M
;
348
1.70M
    case Instruction::Trunc:
349
75.5k
      if (TLI->isTruncateFree(OpTy, Ty))
350
75.5k
        return TargetTransformInfo::TCC_Free;
351
54
      return TargetTransformInfo::TCC_Basic;
352
54
    case Instruction::ZExt:
353
0
      if (TLI->isZExtFree(OpTy, Ty))
354
0
        return TargetTransformInfo::TCC_Free;
355
0
      return TargetTransformInfo::TCC_Basic;
356
1.62M
    }
357
1.62M
358
1.62M
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
1.62M
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
360
361
801k
  unsigned getInliningThresholdMultiplier() { return 1; }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
361
520k
  unsigned getInliningThresholdMultiplier() { return 1; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getInliningThresholdMultiplier()
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
361
76.3k
  unsigned getInliningThresholdMultiplier() { return 1; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getInliningThresholdMultiplier()
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getInliningThresholdMultiplier()
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
361
8
  unsigned getInliningThresholdMultiplier() { return 1; }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
361
17
  unsigned getInliningThresholdMultiplier() { return 1; }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
361
204k
  unsigned getInliningThresholdMultiplier() { return 1; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getInliningThresholdMultiplier()
362
363
  void getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
364
387k
                               TTI::UnrollingPreferences &UP) {
365
387k
    // This unrolling functionality is target independent, but to provide some
366
387k
    // motivation for its intended use, for x86:
367
387k
368
387k
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
369
387k
    // Manual, Intel Core models and later have a loop stream detector (and
370
387k
    // associated uop queue) that can benefit from partial unrolling.
371
387k
    // The relevant requirements are:
372
387k
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
373
387k
    //    taken, and none of them may be calls.
374
387k
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
375
387k
376
387k
    // According to the Software Optimization Guide for AMD Family 15h
377
387k
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
378
387k
    // and loop buffer which can benefit from partial unrolling.
379
387k
    // The relevant requirements are:
380
387k
    //  - The loop must have fewer than 16 branches
381
387k
    //  - The loop must have less than 40 uops in all executed loop branches
382
387k
383
387k
    // The number of taken branches in a loop is hard to estimate here, and
384
387k
    // benchmarking has revealed that it is better not to be conservative when
385
387k
    // estimating the branch count. As a result, we'll ignore the branch limits
386
387k
    // until someone finds a case where it matters in practice.
387
387k
388
387k
    unsigned MaxOps;
389
387k
    const TargetSubtargetInfo *ST = getST();
390
387k
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
391
0
      MaxOps = PartialUnrollingThreshold;
392
387k
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
393
22.9k
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
394
364k
    else
395
364k
      return;
396
22.9k
397
22.9k
    // Scan the loop: don't unroll loops with calls.
398
71.3k
    
for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); 22.9k
I != E;
399
58.5k
         
++I48.3k
) {
400
58.5k
      BasicBlock *BB = *I;
401
58.5k
402
389k
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; 
++J331k
)
403
341k
        if (isa<CallInst>(J) || 
isa<InvokeInst>(J)325k
) {
404
15.7k
          ImmutableCallSite CS(&*J);
405
15.7k
          if (const Function *F = CS.getCalledFunction()) {
406
14.1k
            if (!static_cast<T *>(this)->isLoweredToCall(F))
407
5.59k
              continue;
408
10.1k
          }
409
10.1k
410
10.1k
          return;
411
10.1k
        }
412
58.5k
    }
413
22.9k
414
22.9k
    // Enable runtime and partial unrolling up to the specified size.
415
22.9k
    // Enable using trip count upper bound to unroll loops.
416
22.9k
    UP.Partial = UP.Runtime = UP.UpperBound = true;
417
12.8k
    UP.PartialThreshold = MaxOps;
418
12.8k
419
12.8k
    // Avoid unrolling when optimizing for size.
420
12.8k
    UP.OptSizeThreshold = 0;
421
12.8k
    UP.PartialOptSizeThreshold = 0;
422
12.8k
423
12.8k
    // Set number of instructions optimized when "back edge"
424
12.8k
    // becomes "fall through" to default value of 2.
425
12.8k
    UP.BEInsns = 2;
426
12.8k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
Line
Count
Source
364
357k
                               TTI::UnrollingPreferences &UP) {
365
357k
    // This unrolling functionality is target independent, but to provide some
366
357k
    // motivation for its intended use, for x86:
367
357k
368
357k
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
369
357k
    // Manual, Intel Core models and later have a loop stream detector (and
370
357k
    // associated uop queue) that can benefit from partial unrolling.
371
357k
    // The relevant requirements are:
372
357k
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
373
357k
    //    taken, and none of them may be calls.
374
357k
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
375
357k
376
357k
    // According to the Software Optimization Guide for AMD Family 15h
377
357k
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
378
357k
    // and loop buffer which can benefit from partial unrolling.
379
357k
    // The relevant requirements are:
380
357k
    //  - The loop must have fewer than 16 branches
381
357k
    //  - The loop must have less than 40 uops in all executed loop branches
382
357k
383
357k
    // The number of taken branches in a loop is hard to estimate here, and
384
357k
    // benchmarking has revealed that it is better not to be conservative when
385
357k
    // estimating the branch count. As a result, we'll ignore the branch limits
386
357k
    // until someone finds a case where it matters in practice.
387
357k
388
357k
    unsigned MaxOps;
389
357k
    const TargetSubtargetInfo *ST = getST();
390
357k
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
391
0
      MaxOps = PartialUnrollingThreshold;
392
357k
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
393
16
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
394
357k
    else
395
357k
      return;
396
16
397
16
    // Scan the loop: don't unroll loops with calls.
398
44
    
for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); 16
I != E;
399
28
         ++I) {
400
28
      BasicBlock *BB = *I;
401
28
402
219
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; 
++J191
)
403
191
        if (isa<CallInst>(J) || 
isa<InvokeInst>(J)185
) {
404
6
          ImmutableCallSite CS(&*J);
405
6
          if (const Function *F = CS.getCalledFunction()) {
406
6
            if (!static_cast<T *>(this)->isLoweredToCall(F))
407
6
              continue;
408
0
          }
409
0
410
0
          return;
411
0
        }
412
28
    }
413
16
414
16
    // Enable runtime and partial unrolling up to the specified size.
415
16
    // Enable using trip count upper bound to unroll loops.
416
16
    UP.Partial = UP.Runtime = UP.UpperBound = true;
417
16
    UP.PartialThreshold = MaxOps;
418
16
419
16
    // Avoid unrolling when optimizing for size.
420
16
    UP.OptSizeThreshold = 0;
421
16
    UP.PartialOptSizeThreshold = 0;
422
16
423
16
    // Set number of instructions optimized when "back edge"
424
16
    // becomes "fall through" to default value of 2.
425
16
    UP.BEInsns = 2;
426
16
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
Line
Count
Source
364
6.77k
                               TTI::UnrollingPreferences &UP) {
365
6.77k
    // This unrolling functionality is target independent, but to provide some
366
6.77k
    // motivation for its intended use, for x86:
367
6.77k
368
6.77k
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
369
6.77k
    // Manual, Intel Core models and later have a loop stream detector (and
370
6.77k
    // associated uop queue) that can benefit from partial unrolling.
371
6.77k
    // The relevant requirements are:
372
6.77k
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
373
6.77k
    //    taken, and none of them may be calls.
374
6.77k
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
375
6.77k
376
6.77k
    // According to the Software Optimization Guide for AMD Family 15h
377
6.77k
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
378
6.77k
    // and loop buffer which can benefit from partial unrolling.
379
6.77k
    // The relevant requirements are:
380
6.77k
    //  - The loop must have fewer than 16 branches
381
6.77k
    //  - The loop must have less than 40 uops in all executed loop branches
382
6.77k
383
6.77k
    // The number of taken branches in a loop is hard to estimate here, and
384
6.77k
    // benchmarking has revealed that it is better not to be conservative when
385
6.77k
    // estimating the branch count. As a result, we'll ignore the branch limits
386
6.77k
    // until someone finds a case where it matters in practice.
387
6.77k
388
6.77k
    unsigned MaxOps;
389
6.77k
    const TargetSubtargetInfo *ST = getST();
390
6.77k
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
391
0
      MaxOps = PartialUnrollingThreshold;
392
6.77k
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
393
15
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
394
6.76k
    else
395
6.76k
      return;
396
15
397
15
    // Scan the loop: don't unroll loops with calls.
398
32
    
for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); 15
I != E;
399
19
         
++I17
) {
400
19
      BasicBlock *BB = *I;
401
19
402
179
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; 
++J160
)
403
162
        if (isa<CallInst>(J) || 
isa<InvokeInst>(J)154
) {
404
8
          ImmutableCallSite CS(&*J);
405
8
          if (const Function *F = CS.getCalledFunction()) {
406
8
            if (!static_cast<T *>(this)->isLoweredToCall(F))
407
6
              continue;
408
2
          }
409
2
410
2
          return;
411
2
        }
412
19
    }
413
15
414
15
    // Enable runtime and partial unrolling up to the specified size.
415
15
    // Enable using trip count upper bound to unroll loops.
416
15
    UP.Partial = UP.Runtime = UP.UpperBound = true;
417
13
    UP.PartialThreshold = MaxOps;
418
13
419
13
    // Avoid unrolling when optimizing for size.
420
13
    UP.OptSizeThreshold = 0;
421
13
    UP.PartialOptSizeThreshold = 0;
422
13
423
13
    // Set number of instructions optimized when "back edge"
424
13
    // becomes "fall through" to default value of 2.
425
13
    UP.BEInsns = 2;
426
13
  }
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
364
2
                               TTI::UnrollingPreferences &UP) {
365
2
    // This unrolling functionality is target independent, but to provide some
366
2
    // motivation for its intended use, for x86:
367
2
368
2
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
369
2
    // Manual, Intel Core models and later have a loop stream detector (and
370
2
    // associated uop queue) that can benefit from partial unrolling.
371
2
    // The relevant requirements are:
372
2
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
373
2
    //    taken, and none of them may be calls.
374
2
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
375
2
376
2
    // According to the Software Optimization Guide for AMD Family 15h
377
2
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
378
2
    // and loop buffer which can benefit from partial unrolling.
379
2
    // The relevant requirements are:
380
2
    //  - The loop must have fewer than 16 branches
381
2
    //  - The loop must have less than 40 uops in all executed loop branches
382
2
383
2
    // The number of taken branches in a loop is hard to estimate here, and
384
2
    // benchmarking has revealed that it is better not to be conservative when
385
2
    // estimating the branch count. As a result, we'll ignore the branch limits
386
2
    // until someone finds a case where it matters in practice.
387
2
388
2
    unsigned MaxOps;
389
2
    const TargetSubtargetInfo *ST = getST();
390
2
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
391
0
      MaxOps = PartialUnrollingThreshold;
392
2
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
393
0
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
394
2
    else
395
2
      return;
396
0
397
0
    // Scan the loop: don't unroll loops with calls.
398
0
    for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); I != E;
399
0
         ++I) {
400
0
      BasicBlock *BB = *I;
401
0
402
0
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; ++J)
403
0
        if (isa<CallInst>(J) || isa<InvokeInst>(J)) {
404
0
          ImmutableCallSite CS(&*J);
405
0
          if (const Function *F = CS.getCalledFunction()) {
406
0
            if (!static_cast<T *>(this)->isLoweredToCall(F))
407
0
              continue;
408
0
          }
409
0
410
0
          return;
411
0
        }
412
0
    }
413
0
414
0
    // Enable runtime and partial unrolling up to the specified size.
415
0
    // Enable using trip count upper bound to unroll loops.
416
0
    UP.Partial = UP.Runtime = UP.UpperBound = true;
417
0
    UP.PartialThreshold = MaxOps;
418
0
419
0
    // Avoid unrolling when optimizing for size.
420
0
    UP.OptSizeThreshold = 0;
421
0
    UP.PartialOptSizeThreshold = 0;
422
0
423
0
    // Set number of instructions optimized when "back edge"
424
0
    // becomes "fall through" to default value of 2.
425
0
    UP.BEInsns = 2;
426
0
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
Line
Count
Source
364
11
                               TTI::UnrollingPreferences &UP) {
365
11
    // This unrolling functionality is target independent, but to provide some
366
11
    // motivation for its intended use, for x86:
367
11
368
11
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
369
11
    // Manual, Intel Core models and later have a loop stream detector (and
370
11
    // associated uop queue) that can benefit from partial unrolling.
371
11
    // The relevant requirements are:
372
11
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
373
11
    //    taken, and none of them may be calls.
374
11
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
375
11
376
11
    // According to the Software Optimization Guide for AMD Family 15h
377
11
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
378
11
    // and loop buffer which can benefit from partial unrolling.
379
11
    // The relevant requirements are:
380
11
    //  - The loop must have fewer than 16 branches
381
11
    //  - The loop must have less than 40 uops in all executed loop branches
382
11
383
11
    // The number of taken branches in a loop is hard to estimate here, and
384
11
    // benchmarking has revealed that it is better not to be conservative when
385
11
    // estimating the branch count. As a result, we'll ignore the branch limits
386
11
    // until someone finds a case where it matters in practice.
387
11
388
11
    unsigned MaxOps;
389
11
    const TargetSubtargetInfo *ST = getST();
390
11
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
391
0
      MaxOps = PartialUnrollingThreshold;
392
11
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
393
5
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
394
6
    else
395
6
      return;
396
5
397
5
    // Scan the loop: don't unroll loops with calls.
398
10
    
for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); 5
I != E;
399
5
         ++I) {
400
5
      BasicBlock *BB = *I;
401
5
402
57
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; 
++J52
)
403
52
        if (isa<CallInst>(J) || isa<InvokeInst>(J)) {
404
0
          ImmutableCallSite CS(&*J);
405
0
          if (const Function *F = CS.getCalledFunction()) {
406
0
            if (!static_cast<T *>(this)->isLoweredToCall(F))
407
0
              continue;
408
0
          }
409
0
410
0
          return;
411
0
        }
412
5
    }
413
5
414
5
    // Enable runtime and partial unrolling up to the specified size.
415
5
    // Enable using trip count upper bound to unroll loops.
416
5
    UP.Partial = UP.Runtime = UP.UpperBound = true;
417
5
    UP.PartialThreshold = MaxOps;
418
5
419
5
    // Avoid unrolling when optimizing for size.
420
5
    UP.OptSizeThreshold = 0;
421
5
    UP.PartialOptSizeThreshold = 0;
422
5
423
5
    // Set number of instructions optimized when "back edge"
424
5
    // becomes "fall through" to default value of 2.
425
5
    UP.BEInsns = 2;
426
5
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
Line
Count
Source
364
23.0k
                               TTI::UnrollingPreferences &UP) {
365
23.0k
    // This unrolling functionality is target independent, but to provide some
366
23.0k
    // motivation for its intended use, for x86:
367
23.0k
368
23.0k
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
369
23.0k
    // Manual, Intel Core models and later have a loop stream detector (and
370
23.0k
    // associated uop queue) that can benefit from partial unrolling.
371
23.0k
    // The relevant requirements are:
372
23.0k
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
373
23.0k
    //    taken, and none of them may be calls.
374
23.0k
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
375
23.0k
376
23.0k
    // According to the Software Optimization Guide for AMD Family 15h
377
23.0k
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
378
23.0k
    // and loop buffer which can benefit from partial unrolling.
379
23.0k
    // The relevant requirements are:
380
23.0k
    //  - The loop must have fewer than 16 branches
381
23.0k
    //  - The loop must have less than 40 uops in all executed loop branches
382
23.0k
383
23.0k
    // The number of taken branches in a loop is hard to estimate here, and
384
23.0k
    // benchmarking has revealed that it is better not to be conservative when
385
23.0k
    // estimating the branch count. As a result, we'll ignore the branch limits
386
23.0k
    // until someone finds a case where it matters in practice.
387
23.0k
388
23.0k
    unsigned MaxOps;
389
23.0k
    const TargetSubtargetInfo *ST = getST();
390
23.0k
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
391
0
      MaxOps = PartialUnrollingThreshold;
392
23.0k
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
393
22.9k
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
394
154
    else
395
154
      return;
396
22.9k
397
22.9k
    // Scan the loop: don't unroll loops with calls.
398
71.2k
    
for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); 22.9k
I != E;
399
58.4k
         
++I48.3k
) {
400
58.4k
      BasicBlock *BB = *I;
401
58.4k
402
389k
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; 
++J330k
)
403
340k
        if (isa<CallInst>(J) || 
isa<InvokeInst>(J)325k
) {
404
15.7k
          ImmutableCallSite CS(&*J);
405
15.7k
          if (const Function *F = CS.getCalledFunction()) {
406
14.1k
            if (!static_cast<T *>(this)->isLoweredToCall(F))
407
5.57k
              continue;
408
10.1k
          }
409
10.1k
410
10.1k
          return;
411
10.1k
        }
412
58.4k
    }
413
22.9k
414
22.9k
    // Enable runtime and partial unrolling up to the specified size.
415
22.9k
    // Enable using trip count upper bound to unroll loops.
416
22.9k
    UP.Partial = UP.Runtime = UP.UpperBound = true;
417
12.7k
    UP.PartialThreshold = MaxOps;
418
12.7k
419
12.7k
    // Avoid unrolling when optimizing for size.
420
12.7k
    UP.OptSizeThreshold = 0;
421
12.7k
    UP.PartialOptSizeThreshold = 0;
422
12.7k
423
12.7k
    // Set number of instructions optimized when "back edge"
424
12.7k
    // becomes "fall through" to default value of 2.
425
12.7k
    UP.BEInsns = 2;
426
12.7k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
427
428
11
  int getInstructionLatency(const Instruction *I) {
429
11
    if (isa<LoadInst>(I))
430
1
      return getST()->getSchedModel().DefaultLoadLatency;
431
10
432
10
    return BaseT::getInstructionLatency(I);
433
10
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getInstructionLatency(llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getInstructionLatency(llvm::Instruction const*)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getInstructionLatency(llvm::Instruction const*)
Line
Count
Source
428
11
  int getInstructionLatency(const Instruction *I) {
429
11
    if (isa<LoadInst>(I))
430
1
      return getST()->getSchedModel().DefaultLoadLatency;
431
10
432
10
    return BaseT::getInstructionLatency(I);
433
10
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getInstructionLatency(llvm::Instruction const*)
434
435
  /// @}
436
437
  /// \name Vector TTI Implementations
438
  /// @{
439
440
383
  unsigned getNumberOfRegisters(bool Vector) { return Vector ? 
052
:
1331
; }
llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getNumberOfRegisters(bool)
Line
Count
Source
440
56
  unsigned getNumberOfRegisters(bool Vector) { return Vector ? 
00
: 1; }
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getNumberOfRegisters(bool)
Line
Count
Source
440
327
  unsigned getNumberOfRegisters(bool Vector) { return Vector ? 
052
:
1275
; }
441
442
0
  unsigned getRegisterBitWidth(bool Vector) const { return 32; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getRegisterBitWidth(bool) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getRegisterBitWidth(bool) const
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getRegisterBitWidth(bool) const
443
444
  /// Estimate the overhead of scalarizing an instruction. Insert and Extract
445
  /// are set if the result needs to be inserted and/or extracted from vectors.
446
85.9k
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
447
85.9k
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
448
85.9k
    unsigned Cost = 0;
449
85.9k
450
354k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i268k
) {
451
268k
      if (Insert)
452
142k
        Cost += static_cast<T *>(this)
453
142k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
454
268k
      if (Extract)
455
129k
        Cost += static_cast<T *>(this)
456
129k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
457
268k
    }
458
85.9k
459
85.9k
    return Cost;
460
85.9k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
446
70.3k
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
447
70.3k
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
448
70.3k
    unsigned Cost = 0;
449
70.3k
450
258k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i188k
) {
451
188k
      if (Insert)
452
98.7k
        Cost += static_cast<T *>(this)
453
98.7k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
454
188k
      if (Extract)
455
89.9k
        Cost += static_cast<T *>(this)
456
89.9k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
457
188k
    }
458
70.3k
459
70.3k
    return Cost;
460
70.3k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
446
287
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
447
287
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
448
287
    unsigned Cost = 0;
449
287
450
1.39k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i1.10k
) {
451
1.10k
      if (Insert)
452
678
        Cost += static_cast<T *>(this)
453
678
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
454
1.10k
      if (Extract)
455
429
        Cost += static_cast<T *>(this)
456
429
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
457
1.10k
    }
458
287
459
287
    return Cost;
460
287
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
446
3.08k
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
447
3.08k
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
448
3.08k
    unsigned Cost = 0;
449
3.08k
450
10.7k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i7.67k
) {
451
7.67k
      if (Insert)
452
2.79k
        Cost += static_cast<T *>(this)
453
2.79k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
454
7.67k
      if (Extract)
455
5.10k
        Cost += static_cast<T *>(this)
456
5.10k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
457
7.67k
    }
458
3.08k
459
3.08k
    return Cost;
460
3.08k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
446
33
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
447
33
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
448
33
    unsigned Cost = 0;
449
33
450
445
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i412
) {
451
412
      if (Insert)
452
124
        Cost += static_cast<T *>(this)
453
124
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
454
412
      if (Extract)
455
288
        Cost += static_cast<T *>(this)
456
288
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
457
412
    }
458
33
459
33
    return Cost;
460
33
  }
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
446
4
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
447
4
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
448
4
    unsigned Cost = 0;
449
4
450
12
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i8
) {
451
8
      if (Insert)
452
4
        Cost += static_cast<T *>(this)
453
4
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
454
8
      if (Extract)
455
4
        Cost += static_cast<T *>(this)
456
4
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
457
8
    }
458
4
459
4
    return Cost;
460
4
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
446
24
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
447
24
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
448
24
    unsigned Cost = 0;
449
24
450
103
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i79
) {
451
79
      if (Insert)
452
69
        Cost += static_cast<T *>(this)
453
69
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
454
79
      if (Extract)
455
10
        Cost += static_cast<T *>(this)
456
10
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
457
79
    }
458
24
459
24
    return Cost;
460
24
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
446
260
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
447
260
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
448
260
    unsigned Cost = 0;
449
260
450
2.01k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i1.75k
) {
451
1.75k
      if (Insert)
452
1.61k
        Cost += static_cast<T *>(this)
453
1.61k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
454
1.75k
      if (Extract)
455
988
        Cost += static_cast<T *>(this)
456
988
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
457
1.75k
    }
458
260
459
260
    return Cost;
460
260
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
446
11.9k
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
447
11.9k
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
448
11.9k
    unsigned Cost = 0;
449
11.9k
450
80.4k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i68.5k
) {
451
68.5k
      if (Insert)
452
38.3k
        Cost += static_cast<T *>(this)
453
38.3k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
454
68.5k
      if (Extract)
455
32.3k
        Cost += static_cast<T *>(this)
456
32.3k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
457
68.5k
    }
458
11.9k
459
11.9k
    return Cost;
460
11.9k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
461
462
  /// Estimate the overhead of scalarizing an instructions unique
463
  /// non-constant operands. The types of the arguments are ordinarily
464
  /// scalar, in which case the costs are multiplied with VF.
465
  unsigned getOperandsScalarizationOverhead(ArrayRef<const Value *> Args,
466
21.5k
                                            unsigned VF) {
467
21.5k
    unsigned Cost = 0;
468
21.5k
    SmallPtrSet<const Value*, 4> UniqueOperands;
469
29.5k
    for (const Value *A : Args) {
470
29.5k
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second25.9k
) {
471
25.9k
        Type *VecTy = nullptr;
472
25.9k
        if (A->getType()->isVectorTy()) {
473
662
          VecTy = A->getType();
474
662
          // If A is a vector operand, VF should be 1 or correspond to A.
475
662
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
476
662
                 "Vector argument does not match VF");
477
662
        }
478
25.2k
        else
479
25.2k
          VecTy = VectorType::get(A->getType(), VF);
480
25.9k
481
25.9k
        Cost += getScalarizationOverhead(VecTy, false, true);
482
25.9k
      }
483
29.5k
    }
484
21.5k
485
21.5k
    return Cost;
486
21.5k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
466
16.8k
                                            unsigned VF) {
467
16.8k
    unsigned Cost = 0;
468
16.8k
    SmallPtrSet<const Value*, 4> UniqueOperands;
469
21.9k
    for (const Value *A : Args) {
470
21.9k
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second20.7k
) {
471
20.7k
        Type *VecTy = nullptr;
472
20.7k
        if (A->getType()->isVectorTy()) {
473
5
          VecTy = A->getType();
474
5
          // If A is a vector operand, VF should be 1 or correspond to A.
475
5
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
476
5
                 "Vector argument does not match VF");
477
5
        }
478
20.7k
        else
479
20.7k
          VecTy = VectorType::get(A->getType(), VF);
480
20.7k
481
20.7k
        Cost += getScalarizationOverhead(VecTy, false, true);
482
20.7k
      }
483
21.9k
    }
484
16.8k
485
16.8k
    return Cost;
486
16.8k
  }
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
466
18
                                            unsigned VF) {
467
18
    unsigned Cost = 0;
468
18
    SmallPtrSet<const Value*, 4> UniqueOperands;
469
30
    for (const Value *A : Args) {
470
30
      if (!isa<Constant>(A) && UniqueOperands.insert(A).second) {
471
30
        Type *VecTy = nullptr;
472
30
        if (A->getType()->isVectorTy()) {
473
6
          VecTy = A->getType();
474
6
          // If A is a vector operand, VF should be 1 or correspond to A.
475
6
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
476
6
                 "Vector argument does not match VF");
477
6
        }
478
24
        else
479
24
          VecTy = VectorType::get(A->getType(), VF);
480
30
481
30
        Cost += getScalarizationOverhead(VecTy, false, true);
482
30
      }
483
30
    }
484
18
485
18
    return Cost;
486
18
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
466
649
                                            unsigned VF) {
467
649
    unsigned Cost = 0;
468
649
    SmallPtrSet<const Value*, 4> UniqueOperands;
469
1.18k
    for (const Value *A : Args) {
470
1.18k
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second880
) {
471
880
        Type *VecTy = nullptr;
472
880
        if (A->getType()->isVectorTy()) {
473
0
          VecTy = A->getType();
474
0
          // If A is a vector operand, VF should be 1 or correspond to A.
475
0
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
476
0
                 "Vector argument does not match VF");
477
0
        }
478
880
        else
479
880
          VecTy = VectorType::get(A->getType(), VF);
480
880
481
880
        Cost += getScalarizationOverhead(VecTy, false, true);
482
880
      }
483
1.18k
    }
484
649
485
649
    return Cost;
486
649
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
466
15
                                            unsigned VF) {
467
15
    unsigned Cost = 0;
468
15
    SmallPtrSet<const Value*, 4> UniqueOperands;
469
20
    for (const Value *A : Args) {
470
20
      if (!isa<Constant>(A) && UniqueOperands.insert(A).second) {
471
20
        Type *VecTy = nullptr;
472
20
        if (A->getType()->isVectorTy()) {
473
0
          VecTy = A->getType();
474
0
          // If A is a vector operand, VF should be 1 or correspond to A.
475
0
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
476
0
                 "Vector argument does not match VF");
477
0
        }
478
20
        else
479
20
          VecTy = VectorType::get(A->getType(), VF);
480
20
481
20
        Cost += getScalarizationOverhead(VecTy, false, true);
482
20
      }
483
20
    }
484
15
485
15
    return Cost;
486
15
  }
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
466
3
                                            unsigned VF) {
467
3
    unsigned Cost = 0;
468
3
    SmallPtrSet<const Value*, 4> UniqueOperands;
469
3
    for (const Value *A : Args) {
470
3
      if (!isa<Constant>(A) && UniqueOperands.insert(A).second) {
471
3
        Type *VecTy = nullptr;
472
3
        if (A->getType()->isVectorTy()) {
473
1
          VecTy = A->getType();
474
1
          // If A is a vector operand, VF should be 1 or correspond to A.
475
1
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
476
1
                 "Vector argument does not match VF");
477
1
        }
478
2
        else
479
2
          VecTy = VectorType::get(A->getType(), VF);
480
3
481
3
        Cost += getScalarizationOverhead(VecTy, false, true);
482
3
      }
483
3
    }
484
3
485
3
    return Cost;
486
3
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
466
94
                                            unsigned VF) {
467
94
    unsigned Cost = 0;
468
94
    SmallPtrSet<const Value*, 4> UniqueOperands;
469
186
    for (const Value *A : Args) {
470
186
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second2
) {
471
2
        Type *VecTy = nullptr;
472
2
        if (A->getType()->isVectorTy()) {
473
0
          VecTy = A->getType();
474
0
          // If A is a vector operand, VF should be 1 or correspond to A.
475
0
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
476
0
                 "Vector argument does not match VF");
477
0
        }
478
2
        else
479
2
          VecTy = VectorType::get(A->getType(), VF);
480
2
481
2
        Cost += getScalarizationOverhead(VecTy, false, true);
482
2
      }
483
186
    }
484
94
485
94
    return Cost;
486
94
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
466
3.93k
                                            unsigned VF) {
467
3.93k
    unsigned Cost = 0;
468
3.93k
    SmallPtrSet<const Value*, 4> UniqueOperands;
469
6.13k
    for (const Value *A : Args) {
470
6.13k
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second4.23k
) {
471
4.23k
        Type *VecTy = nullptr;
472
4.23k
        if (A->getType()->isVectorTy()) {
473
650
          VecTy = A->getType();
474
650
          // If A is a vector operand, VF should be 1 or correspond to A.
475
650
          assert((VF == 1 || VF == VecTy->getVectorNumElements()) &&
476
650
                 "Vector argument does not match VF");
477
650
        }
478
3.58k
        else
479
3.58k
          VecTy = VectorType::get(A->getType(), VF);
480
4.23k
481
4.23k
        Cost += getScalarizationOverhead(VecTy, false, true);
482
4.23k
      }
483
6.13k
    }
484
3.93k
485
3.93k
    return Cost;
486
3.93k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
487
488
5.63k
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
489
5.63k
    assert(VecTy->isVectorTy());
490
5.63k
491
5.63k
    unsigned Cost = 0;
492
5.63k
493
5.63k
    Cost += getScalarizationOverhead(VecTy, true, false);
494
5.63k
    if (!Args.empty())
495
84
      Cost += getOperandsScalarizationOverhead(Args,
496
84
                                               VecTy->getVectorNumElements());
497
5.54k
    else
498
5.54k
      // When no information on arguments is provided, we add the cost
499
5.54k
      // associated with one argument as a heuristic.
500
5.54k
      Cost += getScalarizationOverhead(VecTy, false, true);
501
5.63k
502
5.63k
    return Cost;
503
5.63k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
488
4.77k
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
489
4.77k
    assert(VecTy->isVectorTy());
490
4.77k
491
4.77k
    unsigned Cost = 0;
492
4.77k
493
4.77k
    Cost += getScalarizationOverhead(VecTy, true, false);
494
4.77k
    if (!Args.empty())
495
0
      Cost += getOperandsScalarizationOverhead(Args,
496
0
                                               VecTy->getVectorNumElements());
497
4.77k
    else
498
4.77k
      // When no information on arguments is provided, we add the cost
499
4.77k
      // associated with one argument as a heuristic.
500
4.77k
      Cost += getScalarizationOverhead(VecTy, false, true);
501
4.77k
502
4.77k
    return Cost;
503
4.77k
  }
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
488
32
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
489
32
    assert(VecTy->isVectorTy());
490
32
491
32
    unsigned Cost = 0;
492
32
493
32
    Cost += getScalarizationOverhead(VecTy, true, false);
494
32
    if (!Args.empty())
495
0
      Cost += getOperandsScalarizationOverhead(Args,
496
0
                                               VecTy->getVectorNumElements());
497
32
    else
498
32
      // When no information on arguments is provided, we add the cost
499
32
      // associated with one argument as a heuristic.
500
32
      Cost += getScalarizationOverhead(VecTy, false, true);
501
32
502
32
    return Cost;
503
32
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
488
688
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
489
688
    assert(VecTy->isVectorTy());
490
688
491
688
    unsigned Cost = 0;
492
688
493
688
    Cost += getScalarizationOverhead(VecTy, true, false);
494
688
    if (!Args.empty())
495
0
      Cost += getOperandsScalarizationOverhead(Args,
496
0
                                               VecTy->getVectorNumElements());
497
688
    else
498
688
      // When no information on arguments is provided, we add the cost
499
688
      // associated with one argument as a heuristic.
500
688
      Cost += getScalarizationOverhead(VecTy, false, true);
501
688
502
688
    return Cost;
503
688
  }
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
488
2
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
489
2
    assert(VecTy->isVectorTy());
490
2
491
2
    unsigned Cost = 0;
492
2
493
2
    Cost += getScalarizationOverhead(VecTy, true, false);
494
2
    if (!Args.empty())
495
0
      Cost += getOperandsScalarizationOverhead(Args,
496
0
                                               VecTy->getVectorNumElements());
497
2
    else
498
2
      // When no information on arguments is provided, we add the cost
499
2
      // associated with one argument as a heuristic.
500
2
      Cost += getScalarizationOverhead(VecTy, false, true);
501
2
502
2
    return Cost;
503
2
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
488
84
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
489
84
    assert(VecTy->isVectorTy());
490
84
491
84
    unsigned Cost = 0;
492
84
493
84
    Cost += getScalarizationOverhead(VecTy, true, false);
494
84
    if (!Args.empty())
495
84
      Cost += getOperandsScalarizationOverhead(Args,
496
84
                                               VecTy->getVectorNumElements());
497
0
    else
498
0
      // When no information on arguments is provided, we add the cost
499
0
      // associated with one argument as a heuristic.
500
0
      Cost += getScalarizationOverhead(VecTy, false, true);
501
84
502
84
    return Cost;
503
84
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
488
54
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
489
54
    assert(VecTy->isVectorTy());
490
54
491
54
    unsigned Cost = 0;
492
54
493
54
    Cost += getScalarizationOverhead(VecTy, true, false);
494
54
    if (!Args.empty())
495
0
      Cost += getOperandsScalarizationOverhead(Args,
496
0
                                               VecTy->getVectorNumElements());
497
54
    else
498
54
      // When no information on arguments is provided, we add the cost
499
54
      // associated with one argument as a heuristic.
500
54
      Cost += getScalarizationOverhead(VecTy, false, true);
501
54
502
54
    return Cost;
503
54
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
504
505
66
  unsigned getMaxInterleaveFactor(unsigned VF) { return 1; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getMaxInterleaveFactor(unsigned int)
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getMaxInterleaveFactor(unsigned int)
Line
Count
Source
505
42
  unsigned getMaxInterleaveFactor(unsigned VF) { return 1; }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getMaxInterleaveFactor(unsigned int)
Line
Count
Source
505
1
  unsigned getMaxInterleaveFactor(unsigned VF) { return 1; }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getMaxInterleaveFactor(unsigned int)
Line
Count
Source
505
22
  unsigned getMaxInterleaveFactor(unsigned VF) { return 1; }
llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getMaxInterleaveFactor(unsigned int)
Line
Count
Source
505
1
  unsigned getMaxInterleaveFactor(unsigned VF) { return 1; }
506
507
  unsigned getArithmeticInstrCost(
508
      unsigned Opcode, Type *Ty,
509
      TTI::OperandValueKind Opd1Info = TTI::OK_AnyValue,
510
      TTI::OperandValueKind Opd2Info = TTI::OK_AnyValue,
511
      TTI::OperandValueProperties Opd1PropInfo = TTI::OP_None,
512
      TTI::OperandValueProperties Opd2PropInfo = TTI::OP_None,
513
499k
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
514
499k
    // Check if any of the operands are vector operands.
515
499k
    const TargetLoweringBase *TLI = getTLI();
516
499k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
517
499k
    assert(ISD && "Invalid opcode");
518
499k
519
499k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
520
499k
521
499k
    bool IsFloat = Ty->isFPOrFPVectorTy();
522
499k
    // Assume that floating point arithmetic operations cost twice as much as
523
499k
    // integer operations.
524
499k
    unsigned OpCost = (IsFloat ? 
2264k
:
1234k
);
525
499k
526
499k
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
527
443k
      // The operation is legal. Assume it costs 1.
528
443k
      // TODO: Once we have extract/insert subvector cost we need to use them.
529
443k
      return LT.first * OpCost;
530
443k
    }
531
55.5k
532
55.5k
    if (!TLI->isOperationExpand(ISD, LT.second)) {
533
46.1k
      // If the operation is custom lowered, then assume that the code is twice
534
46.1k
      // as expensive.
535
46.1k
      return LT.first * 2 * OpCost;
536
46.1k
    }
537
9.38k
538
9.38k
    // Else, assume that we need to scalarize this op.
539
9.38k
    // TODO: If one of the types get legalized by splitting, handle this
540
9.38k
    // similarly to what getCastInstrCost() does.
541
9.38k
    if (Ty->isVectorTy()) {
542
5.61k
      unsigned Num = Ty->getVectorNumElements();
543
5.61k
      unsigned Cost = static_cast<T *>(this)
544
5.61k
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
545
5.61k
      // Return the cost of multiple scalar invocation plus the cost of
546
5.61k
      // inserting and extracting the values.
547
5.61k
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
548
5.61k
    }
549
3.76k
550
3.76k
    // We don't know anything about this scalar instruction.
551
3.76k
    return OpCost;
552
3.76k
  }
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
513
408k
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
514
408k
    // Check if any of the operands are vector operands.
515
408k
    const TargetLoweringBase *TLI = getTLI();
516
408k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
517
408k
    assert(ISD && "Invalid opcode");
518
408k
519
408k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
520
408k
521
408k
    bool IsFloat = Ty->isFPOrFPVectorTy();
522
408k
    // Assume that floating point arithmetic operations cost twice as much as
523
408k
    // integer operations.
524
408k
    unsigned OpCost = (IsFloat ? 
2259k
:
1149k
);
525
408k
526
408k
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
527
357k
      // The operation is legal. Assume it costs 1.
528
357k
      // TODO: Once we have extract/insert subvector cost we need to use them.
529
357k
      return LT.first * OpCost;
530
357k
    }
531
50.7k
532
50.7k
    if (!TLI->isOperationExpand(ISD, LT.second)) {
533
45.1k
      // If the operation is custom lowered, then assume that the code is twice
534
45.1k
      // as expensive.
535
45.1k
      return LT.first * 2 * OpCost;
536
45.1k
    }
537
5.62k
538
5.62k
    // Else, assume that we need to scalarize this op.
539
5.62k
    // TODO: If one of the types get legalized by splitting, handle this
540
5.62k
    // similarly to what getCastInstrCost() does.
541
5.62k
    if (Ty->isVectorTy()) {
542
4.77k
      unsigned Num = Ty->getVectorNumElements();
543
4.77k
      unsigned Cost = static_cast<T *>(this)
544
4.77k
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
545
4.77k
      // Return the cost of multiple scalar invocation plus the cost of
546
4.77k
      // inserting and extracting the values.
547
4.77k
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
548
4.77k
    }
549
855
550
855
    // We don't know anything about this scalar instruction.
551
855
    return OpCost;
552
855
  }
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
513
34
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
514
34
    // Check if any of the operands are vector operands.
515
34
    const TargetLoweringBase *TLI = getTLI();
516
34
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
517
34
    assert(ISD && "Invalid opcode");
518
34
519
34
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
520
34
521
34
    bool IsFloat = Ty->isFPOrFPVectorTy();
522
34
    // Assume that floating point arithmetic operations cost twice as much as
523
34
    // integer operations.
524
34
    unsigned OpCost = (IsFloat ? 
227
:
17
);
525
34
526
34
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
527
1
      // The operation is legal. Assume it costs 1.
528
1
      // TODO: Once we have extract/insert subvector cost we need to use them.
529
1
      return LT.first * OpCost;
530
1
    }
531
33
532
33
    if (!TLI->isOperationExpand(ISD, LT.second)) {
533
1
      // If the operation is custom lowered, then assume that the code is twice
534
1
      // as expensive.
535
1
      return LT.first * 2 * OpCost;
536
1
    }
537
32
538
32
    // Else, assume that we need to scalarize this op.
539
32
    // TODO: If one of the types get legalized by splitting, handle this
540
32
    // similarly to what getCastInstrCost() does.
541
32
    if (Ty->isVectorTy()) {
542
32
      unsigned Num = Ty->getVectorNumElements();
543
32
      unsigned Cost = static_cast<T *>(this)
544
32
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
545
32
      // Return the cost of multiple scalar invocation plus the cost of
546
32
      // inserting and extracting the values.
547
32
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
548
32
    }
549
0
550
0
    // We don't know anything about this scalar instruction.
551
0
    return OpCost;
552
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
513
14.5k
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
514
14.5k
    // Check if any of the operands are vector operands.
515
14.5k
    const TargetLoweringBase *TLI = getTLI();
516
14.5k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
517
14.5k
    assert(ISD && "Invalid opcode");
518
14.5k
519
14.5k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
520
14.5k
521
14.5k
    bool IsFloat = Ty->isFPOrFPVectorTy();
522
14.5k
    // Assume that floating point arithmetic operations cost twice as much as
523
14.5k
    // integer operations.
524
14.5k
    unsigned OpCost = (IsFloat ? 
22.90k
:
111.6k
);
525
14.5k
526
14.5k
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
527
12.7k
      // The operation is legal. Assume it costs 1.
528
12.7k
      // TODO: Once we have extract/insert subvector cost we need to use them.
529
12.7k
      return LT.first * OpCost;
530
12.7k
    }
531
1.71k
532
1.71k
    if (!TLI->isOperationExpand(ISD, LT.second)) {
533
1.01k
      // If the operation is custom lowered, then assume that the code is twice
534
1.01k
      // as expensive.
535
1.01k
      return LT.first * 2 * OpCost;
536
1.01k
    }
537
706
538
706
    // Else, assume that we need to scalarize this op.
539
706
    // TODO: If one of the types get legalized by splitting, handle this
540
706
    // similarly to what getCastInstrCost() does.
541
706
    if (Ty->isVectorTy()) {
542
688
      unsigned Num = Ty->getVectorNumElements();
543
688
      unsigned Cost = static_cast<T *>(this)
544
688
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
545
688
      // Return the cost of multiple scalar invocation plus the cost of
546
688
      // inserting and extracting the values.
547
688
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
548
688
    }
549
18
550
18
    // We don't know anything about this scalar instruction.
551
18
    return OpCost;
552
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
513
42
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
514
42
    // Check if any of the operands are vector operands.
515
42
    const TargetLoweringBase *TLI = getTLI();
516
42
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
517
42
    assert(ISD && "Invalid opcode");
518
42
519
42
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
520
42
521
42
    bool IsFloat = Ty->isFPOrFPVectorTy();
522
42
    // Assume that floating point arithmetic operations cost twice as much as
523
42
    // integer operations.
524
42
    unsigned OpCost = (IsFloat ? 
20
: 1);
525
42
526
42
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
527
42
      // The operation is legal. Assume it costs 1.
528
42
      // TODO: Once we have extract/insert subvector cost we need to use them.
529
42
      return LT.first * OpCost;
530
42
    }
531
0
532
0
    if (!TLI->isOperationExpand(ISD, LT.second)) {
533
0
      // If the operation is custom lowered, then assume that the code is twice
534
0
      // as expensive.
535
0
      return LT.first * 2 * OpCost;
536
0
    }
537
0
538
0
    // Else, assume that we need to scalarize this op.
539
0
    // TODO: If one of the types get legalized by splitting, handle this
540
0
    // similarly to what getCastInstrCost() does.
541
0
    if (Ty->isVectorTy()) {
542
0
      unsigned Num = Ty->getVectorNumElements();
543
0
      unsigned Cost = static_cast<T *>(this)
544
0
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
545
0
      // Return the cost of multiple scalar invocation plus the cost of
546
0
      // inserting and extracting the values.
547
0
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
548
0
    }
549
0
550
0
    // We don't know anything about this scalar instruction.
551
0
    return OpCost;
552
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
513
13
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
514
13
    // Check if any of the operands are vector operands.
515
13
    const TargetLoweringBase *TLI = getTLI();
516
13
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
517
13
    assert(ISD && "Invalid opcode");
518
13
519
13
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
520
13
521
13
    bool IsFloat = Ty->isFPOrFPVectorTy();
522
13
    // Assume that floating point arithmetic operations cost twice as much as
523
13
    // integer operations.
524
13
    unsigned OpCost = (IsFloat ? 
210
:
13
);
525
13
526
13
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
527
11
      // The operation is legal. Assume it costs 1.
528
11
      // TODO: Once we have extract/insert subvector cost we need to use them.
529
11
      return LT.first * OpCost;
530
11
    }
531
2
532
2
    if (!TLI->isOperationExpand(ISD, LT.second)) {
533
0
      // If the operation is custom lowered, then assume that the code is twice
534
0
      // as expensive.
535
0
      return LT.first * 2 * OpCost;
536
0
    }
537
2
538
2
    // Else, assume that we need to scalarize this op.
539
2
    // TODO: If one of the types get legalized by splitting, handle this
540
2
    // similarly to what getCastInstrCost() does.
541
2
    if (Ty->isVectorTy()) {
542
2
      unsigned Num = Ty->getVectorNumElements();
543
2
      unsigned Cost = static_cast<T *>(this)
544
2
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
545
2
      // Return the cost of multiple scalar invocation plus the cost of
546
2
      // inserting and extracting the values.
547
2
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
548
2
    }
549
0
550
0
    // We don't know anything about this scalar instruction.
551
0
    return OpCost;
552
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
513
106
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
514
106
    // Check if any of the operands are vector operands.
515
106
    const TargetLoweringBase *TLI = getTLI();
516
106
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
517
106
    assert(ISD && "Invalid opcode");
518
106
519
106
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
520
106
521
106
    bool IsFloat = Ty->isFPOrFPVectorTy();
522
106
    // Assume that floating point arithmetic operations cost twice as much as
523
106
    // integer operations.
524
106
    unsigned OpCost = (IsFloat ? 
258
:
148
);
525
106
526
106
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
527
106
      // The operation is legal. Assume it costs 1.
528
106
      // TODO: Once we have extract/insert subvector cost we need to use them.
529
106
      return LT.first * OpCost;
530
106
    }
531
0
532
0
    if (!TLI->isOperationExpand(ISD, LT.second)) {
533
0
      // If the operation is custom lowered, then assume that the code is twice
534
0
      // as expensive.
535
0
      return LT.first * 2 * OpCost;
536
0
    }
537
0
538
0
    // Else, assume that we need to scalarize this op.
539
0
    // TODO: If one of the types get legalized by splitting, handle this
540
0
    // similarly to what getCastInstrCost() does.
541
0
    if (Ty->isVectorTy()) {
542
0
      unsigned Num = Ty->getVectorNumElements();
543
0
      unsigned Cost = static_cast<T *>(this)
544
0
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
545
0
      // Return the cost of multiple scalar invocation plus the cost of
546
0
      // inserting and extracting the values.
547
0
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
548
0
    }
549
0
550
0
    // We don't know anything about this scalar instruction.
551
0
    return OpCost;
552
0
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getArithmeticInstrCost(unsigned int, llvm::Type*, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueKind, llvm::TargetTransformInfo::OperandValueProperties, llvm::TargetTransformInfo::OperandValueProperties, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
513
291
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
514
291
    // Check if any of the operands are vector operands.
515
291
    const TargetLoweringBase *TLI = getTLI();
516
291
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
517
291
    assert(ISD && "Invalid opcode");
518
291
519
291
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
520
291
521
291
    bool IsFloat = Ty->isFPOrFPVectorTy();
522
291
    // Assume that floating point arithmetic operations cost twice as much as
523
291
    // integer operations.
524
291
    unsigned OpCost = (IsFloat ? 
20
: 1);
525
291
526
291
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
527
223
      // The operation is legal. Assume it costs 1.
528
223
      // TODO: Once we have extract/insert subvector cost we need to use them.
529
223
      return LT.first * OpCost;
530
223
    }
531
68
532
68
    if (!TLI->isOperationExpand(ISD, LT.second)) {
533
0
      // If the operation is custom lowered, then assume that the code is twice
534
0
      // as expensive.
535
0
      return LT.first * 2 * OpCost;
536
0
    }
537
68
538
68
    // Else, assume that we need to scalarize this op.
539
68
    // TODO: If one of the types get legalized by splitting, handle this
540
68
    // similarly to what getCastInstrCost() does.
541
68
    if (Ty->isVectorTy()) {
542
68
      unsigned Num = Ty->getVectorNumElements();
543
68
      unsigned Cost = static_cast<T *>(this)
544
68
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
545
68
      // Return the cost of multiple scalar invocation plus the cost of
546
68
      // inserting and extracting the values.
547
68
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
548
68
    }
549
0
550
0
    // We don't know anything about this scalar instruction.
551
0
    return OpCost;
552
0
  }
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
513
75.5k
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
514
75.5k
    // Check if any of the operands are vector operands.
515
75.5k
    const TargetLoweringBase *TLI = getTLI();
516
75.5k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
517
75.5k
    assert(ISD && "Invalid opcode");
518
75.5k
519
75.5k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
520
75.5k
521
75.5k
    bool IsFloat = Ty->isFPOrFPVectorTy();
522
75.5k
    // Assume that floating point arithmetic operations cost twice as much as
523
75.5k
    // integer operations.
524
75.5k
    unsigned OpCost = (IsFloat ? 
21.71k
:
173.8k
);
525
75.5k
526
75.5k
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
527
72.6k
      // The operation is legal. Assume it costs 1.
528
72.6k
      // TODO: Once we have extract/insert subvector cost we need to use them.
529
72.6k
      return LT.first * OpCost;
530
72.6k
    }
531
2.94k
532
2.94k
    if (!TLI->isOperationExpand(ISD, LT.second)) {
533
0
      // If the operation is custom lowered, then assume that the code is twice
534
0
      // as expensive.
535
0
      return LT.first * 2 * OpCost;
536
0
    }
537
2.94k
538
2.94k
    // Else, assume that we need to scalarize this op.
539
2.94k
    // TODO: If one of the types get legalized by splitting, handle this
540
2.94k
    // similarly to what getCastInstrCost() does.
541
2.94k
    if (Ty->isVectorTy()) {
542
54
      unsigned Num = Ty->getVectorNumElements();
543
54
      unsigned Cost = static_cast<T *>(this)
544
54
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
545
54
      // Return the cost of multiple scalar invocation plus the cost of
546
54
      // inserting and extracting the values.
547
54
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
548
54
    }
549
2.89k
550
2.89k
    // We don't know anything about this scalar instruction.
551
2.89k
    return OpCost;
552
2.89k
  }
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*>)
553
554
  unsigned getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index,
555
64.0k
                          Type *SubTp) {
556
64.0k
    switch (Kind) {
557
64.0k
    case TTI::SK_Select:
558
870
    case TTI::SK_Transpose:
559
870
    case TTI::SK_PermuteSingleSrc:
560
870
    case TTI::SK_PermuteTwoSrc:
561
870
      return getPermuteShuffleOverhead(Tp);
562
63.1k
    default:
563
63.1k
      return 1;
564
64.0k
    }
565
64.0k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
Line
Count
Source
555
60.8k
                          Type *SubTp) {
556
60.8k
    switch (Kind) {
557
60.8k
    case TTI::SK_Select:
558
694
    case TTI::SK_Transpose:
559
694
    case TTI::SK_PermuteSingleSrc:
560
694
    case TTI::SK_PermuteTwoSrc:
561
694
      return getPermuteShuffleOverhead(Tp);
562
60.1k
    default:
563
60.1k
      return 1;
564
60.8k
    }
565
60.8k
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
Line
Count
Source
555
81
                          Type *SubTp) {
556
81
    switch (Kind) {
557
81
    case TTI::SK_Select:
558
3
    case TTI::SK_Transpose:
559
3
    case TTI::SK_PermuteSingleSrc:
560
3
    case TTI::SK_PermuteTwoSrc:
561
3
      return getPermuteShuffleOverhead(Tp);
562
78
    default:
563
78
      return 1;
564
81
    }
565
81
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
Line
Count
Source
555
1.13k
                          Type *SubTp) {
556
1.13k
    switch (Kind) {
557
1.13k
    case TTI::SK_Select:
558
36
    case TTI::SK_Transpose:
559
36
    case TTI::SK_PermuteSingleSrc:
560
36
    case TTI::SK_PermuteTwoSrc:
561
36
      return getPermuteShuffleOverhead(Tp);
562
1.10k
    default:
563
1.10k
      return 1;
564
1.13k
    }
565
1.13k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::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
555
1.98k
                          Type *SubTp) {
556
1.98k
    switch (Kind) {
557
1.98k
    case TTI::SK_Select:
558
137
    case TTI::SK_Transpose:
559
137
    case TTI::SK_PermuteSingleSrc:
560
137
    case TTI::SK_PermuteTwoSrc:
561
137
      return getPermuteShuffleOverhead(Tp);
562
1.84k
    default:
563
1.84k
      return 1;
564
1.98k
    }
565
1.98k
  }
566
567
  unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
568
109k
                            const Instruction *I = nullptr) {
569
109k
    const TargetLoweringBase *TLI = getTLI();
570
109k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
571
109k
    assert(ISD && "Invalid opcode");
572
109k
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
573
109k
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
574
109k
575
109k
    // Check for NOOP conversions.
576
109k
    if (SrcLT.first == DstLT.first &&
577
109k
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()105k
) {
578
37.2k
579
37.2k
      // Bitcast between types that are legalized to the same type are free.
580
37.2k
      if (Opcode == Instruction::BitCast || 
Opcode == Instruction::Trunc25.3k
)
581
13.8k
        return 0;
582
96.1k
    }
583
96.1k
584
96.1k
    if (Opcode == Instruction::Trunc &&
585
96.1k
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)42.1k
)
586
23.7k
      return 0;
587
72.3k
588
72.3k
    if (Opcode == Instruction::ZExt &&
589
72.3k
        
TLI->isZExtFree(SrcLT.second, DstLT.second)17.7k
)
590
4.00k
      return 0;
591
68.3k
592
68.3k
    if (Opcode == Instruction::AddrSpaceCast &&
593
68.3k
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
594
12
                                 Dst->getPointerAddressSpace()))
595
3
      return 0;
596
68.3k
597
68.3k
    // If this is a zext/sext of a load, return 0 if the corresponding
598
68.3k
    // extending load exists on target.
599
68.3k
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt54.5k
) &&
600
68.3k
        
I26.6k
&&
isa<LoadInst>(I->getOperand(0))1.73k
) {
601
757
        EVT ExtVT = EVT::getEVT(Dst);
602
757
        EVT LoadVT = EVT::getEVT(Src);
603
757
        unsigned LType =
604
757
          ((Opcode == Instruction::ZExt) ? 
ISD::ZEXTLOAD522
:
ISD::SEXTLOAD235
);
605
757
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
606
524
          return 0;
607
67.8k
    }
608
67.8k
609
67.8k
    // If the cast is marked as legal (or promote) then assume low cost.
610
67.8k
    if (SrcLT.first == DstLT.first &&
611
67.8k
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)63.8k
)
612
60.6k
      return 1;
613
7.17k
614
7.17k
    // Handle scalar conversions.
615
7.17k
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()2.74k
) {
616
2.74k
      // Scalar bitcasts are usually free.
617
2.74k
      if (Opcode == Instruction::BitCast)
618
108
        return 0;
619
2.64k
620
2.64k
      // Just check the op cost. If the operation is legal then assume it costs
621
2.64k
      // 1.
622
2.64k
      if (!TLI->isOperationExpand(ISD, DstLT.second))
623
2.40k
        return 1;
624
235
625
235
      // Assume that illegal scalar instruction are expensive.
626
235
      return 4;
627
235
    }
628
4.42k
629
4.42k
    // Check vector-to-vector casts.
630
4.42k
    if (Dst->isVectorTy() && Src->isVectorTy()) {
631
4.42k
      // If the cast is between same-sized registers, then the check is simple.
632
4.42k
      if (SrcLT.first == DstLT.first &&
633
4.42k
          
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()1.50k
) {
634
1.28k
635
1.28k
        // Assume that Zext is done using AND.
636
1.28k
        if (Opcode == Instruction::ZExt)
637
636
          return 1;
638
652
639
652
        // Assume that sext is done using SHL and SRA.
640
652
        if (Opcode == Instruction::SExt)
641
69
          return 2;
642
583
643
583
        // Just check the op cost. If the operation is legal then assume it
644
583
        // costs
645
583
        // 1 and multiply by the type-legalization overhead.
646
583
        if (!TLI->isOperationExpand(ISD, DstLT.second))
647
12
          return SrcLT.first * 1;
648
3.71k
      }
649
3.71k
650
3.71k
      // If we are legalizing by splitting, query the concrete TTI for the cost
651
3.71k
      // of casting the original vector twice. We also need to factor in the
652
3.71k
      // cost of the split itself. Count that as 1, to be consistent with
653
3.71k
      // TLI->getTypeLegalizationCost().
654
3.71k
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
655
3.71k
           TargetLowering::TypeSplitVector) ||
656
3.71k
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
657
2.57k
           TargetLowering::TypeSplitVector)) {
658
2.57k
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
659
2.57k
                                         Dst->getVectorNumElements() / 2);
660
2.57k
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
661
2.57k
                                         Src->getVectorNumElements() / 2);
662
2.57k
        T *TTI = static_cast<T *>(this);
663
2.57k
        return TTI->getVectorSplitCost() +
664
2.57k
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
665
2.57k
      }
666
1.13k
667
1.13k
      // In other cases where the source or destination are illegal, assume
668
1.13k
      // the operation will get scalarized.
669
1.13k
      unsigned Num = Dst->getVectorNumElements();
670
1.13k
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
671
1.13k
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
672
1.13k
673
1.13k
      // Return the cost of multiple scalar invocation plus the cost of
674
1.13k
      // inserting and extracting the values.
675
1.13k
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
676
1.13k
    }
677
0
678
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
679
0
    // This
680
0
    // is where we handle bitcast between vectors and scalars. We need to assume
681
0
    //  that the conversion is scalarized in one way or another.
682
0
    if (Opcode == Instruction::BitCast)
683
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
684
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
685
0
                                : 0) +
686
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
687
0
                                : 0);
688
0
689
0
    llvm_unreachable("Unhandled cast");
690
0
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
568
98.7k
                            const Instruction *I = nullptr) {
569
98.7k
    const TargetLoweringBase *TLI = getTLI();
570
98.7k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
571
98.7k
    assert(ISD && "Invalid opcode");
572
98.7k
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
573
98.7k
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
574
98.7k
575
98.7k
    // Check for NOOP conversions.
576
98.7k
    if (SrcLT.first == DstLT.first &&
577
98.7k
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()97.2k
) {
578
31.6k
579
31.6k
      // Bitcast between types that are legalized to the same type are free.
580
31.6k
      if (Opcode == Instruction::BitCast || 
Opcode == Instruction::Trunc21.1k
)
581
12.1k
        return 0;
582
86.5k
    }
583
86.5k
584
86.5k
    if (Opcode == Instruction::Trunc &&
585
86.5k
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)39.8k
)
586
23.2k
      return 0;
587
63.3k
588
63.3k
    if (Opcode == Instruction::ZExt &&
589
63.3k
        
TLI->isZExtFree(SrcLT.second, DstLT.second)15.8k
)
590
3.78k
      return 0;
591
59.5k
592
59.5k
    if (Opcode == Instruction::AddrSpaceCast &&
593
59.5k
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
594
0
                                 Dst->getPointerAddressSpace()))
595
0
      return 0;
596
59.5k
597
59.5k
    // If this is a zext/sext of a load, return 0 if the corresponding
598
59.5k
    // extending load exists on target.
599
59.5k
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt47.5k
) &&
600
59.5k
        
I24.4k
&&
isa<LoadInst>(I->getOperand(0))0
) {
601
0
        EVT ExtVT = EVT::getEVT(Dst);
602
0
        EVT LoadVT = EVT::getEVT(Src);
603
0
        unsigned LType =
604
0
          ((Opcode == Instruction::ZExt) ? ISD::ZEXTLOAD : ISD::SEXTLOAD);
605
0
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
606
0
          return 0;
607
59.5k
    }
608
59.5k
609
59.5k
    // If the cast is marked as legal (or promote) then assume low cost.
610
59.5k
    if (SrcLT.first == DstLT.first &&
611
59.5k
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)58.1k
)
612
56.9k
      return 1;
613
2.60k
614
2.60k
    // Handle scalar conversions.
615
2.60k
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()1.17k
) {
616
1.17k
      // Scalar bitcasts are usually free.
617
1.17k
      if (Opcode == Instruction::BitCast)
618
0
        return 0;
619
1.17k
620
1.17k
      // Just check the op cost. If the operation is legal then assume it costs
621
1.17k
      // 1.
622
1.17k
      if (!TLI->isOperationExpand(ISD, DstLT.second))
623
1.17k
        return 1;
624
0
625
0
      // Assume that illegal scalar instruction are expensive.
626
0
      return 4;
627
0
    }
628
1.42k
629
1.42k
    // Check vector-to-vector casts.
630
1.42k
    if (Dst->isVectorTy() && Src->isVectorTy()) {
631
1.42k
      // If the cast is between same-sized registers, then the check is simple.
632
1.42k
      if (SrcLT.first == DstLT.first &&
633
1.42k
          
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()0
) {
634
0
635
0
        // Assume that Zext is done using AND.
636
0
        if (Opcode == Instruction::ZExt)
637
0
          return 1;
638
0
639
0
        // Assume that sext is done using SHL and SRA.
640
0
        if (Opcode == Instruction::SExt)
641
0
          return 2;
642
0
643
0
        // Just check the op cost. If the operation is legal then assume it
644
0
        // costs
645
0
        // 1 and multiply by the type-legalization overhead.
646
0
        if (!TLI->isOperationExpand(ISD, DstLT.second))
647
0
          return SrcLT.first * 1;
648
1.42k
      }
649
1.42k
650
1.42k
      // If we are legalizing by splitting, query the concrete TTI for the cost
651
1.42k
      // of casting the original vector twice. We also need to factor in the
652
1.42k
      // cost of the split itself. Count that as 1, to be consistent with
653
1.42k
      // TLI->getTypeLegalizationCost().
654
1.42k
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
655
1.42k
           TargetLowering::TypeSplitVector) ||
656
1.42k
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
657
1.38k
           TargetLowering::TypeSplitVector)) {
658
1.38k
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
659
1.38k
                                         Dst->getVectorNumElements() / 2);
660
1.38k
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
661
1.38k
                                         Src->getVectorNumElements() / 2);
662
1.38k
        T *TTI = static_cast<T *>(this);
663
1.38k
        return TTI->getVectorSplitCost() +
664
1.38k
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
665
1.38k
      }
666
36
667
36
      // In other cases where the source or destination are illegal, assume
668
36
      // the operation will get scalarized.
669
36
      unsigned Num = Dst->getVectorNumElements();
670
36
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
671
36
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
672
36
673
36
      // Return the cost of multiple scalar invocation plus the cost of
674
36
      // inserting and extracting the values.
675
36
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
676
36
    }
677
0
678
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
679
0
    // This
680
0
    // is where we handle bitcast between vectors and scalars. We need to assume
681
0
    //  that the conversion is scalarized in one way or another.
682
0
    if (Opcode == Instruction::BitCast)
683
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
684
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
685
0
                                : 0) +
686
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
687
0
                                : 0);
688
0
689
0
    llvm_unreachable("Unhandled cast");
690
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
568
16
                            const Instruction *I = nullptr) {
569
16
    const TargetLoweringBase *TLI = getTLI();
570
16
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
571
16
    assert(ISD && "Invalid opcode");
572
16
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
573
16
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
574
16
575
16
    // Check for NOOP conversions.
576
16
    if (SrcLT.first == DstLT.first &&
577
16
        SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()) {
578
12
579
12
      // Bitcast between types that are legalized to the same type are free.
580
12
      if (Opcode == Instruction::BitCast || Opcode == Instruction::Trunc)
581
0
        return 0;
582
16
    }
583
16
584
16
    if (Opcode == Instruction::Trunc &&
585
16
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)2
)
586
2
      return 0;
587
14
588
14
    if (Opcode == Instruction::ZExt &&
589
14
        
TLI->isZExtFree(SrcLT.second, DstLT.second)2
)
590
2
      return 0;
591
12
592
12
    if (Opcode == Instruction::AddrSpaceCast &&
593
12
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
594
12
                                 Dst->getPointerAddressSpace()))
595
3
      return 0;
596
9
597
9
    // If this is a zext/sext of a load, return 0 if the corresponding
598
9
    // extending load exists on target.
599
9
    if ((Opcode == Instruction::ZExt || Opcode == Instruction::SExt) &&
600
9
        
I0
&&
isa<LoadInst>(I->getOperand(0))0
) {
601
0
        EVT ExtVT = EVT::getEVT(Dst);
602
0
        EVT LoadVT = EVT::getEVT(Src);
603
0
        unsigned LType =
604
0
          ((Opcode == Instruction::ZExt) ? ISD::ZEXTLOAD : ISD::SEXTLOAD);
605
0
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
606
0
          return 0;
607
9
    }
608
9
609
9
    // If the cast is marked as legal (or promote) then assume low cost.
610
9
    if (SrcLT.first == DstLT.first &&
611
9
        TLI->isOperationLegalOrPromote(ISD, DstLT.second))
612
0
      return 1;
613
9
614
9
    // Handle scalar conversions.
615
9
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()3
) {
616
3
      // Scalar bitcasts are usually free.
617
3
      if (Opcode == Instruction::BitCast)
618
0
        return 0;
619
3
620
3
      // Just check the op cost. If the operation is legal then assume it costs
621
3
      // 1.
622
3
      if (!TLI->isOperationExpand(ISD, DstLT.second))
623
3
        return 1;
624
0
625
0
      // Assume that illegal scalar instruction are expensive.
626
0
      return 4;
627
0
    }
628
6
629
6
    // Check vector-to-vector casts.
630
6
    if (Dst->isVectorTy() && Src->isVectorTy()) {
631
6
      // If the cast is between same-sized registers, then the check is simple.
632
6
      if (SrcLT.first == DstLT.first &&
633
6
          SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()) {
634
6
635
6
        // Assume that Zext is done using AND.
636
6
        if (Opcode == Instruction::ZExt)
637
0
          return 1;
638
6
639
6
        // Assume that sext is done using SHL and SRA.
640
6
        if (Opcode == Instruction::SExt)
641
0
          return 2;
642
6
643
6
        // Just check the op cost. If the operation is legal then assume it
644
6
        // costs
645
6
        // 1 and multiply by the type-legalization overhead.
646
6
        if (!TLI->isOperationExpand(ISD, DstLT.second))
647
0
          return SrcLT.first * 1;
648
6
      }
649
6
650
6
      // If we are legalizing by splitting, query the concrete TTI for the cost
651
6
      // of casting the original vector twice. We also need to factor in the
652
6
      // cost of the split itself. Count that as 1, to be consistent with
653
6
      // TLI->getTypeLegalizationCost().
654
6
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
655
6
           TargetLowering::TypeSplitVector) ||
656
6
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
657
4
           TargetLowering::TypeSplitVector)) {
658
4
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
659
4
                                         Dst->getVectorNumElements() / 2);
660
4
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
661
4
                                         Src->getVectorNumElements() / 2);
662
4
        T *TTI = static_cast<T *>(this);
663
4
        return TTI->getVectorSplitCost() +
664
4
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
665
4
      }
666
2
667
2
      // In other cases where the source or destination are illegal, assume
668
2
      // the operation will get scalarized.
669
2
      unsigned Num = Dst->getVectorNumElements();
670
2
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
671
2
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
672
2
673
2
      // Return the cost of multiple scalar invocation plus the cost of
674
2
      // inserting and extracting the values.
675
2
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
676
2
    }
677
0
678
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
679
0
    // This
680
0
    // is where we handle bitcast between vectors and scalars. We need to assume
681
0
    //  that the conversion is scalarized in one way or another.
682
0
    if (Opcode == Instruction::BitCast)
683
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
684
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
685
0
                                : 0) +
686
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
687
0
                                : 0);
688
0
689
0
    llvm_unreachable("Unhandled cast");
690
0
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
568
1.23k
                            const Instruction *I = nullptr) {
569
1.23k
    const TargetLoweringBase *TLI = getTLI();
570
1.23k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
571
1.23k
    assert(ISD && "Invalid opcode");
572
1.23k
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
573
1.23k
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
574
1.23k
575
1.23k
    // Check for NOOP conversions.
576
1.23k
    if (SrcLT.first == DstLT.first &&
577
1.23k
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()883
) {
578
633
579
633
      // Bitcast between types that are legalized to the same type are free.
580
633
      if (Opcode == Instruction::BitCast || 
Opcode == Instruction::Trunc278
)
581
367
        return 0;
582
871
    }
583
871
584
871
    if (Opcode == Instruction::Trunc &&
585
871
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)168
)
586
0
      return 0;
587
871
588
871
    if (Opcode == Instruction::ZExt &&
589
871
        
TLI->isZExtFree(SrcLT.second, DstLT.second)240
)
590
0
      return 0;
591
871
592
871
    if (Opcode == Instruction::AddrSpaceCast &&
593
871
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
594
0
                                 Dst->getPointerAddressSpace()))
595
0
      return 0;
596
871
597
871
    // If this is a zext/sext of a load, return 0 if the corresponding
598
871
    // extending load exists on target.
599
871
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt631
) &&
600
871
        
I317
&&
isa<LoadInst>(I->getOperand(0))0
) {
601
0
        EVT ExtVT = EVT::getEVT(Dst);
602
0
        EVT LoadVT = EVT::getEVT(Src);
603
0
        unsigned LType =
604
0
          ((Opcode == Instruction::ZExt) ? ISD::ZEXTLOAD : ISD::SEXTLOAD);
605
0
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
606
0
          return 0;
607
871
    }
608
871
609
871
    // If the cast is marked as legal (or promote) then assume low cost.
610
871
    if (SrcLT.first == DstLT.first &&
611
871
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)516
)
612
372
      return 1;
613
499
614
499
    // Handle scalar conversions.
615
499
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()145
) {
616
145
      // Scalar bitcasts are usually free.
617
145
      if (Opcode == Instruction::BitCast)
618
82
        return 0;
619
63
620
63
      // Just check the op cost. If the operation is legal then assume it costs
621
63
      // 1.
622
63
      if (!TLI->isOperationExpand(ISD, DstLT.second))
623
63
        return 1;
624
0
625
0
      // Assume that illegal scalar instruction are expensive.
626
0
      return 4;
627
0
    }
628
354
629
354
    // Check vector-to-vector casts.
630
354
    if (Dst->isVectorTy() && Src->isVectorTy()) {
631
354
      // If the cast is between same-sized registers, then the check is simple.
632
354
      if (SrcLT.first == DstLT.first &&
633
354
          
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()144
) {
634
66
635
66
        // Assume that Zext is done using AND.
636
66
        if (Opcode == Instruction::ZExt)
637
0
          return 1;
638
66
639
66
        // Assume that sext is done using SHL and SRA.
640
66
        if (Opcode == Instruction::SExt)
641
0
          return 2;
642
66
643
66
        // Just check the op cost. If the operation is legal then assume it
644
66
        // costs
645
66
        // 1 and multiply by the type-legalization overhead.
646
66
        if (!TLI->isOperationExpand(ISD, DstLT.second))
647
12
          return SrcLT.first * 1;
648
342
      }
649
342
650
342
      // If we are legalizing by splitting, query the concrete TTI for the cost
651
342
      // of casting the original vector twice. We also need to factor in the
652
342
      // cost of the split itself. Count that as 1, to be consistent with
653
342
      // TLI->getTypeLegalizationCost().
654
342
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
655
342
           TargetLowering::TypeSplitVector) ||
656
342
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
657
228
           TargetLowering::TypeSplitVector)) {
658
228
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
659
228
                                         Dst->getVectorNumElements() / 2);
660
228
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
661
228
                                         Src->getVectorNumElements() / 2);
662
228
        T *TTI = static_cast<T *>(this);
663
228
        return TTI->getVectorSplitCost() +
664
228
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
665
228
      }
666
114
667
114
      // In other cases where the source or destination are illegal, assume
668
114
      // the operation will get scalarized.
669
114
      unsigned Num = Dst->getVectorNumElements();
670
114
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
671
114
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
672
114
673
114
      // Return the cost of multiple scalar invocation plus the cost of
674
114
      // inserting and extracting the values.
675
114
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
676
114
    }
677
0
678
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
679
0
    // This
680
0
    // is where we handle bitcast between vectors and scalars. We need to assume
681
0
    //  that the conversion is scalarized in one way or another.
682
0
    if (Opcode == Instruction::BitCast)
683
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
684
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
685
0
                                : 0) +
686
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
687
0
                                : 0);
688
0
689
0
    llvm_unreachable("Unhandled cast");
690
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
568
35
                            const Instruction *I = nullptr) {
569
35
    const TargetLoweringBase *TLI = getTLI();
570
35
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
571
35
    assert(ISD && "Invalid opcode");
572
35
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
573
35
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
574
35
575
35
    // Check for NOOP conversions.
576
35
    if (SrcLT.first == DstLT.first &&
577
35
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()34
) {
578
22
579
22
      // Bitcast between types that are legalized to the same type are free.
580
22
      if (Opcode == Instruction::BitCast || Opcode == Instruction::Trunc)
581
0
        return 0;
582
35
    }
583
35
584
35
    if (Opcode == Instruction::Trunc &&
585
35
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)8
)
586
8
      return 0;
587
27
588
27
    if (Opcode == Instruction::ZExt &&
589
27
        
TLI->isZExtFree(SrcLT.second, DstLT.second)12
)
590
0
      return 0;
591
27
592
27
    if (Opcode == Instruction::AddrSpaceCast &&
593
27
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
594
0
                                 Dst->getPointerAddressSpace()))
595
0
      return 0;
596
27
597
27
    // If this is a zext/sext of a load, return 0 if the corresponding
598
27
    // extending load exists on target.
599
27
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt15
) &&
600
27
        
I17
&&
isa<LoadInst>(I->getOperand(0))0
) {
601
0
        EVT ExtVT = EVT::getEVT(Dst);
602
0
        EVT LoadVT = EVT::getEVT(Src);
603
0
        unsigned LType =
604
0
          ((Opcode == Instruction::ZExt) ? ISD::ZEXTLOAD : ISD::SEXTLOAD);
605
0
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
606
0
          return 0;
607
27
    }
608
27
609
27
    // If the cast is marked as legal (or promote) then assume low cost.
610
27
    if (SrcLT.first == DstLT.first &&
611
27
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)26
)
612
26
      return 1;
613
1
614
1
    // Handle scalar conversions.
615
1
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()0
) {
616
0
      // Scalar bitcasts are usually free.
617
0
      if (Opcode == Instruction::BitCast)
618
0
        return 0;
619
0
620
0
      // Just check the op cost. If the operation is legal then assume it costs
621
0
      // 1.
622
0
      if (!TLI->isOperationExpand(ISD, DstLT.second))
623
0
        return 1;
624
0
625
0
      // Assume that illegal scalar instruction are expensive.
626
0
      return 4;
627
0
    }
628
1
629
1
    // Check vector-to-vector casts.
630
1
    if (Dst->isVectorTy() && Src->isVectorTy()) {
631
1
      // If the cast is between same-sized registers, then the check is simple.
632
1
      if (SrcLT.first == DstLT.first &&
633
1
          
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()0
) {
634
0
635
0
        // Assume that Zext is done using AND.
636
0
        if (Opcode == Instruction::ZExt)
637
0
          return 1;
638
0
639
0
        // Assume that sext is done using SHL and SRA.
640
0
        if (Opcode == Instruction::SExt)
641
0
          return 2;
642
0
643
0
        // Just check the op cost. If the operation is legal then assume it
644
0
        // costs
645
0
        // 1 and multiply by the type-legalization overhead.
646
0
        if (!TLI->isOperationExpand(ISD, DstLT.second))
647
0
          return SrcLT.first * 1;
648
1
      }
649
1
650
1
      // If we are legalizing by splitting, query the concrete TTI for the cost
651
1
      // of casting the original vector twice. We also need to factor in the
652
1
      // cost of the split itself. Count that as 1, to be consistent with
653
1
      // TLI->getTypeLegalizationCost().
654
1
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
655
1
           TargetLowering::TypeSplitVector) ||
656
1
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
657
1
           TargetLowering::TypeSplitVector)) {
658
1
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
659
1
                                         Dst->getVectorNumElements() / 2);
660
1
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
661
1
                                         Src->getVectorNumElements() / 2);
662
1
        T *TTI = static_cast<T *>(this);
663
1
        return TTI->getVectorSplitCost() +
664
1
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
665
1
      }
666
0
667
0
      // In other cases where the source or destination are illegal, assume
668
0
      // the operation will get scalarized.
669
0
      unsigned Num = Dst->getVectorNumElements();
670
0
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
671
0
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
672
0
673
0
      // Return the cost of multiple scalar invocation plus the cost of
674
0
      // inserting and extracting the values.
675
0
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
676
0
    }
677
0
678
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
679
0
    // This
680
0
    // is where we handle bitcast between vectors and scalars. We need to assume
681
0
    //  that the conversion is scalarized in one way or another.
682
0
    if (Opcode == Instruction::BitCast)
683
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
684
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
685
0
                                : 0) +
686
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
687
0
                                : 0);
688
0
689
0
    llvm_unreachable("Unhandled cast");
690
0
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
568
143
                            const Instruction *I = nullptr) {
569
143
    const TargetLoweringBase *TLI = getTLI();
570
143
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
571
143
    assert(ISD && "Invalid opcode");
572
143
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
573
143
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
574
143
575
143
    // Check for NOOP conversions.
576
143
    if (SrcLT.first == DstLT.first &&
577
143
        SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()) {
578
48
579
48
      // Bitcast between types that are legalized to the same type are free.
580
48
      if (Opcode == Instruction::BitCast || Opcode == Instruction::Trunc)
581
4
        return 0;
582
139
    }
583
139
584
139
    if (Opcode == Instruction::Trunc &&
585
139
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)5
)
586
5
      return 0;
587
134
588
134
    if (Opcode == Instruction::ZExt &&
589
134
        
TLI->isZExtFree(SrcLT.second, DstLT.second)12
)
590
0
      return 0;
591
134
592
134
    if (Opcode == Instruction::AddrSpaceCast &&
593
134
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
594
0
                                 Dst->getPointerAddressSpace()))
595
0
      return 0;
596
134
597
134
    // If this is a zext/sext of a load, return 0 if the corresponding
598
134
    // extending load exists on target.
599
134
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt122
) &&
600
134
        
I24
&&
isa<LoadInst>(I->getOperand(0))24
) {
601
12
        EVT ExtVT = EVT::getEVT(Dst);
602
12
        EVT LoadVT = EVT::getEVT(Src);
603
12
        unsigned LType =
604
12
          ((Opcode == Instruction::ZExt) ? 
ISD::ZEXTLOAD6
:
ISD::SEXTLOAD6
);
605
12
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
606
12
          return 0;
607
122
    }
608
122
609
122
    // If the cast is marked as legal (or promote) then assume low cost.
610
122
    if (SrcLT.first == DstLT.first &&
611
122
        TLI->isOperationLegalOrPromote(ISD, DstLT.second))
612
122
      return 1;
613
0
614
0
    // Handle scalar conversions.
615
0
    if (!Src->isVectorTy() && !Dst->isVectorTy()) {
616
0
      // Scalar bitcasts are usually free.
617
0
      if (Opcode == Instruction::BitCast)
618
0
        return 0;
619
0
620
0
      // Just check the op cost. If the operation is legal then assume it costs
621
0
      // 1.
622
0
      if (!TLI->isOperationExpand(ISD, DstLT.second))
623
0
        return 1;
624
0
625
0
      // Assume that illegal scalar instruction are expensive.
626
0
      return 4;
627
0
    }
628
0
629
0
    // Check vector-to-vector casts.
630
0
    if (Dst->isVectorTy() && Src->isVectorTy()) {
631
0
      // If the cast is between same-sized registers, then the check is simple.
632
0
      if (SrcLT.first == DstLT.first &&
633
0
          SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()) {
634
0
635
0
        // Assume that Zext is done using AND.
636
0
        if (Opcode == Instruction::ZExt)
637
0
          return 1;
638
0
639
0
        // Assume that sext is done using SHL and SRA.
640
0
        if (Opcode == Instruction::SExt)
641
0
          return 2;
642
0
643
0
        // Just check the op cost. If the operation is legal then assume it
644
0
        // costs
645
0
        // 1 and multiply by the type-legalization overhead.
646
0
        if (!TLI->isOperationExpand(ISD, DstLT.second))
647
0
          return SrcLT.first * 1;
648
0
      }
649
0
650
0
      // If we are legalizing by splitting, query the concrete TTI for the cost
651
0
      // of casting the original vector twice. We also need to factor in the
652
0
      // cost of the split itself. Count that as 1, to be consistent with
653
0
      // TLI->getTypeLegalizationCost().
654
0
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
655
0
           TargetLowering::TypeSplitVector) ||
656
0
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
657
0
           TargetLowering::TypeSplitVector)) {
658
0
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
659
0
                                         Dst->getVectorNumElements() / 2);
660
0
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
661
0
                                         Src->getVectorNumElements() / 2);
662
0
        T *TTI = static_cast<T *>(this);
663
0
        return TTI->getVectorSplitCost() +
664
0
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
665
0
      }
666
0
667
0
      // In other cases where the source or destination are illegal, assume
668
0
      // the operation will get scalarized.
669
0
      unsigned Num = Dst->getVectorNumElements();
670
0
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
671
0
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
672
0
673
0
      // Return the cost of multiple scalar invocation plus the cost of
674
0
      // inserting and extracting the values.
675
0
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
676
0
    }
677
0
678
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
679
0
    // This
680
0
    // is where we handle bitcast between vectors and scalars. We need to assume
681
0
    //  that the conversion is scalarized in one way or another.
682
0
    if (Opcode == Instruction::BitCast)
683
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
684
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
685
0
                                : 0) +
686
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
687
0
                                : 0);
688
0
689
0
    llvm_unreachable("Unhandled cast");
690
0
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
568
9.84k
                            const Instruction *I = nullptr) {
569
9.84k
    const TargetLoweringBase *TLI = getTLI();
570
9.84k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
571
9.84k
    assert(ISD && "Invalid opcode");
572
9.84k
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
573
9.84k
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
574
9.84k
575
9.84k
    // Check for NOOP conversions.
576
9.84k
    if (SrcLT.first == DstLT.first &&
577
9.84k
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()7.67k
) {
578
4.79k
579
4.79k
      // Bitcast between types that are legalized to the same type are free.
580
4.79k
      if (Opcode == Instruction::BitCast || 
Opcode == Instruction::Trunc3.80k
)
581
1.37k
        return 0;
582
8.47k
    }
583
8.47k
584
8.47k
    if (Opcode == Instruction::Trunc &&
585
8.47k
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)2.12k
)
586
540
      return 0;
587
7.93k
588
7.93k
    if (Opcode == Instruction::ZExt &&
589
7.93k
        
TLI->isZExtFree(SrcLT.second, DstLT.second)1.71k
)
590
219
      return 0;
591
7.71k
592
7.71k
    if (Opcode == Instruction::AddrSpaceCast &&
593
7.71k
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
594
0
                                 Dst->getPointerAddressSpace()))
595
0
      return 0;
596
7.71k
597
7.71k
    // If this is a zext/sext of a load, return 0 if the corresponding
598
7.71k
    // extending load exists on target.
599
7.71k
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt6.22k
) &&
600
7.71k
        
I1.84k
&&
isa<LoadInst>(I->getOperand(0))1.71k
) {
601
745
        EVT ExtVT = EVT::getEVT(Dst);
602
745
        EVT LoadVT = EVT::getEVT(Src);
603
745
        unsigned LType =
604
745
          ((Opcode == Instruction::ZExt) ? 
ISD::ZEXTLOAD516
:
ISD::SEXTLOAD229
);
605
745
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
606
512
          return 0;
607
7.20k
    }
608
7.20k
609
7.20k
    // If the cast is marked as legal (or promote) then assume low cost.
610
7.20k
    if (SrcLT.first == DstLT.first &&
611
7.20k
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)5.05k
)
612
3.13k
      return 1;
613
4.06k
614
4.06k
    // Handle scalar conversions.
615
4.06k
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()1.42k
) {
616
1.42k
      // Scalar bitcasts are usually free.
617
1.42k
      if (Opcode == Instruction::BitCast)
618
26
        return 0;
619
1.39k
620
1.39k
      // Just check the op cost. If the operation is legal then assume it costs
621
1.39k
      // 1.
622
1.39k
      if (!TLI->isOperationExpand(ISD, DstLT.second))
623
1.16k
        return 1;
624
235
625
235
      // Assume that illegal scalar instruction are expensive.
626
235
      return 4;
627
235
    }
628
2.64k
629
2.64k
    // Check vector-to-vector casts.
630
2.64k
    if (Dst->isVectorTy() && Src->isVectorTy()) {
631
2.64k
      // If the cast is between same-sized registers, then the check is simple.
632
2.64k
      if (SrcLT.first == DstLT.first &&
633
2.64k
          
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()1.35k
) {
634
1.21k
635
1.21k
        // Assume that Zext is done using AND.
636
1.21k
        if (Opcode == Instruction::ZExt)
637
636
          return 1;
638
580
639
580
        // Assume that sext is done using SHL and SRA.
640
580
        if (Opcode == Instruction::SExt)
641
69
          return 2;
642
511
643
511
        // Just check the op cost. If the operation is legal then assume it
644
511
        // costs
645
511
        // 1 and multiply by the type-legalization overhead.
646
511
        if (!TLI->isOperationExpand(ISD, DstLT.second))
647
0
          return SrcLT.first * 1;
648
1.93k
      }
649
1.93k
650
1.93k
      // If we are legalizing by splitting, query the concrete TTI for the cost
651
1.93k
      // of casting the original vector twice. We also need to factor in the
652
1.93k
      // cost of the split itself. Count that as 1, to be consistent with
653
1.93k
      // TLI->getTypeLegalizationCost().
654
1.93k
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
655
1.93k
           TargetLowering::TypeSplitVector) ||
656
1.93k
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
657
1.13k
           TargetLowering::TypeSplitVector)) {
658
958
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
659
958
                                         Dst->getVectorNumElements() / 2);
660
958
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
661
958
                                         Src->getVectorNumElements() / 2);
662
958
        T *TTI = static_cast<T *>(this);
663
958
        return TTI->getVectorSplitCost() +
664
958
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
665
958
      }
666
981
667
981
      // In other cases where the source or destination are illegal, assume
668
981
      // the operation will get scalarized.
669
981
      unsigned Num = Dst->getVectorNumElements();
670
981
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
671
981
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
672
981
673
981
      // Return the cost of multiple scalar invocation plus the cost of
674
981
      // inserting and extracting the values.
675
981
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
676
981
    }
677
0
678
0
    // We already handled vector-to-vector and scalar-to-scalar conversions.
679
0
    // This
680
0
    // is where we handle bitcast between vectors and scalars. We need to assume
681
0
    //  that the conversion is scalarized in one way or another.
682
0
    if (Opcode == Instruction::BitCast)
683
0
      // Illegal bitcasts are done by storing and loading from a stack slot.
684
0
      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
685
0
                                : 0) +
686
0
             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
687
0
                                : 0);
688
0
689
0
    llvm_unreachable("Unhandled cast");
690
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
691
692
  unsigned getExtractWithExtendCost(unsigned Opcode, Type *Dst,
693
8
                                    VectorType *VecTy, unsigned Index) {
694
8
    return static_cast<T *>(this)->getVectorInstrCost(
695
8
               Instruction::ExtractElement, VecTy, Index) +
696
8
           static_cast<T *>(this)->getCastInstrCost(Opcode, Dst,
697
8
                                                    VecTy->getElementType());
698
8
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
Line
Count
Source
693
8
                                    VectorType *VecTy, unsigned Index) {
694
8
    return static_cast<T *>(this)->getVectorInstrCost(
695
8
               Instruction::ExtractElement, VecTy, Index) +
696
8
           static_cast<T *>(this)->getCastInstrCost(Opcode, Dst,
697
8
                                                    VecTy->getElementType());
698
8
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getExtractWithExtendCost(unsigned int, llvm::Type*, llvm::VectorType*, unsigned int)
699
700
127k
  unsigned getCFInstrCost(unsigned Opcode) {
701
127k
    // Branches are assumed to be predicted.
702
127k
    return 0;
703
127k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getCFInstrCost(unsigned int)
Line
Count
Source
700
107k
  unsigned getCFInstrCost(unsigned Opcode) {
701
107k
    // Branches are assumed to be predicted.
702
107k
    return 0;
703
107k
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getCFInstrCost(unsigned int)
Line
Count
Source
700
17
  unsigned getCFInstrCost(unsigned Opcode) {
701
17
    // Branches are assumed to be predicted.
702
17
    return 0;
703
17
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getCFInstrCost(unsigned int)
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getCFInstrCost(unsigned int)
Line
Count
Source
700
3.33k
  unsigned getCFInstrCost(unsigned Opcode) {
701
3.33k
    // Branches are assumed to be predicted.
702
3.33k
    return 0;
703
3.33k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getCFInstrCost(unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getCFInstrCost(unsigned int)
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getCFInstrCost(unsigned int)
Line
Count
Source
700
6
  unsigned getCFInstrCost(unsigned Opcode) {
701
6
    // Branches are assumed to be predicted.
702
6
    return 0;
703
6
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getCFInstrCost(unsigned int)
Line
Count
Source
700
143
  unsigned getCFInstrCost(unsigned Opcode) {
701
143
    // Branches are assumed to be predicted.
702
143
    return 0;
703
143
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getCFInstrCost(unsigned int)
Line
Count
Source
700
771
  unsigned getCFInstrCost(unsigned Opcode) {
701
771
    // Branches are assumed to be predicted.
702
771
    return 0;
703
771
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getCFInstrCost(unsigned int)
Line
Count
Source
700
15.6k
  unsigned getCFInstrCost(unsigned Opcode) {
701
15.6k
    // Branches are assumed to be predicted.
702
15.6k
    return 0;
703
15.6k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getCFInstrCost(unsigned int)
704
705
  unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
706
194k
                              const Instruction *I) {
707
194k
    const TargetLoweringBase *TLI = getTLI();
708
194k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
709
194k
    assert(ISD && "Invalid opcode");
710
194k
711
194k
    // Selects on vectors are actually vector selects.
712
194k
    if (ISD == ISD::SELECT) {
713
73.5k
      assert(CondTy && "CondTy must exist");
714
73.5k
      if (CondTy->isVectorTy())
715
27.3k
        ISD = ISD::VSELECT;
716
73.5k
    }
717
194k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
718
194k
719
194k
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()62.5k
) &&
720
194k
        
!TLI->isOperationExpand(ISD, LT.second)194k
) {
721
167k
      // The operation is legal. Assume it costs 1. Multiply
722
167k
      // by the type-legalization overhead.
723
167k
      return LT.first * 1;
724
167k
    }
725
26.5k
726
26.5k
    // Otherwise, assume that the cast is scalarized.
727
26.5k
    // TODO: If one of the types get legalized by splitting, handle this
728
26.5k
    // similarly to what getCastInstrCost() does.
729
26.5k
    if (ValTy->isVectorTy()) {
730
24.2k
      unsigned Num = ValTy->getVectorNumElements();
731
24.2k
      if (CondTy)
732
24.2k
        CondTy = CondTy->getScalarType();
733
24.2k
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
734
24.2k
          Opcode, ValTy->getScalarType(), CondTy, I);
735
24.2k
736
24.2k
      // Return the cost of multiple scalar invocation plus the cost of
737
24.2k
      // inserting and extracting the values.
738
24.2k
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
739
24.2k
    }
740
2.32k
741
2.32k
    // Unknown scalar opcode.
742
2.32k
    return 1;
743
2.32k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
706
173k
                              const Instruction *I) {
707
173k
    const TargetLoweringBase *TLI = getTLI();
708
173k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
709
173k
    assert(ISD && "Invalid opcode");
710
173k
711
173k
    // Selects on vectors are actually vector selects.
712
173k
    if (ISD == ISD::SELECT) {
713
66.5k
      assert(CondTy && "CondTy must exist");
714
66.5k
      if (CondTy->isVectorTy())
715
23.2k
        ISD = ISD::VSELECT;
716
66.5k
    }
717
173k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
718
173k
719
173k
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()55.7k
) &&
720
173k
        
!TLI->isOperationExpand(ISD, LT.second)173k
) {
721
151k
      // The operation is legal. Assume it costs 1. Multiply
722
151k
      // by the type-legalization overhead.
723
151k
      return LT.first * 1;
724
151k
    }
725
22.0k
726
22.0k
    // Otherwise, assume that the cast is scalarized.
727
22.0k
    // TODO: If one of the types get legalized by splitting, handle this
728
22.0k
    // similarly to what getCastInstrCost() does.
729
22.0k
    if (ValTy->isVectorTy()) {
730
22.0k
      unsigned Num = ValTy->getVectorNumElements();
731
22.0k
      if (CondTy)
732
22.0k
        CondTy = CondTy->getScalarType();
733
22.0k
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
734
22.0k
          Opcode, ValTy->getScalarType(), CondTy, I);
735
22.0k
736
22.0k
      // Return the cost of multiple scalar invocation plus the cost of
737
22.0k
      // inserting and extracting the values.
738
22.0k
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
739
22.0k
    }
740
0
741
0
    // Unknown scalar opcode.
742
0
    return 1;
743
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
706
256
                              const Instruction *I) {
707
256
    const TargetLoweringBase *TLI = getTLI();
708
256
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
709
256
    assert(ISD && "Invalid opcode");
710
256
711
256
    // Selects on vectors are actually vector selects.
712
256
    if (ISD == ISD::SELECT) {
713
138
      assert(CondTy && "CondTy must exist");
714
138
      if (CondTy->isVectorTy())
715
44
        ISD = ISD::VSELECT;
716
138
    }
717
256
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
718
256
719
256
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()88
) &&
720
256
        !TLI->isOperationExpand(ISD, LT.second)) {
721
168
      // The operation is legal. Assume it costs 1. Multiply
722
168
      // by the type-legalization overhead.
723
168
      return LT.first * 1;
724
168
    }
725
88
726
88
    // Otherwise, assume that the cast is scalarized.
727
88
    // TODO: If one of the types get legalized by splitting, handle this
728
88
    // similarly to what getCastInstrCost() does.
729
88
    if (ValTy->isVectorTy()) {
730
88
      unsigned Num = ValTy->getVectorNumElements();
731
88
      if (CondTy)
732
88
        CondTy = CondTy->getScalarType();
733
88
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
734
88
          Opcode, ValTy->getScalarType(), CondTy, I);
735
88
736
88
      // Return the cost of multiple scalar invocation plus the cost of
737
88
      // inserting and extracting the values.
738
88
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
739
88
    }
740
0
741
0
    // Unknown scalar opcode.
742
0
    return 1;
743
0
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
706
3.80k
                              const Instruction *I) {
707
3.80k
    const TargetLoweringBase *TLI = getTLI();
708
3.80k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
709
3.80k
    assert(ISD && "Invalid opcode");
710
3.80k
711
3.80k
    // Selects on vectors are actually vector selects.
712
3.80k
    if (ISD == ISD::SELECT) {
713
435
      assert(CondTy && "CondTy must exist");
714
435
      if (CondTy->isVectorTy())
715
96
        ISD = ISD::VSELECT;
716
435
    }
717
3.80k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
718
3.80k
719
3.80k
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()1.05k
) &&
720
3.80k
        !TLI->isOperationExpand(ISD, LT.second)) {
721
1.33k
      // The operation is legal. Assume it costs 1. Multiply
722
1.33k
      // by the type-legalization overhead.
723
1.33k
      return LT.first * 1;
724
1.33k
    }
725
2.47k
726
2.47k
    // Otherwise, assume that the cast is scalarized.
727
2.47k
    // TODO: If one of the types get legalized by splitting, handle this
728
2.47k
    // similarly to what getCastInstrCost() does.
729
2.47k
    if (ValTy->isVectorTy()) {
730
156
      unsigned Num = ValTy->getVectorNumElements();
731
156
      if (CondTy)
732
156
        CondTy = CondTy->getScalarType();
733
156
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
734
156
          Opcode, ValTy->getScalarType(), CondTy, I);
735
156
736
156
      // Return the cost of multiple scalar invocation plus the cost of
737
156
      // inserting and extracting the values.
738
156
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
739
156
    }
740
2.32k
741
2.32k
    // Unknown scalar opcode.
742
2.32k
    return 1;
743
2.32k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
706
12
                              const Instruction *I) {
707
12
    const TargetLoweringBase *TLI = getTLI();
708
12
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
709
12
    assert(ISD && "Invalid opcode");
710
12
711
12
    // Selects on vectors are actually vector selects.
712
12
    if (ISD == ISD::SELECT) {
713
0
      assert(CondTy && "CondTy must exist");
714
0
      if (CondTy->isVectorTy())
715
0
        ISD = ISD::VSELECT;
716
0
    }
717
12
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
718
12
719
12
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()0
) &&
720
12
        !TLI->isOperationExpand(ISD, LT.second)) {
721
12
      // The operation is legal. Assume it costs 1. Multiply
722
12
      // by the type-legalization overhead.
723
12
      return LT.first * 1;
724
12
    }
725
0
726
0
    // Otherwise, assume that the cast is scalarized.
727
0
    // TODO: If one of the types get legalized by splitting, handle this
728
0
    // similarly to what getCastInstrCost() does.
729
0
    if (ValTy->isVectorTy()) {
730
0
      unsigned Num = ValTy->getVectorNumElements();
731
0
      if (CondTy)
732
0
        CondTy = CondTy->getScalarType();
733
0
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
734
0
          Opcode, ValTy->getScalarType(), CondTy, I);
735
0
736
0
      // Return the cost of multiple scalar invocation plus the cost of
737
0
      // inserting and extracting the values.
738
0
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
739
0
    }
740
0
741
0
    // Unknown scalar opcode.
742
0
    return 1;
743
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
706
3
                              const Instruction *I) {
707
3
    const TargetLoweringBase *TLI = getTLI();
708
3
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
709
3
    assert(ISD && "Invalid opcode");
710
3
711
3
    // Selects on vectors are actually vector selects.
712
3
    if (ISD == ISD::SELECT) {
713
0
      assert(CondTy && "CondTy must exist");
714
0
      if (CondTy->isVectorTy())
715
0
        ISD = ISD::VSELECT;
716
0
    }
717
3
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
718
3
719
3
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()0
) &&
720
3
        !TLI->isOperationExpand(ISD, LT.second)) {
721
3
      // The operation is legal. Assume it costs 1. Multiply
722
3
      // by the type-legalization overhead.
723
3
      return LT.first * 1;
724
3
    }
725
0
726
0
    // Otherwise, assume that the cast is scalarized.
727
0
    // TODO: If one of the types get legalized by splitting, handle this
728
0
    // similarly to what getCastInstrCost() does.
729
0
    if (ValTy->isVectorTy()) {
730
0
      unsigned Num = ValTy->getVectorNumElements();
731
0
      if (CondTy)
732
0
        CondTy = CondTy->getScalarType();
733
0
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
734
0
          Opcode, ValTy->getScalarType(), CondTy, I);
735
0
736
0
      // Return the cost of multiple scalar invocation plus the cost of
737
0
      // inserting and extracting the values.
738
0
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
739
0
    }
740
0
741
0
    // Unknown scalar opcode.
742
0
    return 1;
743
0
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
706
49
                              const Instruction *I) {
707
49
    const TargetLoweringBase *TLI = getTLI();
708
49
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
709
49
    assert(ISD && "Invalid opcode");
710
49
711
49
    // Selects on vectors are actually vector selects.
712
49
    if (ISD == ISD::SELECT) {
713
0
      assert(CondTy && "CondTy must exist");
714
0
      if (CondTy->isVectorTy())
715
0
        ISD = ISD::VSELECT;
716
0
    }
717
49
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
718
49
719
49
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()9
) &&
720
49
        
!TLI->isOperationExpand(ISD, LT.second)48
) {
721
48
      // The operation is legal. Assume it costs 1. Multiply
722
48
      // by the type-legalization overhead.
723
48
      return LT.first * 1;
724
48
    }
725
1
726
1
    // Otherwise, assume that the cast is scalarized.
727
1
    // TODO: If one of the types get legalized by splitting, handle this
728
1
    // similarly to what getCastInstrCost() does.
729
1
    if (ValTy->isVectorTy()) {
730
1
      unsigned Num = ValTy->getVectorNumElements();
731
1
      if (CondTy)
732
1
        CondTy = CondTy->getScalarType();
733
1
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
734
1
          Opcode, ValTy->getScalarType(), CondTy, I);
735
1
736
1
      // Return the cost of multiple scalar invocation plus the cost of
737
1
      // inserting and extracting the values.
738
1
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
739
1
    }
740
0
741
0
    // Unknown scalar opcode.
742
0
    return 1;
743
0
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
706
188
                              const Instruction *I) {
707
188
    const TargetLoweringBase *TLI = getTLI();
708
188
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
709
188
    assert(ISD && "Invalid opcode");
710
188
711
188
    // Selects on vectors are actually vector selects.
712
188
    if (ISD == ISD::SELECT) {
713
0
      assert(CondTy && "CondTy must exist");
714
0
      if (CondTy->isVectorTy())
715
0
        ISD = ISD::VSELECT;
716
0
    }
717
188
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
718
188
719
188
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()0
) &&
720
188
        !TLI->isOperationExpand(ISD, LT.second)) {
721
188
      // The operation is legal. Assume it costs 1. Multiply
722
188
      // by the type-legalization overhead.
723
188
      return LT.first * 1;
724
188
    }
725
0
726
0
    // Otherwise, assume that the cast is scalarized.
727
0
    // TODO: If one of the types get legalized by splitting, handle this
728
0
    // similarly to what getCastInstrCost() does.
729
0
    if (ValTy->isVectorTy()) {
730
0
      unsigned Num = ValTy->getVectorNumElements();
731
0
      if (CondTy)
732
0
        CondTy = CondTy->getScalarType();
733
0
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
734
0
          Opcode, ValTy->getScalarType(), CondTy, I);
735
0
736
0
      // Return the cost of multiple scalar invocation plus the cost of
737
0
      // inserting and extracting the values.
738
0
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
739
0
    }
740
0
741
0
    // Unknown scalar opcode.
742
0
    return 1;
743
0
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
706
16.6k
                              const Instruction *I) {
707
16.6k
    const TargetLoweringBase *TLI = getTLI();
708
16.6k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
709
16.6k
    assert(ISD && "Invalid opcode");
710
16.6k
711
16.6k
    // Selects on vectors are actually vector selects.
712
16.6k
    if (ISD == ISD::SELECT) {
713
6.35k
      assert(CondTy && "CondTy must exist");
714
6.35k
      if (CondTy->isVectorTy())
715
4.01k
        ISD = ISD::VSELECT;
716
6.35k
    }
717
16.6k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
718
16.6k
719
16.6k
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()5.66k
) &&
720
16.6k
        
!TLI->isOperationExpand(ISD, LT.second)16.5k
) {
721
14.7k
      // The operation is legal. Assume it costs 1. Multiply
722
14.7k
      // by the type-legalization overhead.
723
14.7k
      return LT.first * 1;
724
14.7k
    }
725
1.93k
726
1.93k
    // Otherwise, assume that the cast is scalarized.
727
1.93k
    // TODO: If one of the types get legalized by splitting, handle this
728
1.93k
    // similarly to what getCastInstrCost() does.
729
1.93k
    if (ValTy->isVectorTy()) {
730
1.93k
      unsigned Num = ValTy->getVectorNumElements();
731
1.93k
      if (CondTy)
732
1.93k
        CondTy = CondTy->getScalarType();
733
1.93k
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
734
1.93k
          Opcode, ValTy->getScalarType(), CondTy, I);
735
1.93k
736
1.93k
      // Return the cost of multiple scalar invocation plus the cost of
737
1.93k
      // inserting and extracting the values.
738
1.93k
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
739
1.93k
    }
740
0
741
0
    // Unknown scalar opcode.
742
0
    return 1;
743
0
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
744
745
246k
  unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index) {
746
246k
    std::pair<unsigned, MVT> LT =
747
246k
        getTLI()->getTypeLegalizationCost(DL, Val->getScalarType());
748
246k
749
246k
    return LT.first;
750
246k
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getVectorInstrCost(unsigned int, llvm::Type*, unsigned int)
Line
Count
Source
745
612
  unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index) {
746
612
    std::pair<unsigned, MVT> LT =
747
612
        getTLI()->getTypeLegalizationCost(DL, Val->getScalarType());
748
612
749
612
    return LT.first;
750
612
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getVectorInstrCost(unsigned int, llvm::Type*, unsigned int)
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getVectorInstrCost(unsigned int, llvm::Type*, unsigned int)
Line
Count
Source
745
11.7k
  unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index) {
746
11.7k
    std::pair<unsigned, MVT> LT =
747
11.7k
        getTLI()->getTypeLegalizationCost(DL, Val->getScalarType());
748
11.7k
749
11.7k
    return LT.first;
750
11.7k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getVectorInstrCost(unsigned int, llvm::Type*, unsigned int)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getVectorInstrCost(unsigned int, llvm::Type*, unsigned int)
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getVectorInstrCost(unsigned int, llvm::Type*, unsigned int)
Line
Count
Source
745
14
  unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index) {
746
14
    std::pair<unsigned, MVT> LT =
747
14
        getTLI()->getTypeLegalizationCost(DL, Val->getScalarType());
748
14
749
14
    return LT.first;
750
14
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getVectorInstrCost(unsigned int, llvm::Type*, unsigned int)
Line
Count
Source
745
118
  unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index) {
746
118
    std::pair<unsigned, MVT> LT =
747
118
        getTLI()->getTypeLegalizationCost(DL, Val->getScalarType());
748
118
749
118
    return LT.first;
750
118
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getVectorInstrCost(unsigned int, llvm::Type*, unsigned int)
Line
Count
Source
745
1.38k
  unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index) {
746
1.38k
    std::pair<unsigned, MVT> LT =
747
1.38k
        getTLI()->getTypeLegalizationCost(DL, Val->getScalarType());
748
1.38k
749
1.38k
    return LT.first;
750
1.38k
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getVectorInstrCost(unsigned int, llvm::Type*, unsigned int)
Line
Count
Source
745
232k
  unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index) {
746
232k
    std::pair<unsigned, MVT> LT =
747
232k
        getTLI()->getTypeLegalizationCost(DL, Val->getScalarType());
748
232k
749
232k
    return LT.first;
750
232k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getVectorInstrCost(unsigned int, llvm::Type*, unsigned int)
751
752
  unsigned getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
753
891
                       unsigned AddressSpace, const Instruction *I = nullptr) {
754
891
    assert(!Src->isVoidTy() && "Invalid type");
755
891
    std::pair<unsigned, MVT> LT = getTLI()->getTypeLegalizationCost(DL, Src);
756
891
757
891
    // Assuming that all loads of legal types cost 1.
758
891
    unsigned Cost = LT.first;
759
891
760
891
    if (Src->isVectorTy() &&
761
891
        
Src->getPrimitiveSizeInBits() < LT.second.getSizeInBits()493
) {
762
60
      // This is a vector load that legalizes to a larger type than the vector
763
60
      // itself. Unless the corresponding extending load or truncating store is
764
60
      // legal, then this will scalarize.
765
60
      TargetLowering::LegalizeAction LA = TargetLowering::Expand;
766
60
      EVT MemVT = getTLI()->getValueType(DL, Src);
767
60
      if (Opcode == Instruction::Store)
768
22
        LA = getTLI()->getTruncStoreAction(LT.second, MemVT);
769
38
      else
770
38
        LA = getTLI()->getLoadExtAction(ISD::EXTLOAD, LT.second, MemVT);
771
60
772
60
      if (LA != TargetLowering::Legal && 
LA != TargetLowering::Custom55
) {
773
55
        // This is a vector load/store for some illegal type that is scalarized.
774
55
        // We must account for the cost of building or decomposing the vector.
775
55
        Cost += getScalarizationOverhead(Src, Opcode != Instruction::Store,
776
55
                                         Opcode == Instruction::Store);
777
55
      }
778
60
    }
779
891
780
891
    return Cost;
781
891
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getMemoryOpCost(unsigned int, llvm::Type*, unsigned int, unsigned int, llvm::Instruction const*)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getMemoryOpCost(unsigned int, llvm::Type*, unsigned int, unsigned int, llvm::Instruction const*)
Line
Count
Source
753
685
                       unsigned AddressSpace, const Instruction *I = nullptr) {
754
685
    assert(!Src->isVoidTy() && "Invalid type");
755
685
    std::pair<unsigned, MVT> LT = getTLI()->getTypeLegalizationCost(DL, Src);
756
685
757
685
    // Assuming that all loads of legal types cost 1.
758
685
    unsigned Cost = LT.first;
759
685
760
685
    if (Src->isVectorTy() &&
761
685
        
Src->getPrimitiveSizeInBits() < LT.second.getSizeInBits()388
) {
762
37
      // This is a vector load that legalizes to a larger type than the vector
763
37
      // itself. Unless the corresponding extending load or truncating store is
764
37
      // legal, then this will scalarize.
765
37
      TargetLowering::LegalizeAction LA = TargetLowering::Expand;
766
37
      EVT MemVT = getTLI()->getValueType(DL, Src);
767
37
      if (Opcode == Instruction::Store)
768
17
        LA = getTLI()->getTruncStoreAction(LT.second, MemVT);
769
20
      else
770
20
        LA = getTLI()->getLoadExtAction(ISD::EXTLOAD, LT.second, MemVT);
771
37
772
37
      if (LA != TargetLowering::Legal && 
LA != TargetLowering::Custom35
) {
773
35
        // This is a vector load/store for some illegal type that is scalarized.
774
35
        // We must account for the cost of building or decomposing the vector.
775
35
        Cost += getScalarizationOverhead(Src, Opcode != Instruction::Store,
776
35
                                         Opcode == Instruction::Store);
777
35
      }
778
37
    }
779
685
780
685
    return Cost;
781
685
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getMemoryOpCost(unsigned int, llvm::Type*, unsigned int, unsigned int, llvm::Instruction const*)
Line
Count
Source
753
42
                       unsigned AddressSpace, const Instruction *I = nullptr) {
754
42
    assert(!Src->isVoidTy() && "Invalid type");
755
42
    std::pair<unsigned, MVT> LT = getTLI()->getTypeLegalizationCost(DL, Src);
756
42
757
42
    // Assuming that all loads of legal types cost 1.
758
42
    unsigned Cost = LT.first;
759
42
760
42
    if (Src->isVectorTy() &&
761
42
        
Src->getPrimitiveSizeInBits() < LT.second.getSizeInBits()15
) {
762
3
      // This is a vector load that legalizes to a larger type than the vector
763
3
      // itself. Unless the corresponding extending load or truncating store is
764
3
      // legal, then this will scalarize.
765
3
      TargetLowering::LegalizeAction LA = TargetLowering::Expand;
766
3
      EVT MemVT = getTLI()->getValueType(DL, Src);
767
3
      if (Opcode == Instruction::Store)
768
3
        LA = getTLI()->getTruncStoreAction(LT.second, MemVT);
769
0
      else
770
0
        LA = getTLI()->getLoadExtAction(ISD::EXTLOAD, LT.second, MemVT);
771
3
772
3
      if (LA != TargetLowering::Legal && LA != TargetLowering::Custom) {
773
3
        // This is a vector load/store for some illegal type that is scalarized.
774
3
        // We must account for the cost of building or decomposing the vector.
775
3
        Cost += getScalarizationOverhead(Src, Opcode != Instruction::Store,
776
3
                                         Opcode == Instruction::Store);
777
3
      }
778
3
    }
779
42
780
42
    return Cost;
781
42
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getMemoryOpCost(unsigned int, llvm::Type*, unsigned int, unsigned int, llvm::Instruction const*)
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getMemoryOpCost(unsigned int, llvm::Type*, unsigned int, unsigned int, llvm::Instruction const*)
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getMemoryOpCost(unsigned int, llvm::Type*, unsigned int, unsigned int, llvm::Instruction const*)
Line
Count
Source
753
8
                       unsigned AddressSpace, const Instruction *I = nullptr) {
754
8
    assert(!Src->isVoidTy() && "Invalid type");
755
8
    std::pair<unsigned, MVT> LT = getTLI()->getTypeLegalizationCost(DL, Src);
756
8
757
8
    // Assuming that all loads of legal types cost 1.
758
8
    unsigned Cost = LT.first;
759
8
760
8
    if (Src->isVectorTy() &&
761
8
        
Src->getPrimitiveSizeInBits() < LT.second.getSizeInBits()4
) {
762
0
      // This is a vector load that legalizes to a larger type than the vector
763
0
      // itself. Unless the corresponding extending load or truncating store is
764
0
      // legal, then this will scalarize.
765
0
      TargetLowering::LegalizeAction LA = TargetLowering::Expand;
766
0
      EVT MemVT = getTLI()->getValueType(DL, Src);
767
0
      if (Opcode == Instruction::Store)
768
0
        LA = getTLI()->getTruncStoreAction(LT.second, MemVT);
769
0
      else
770
0
        LA = getTLI()->getLoadExtAction(ISD::EXTLOAD, LT.second, MemVT);
771
0
772
0
      if (LA != TargetLowering::Legal && LA != TargetLowering::Custom) {
773
0
        // This is a vector load/store for some illegal type that is scalarized.
774
0
        // We must account for the cost of building or decomposing the vector.
775
0
        Cost += getScalarizationOverhead(Src, Opcode != Instruction::Store,
776
0
                                         Opcode == Instruction::Store);
777
0
      }
778
0
    }
779
8
780
8
    return Cost;
781
8
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getMemoryOpCost(unsigned int, llvm::Type*, unsigned int, unsigned int, llvm::Instruction const*)
Line
Count
Source
753
136
                       unsigned AddressSpace, const Instruction *I = nullptr) {
754
136
    assert(!Src->isVoidTy() && "Invalid type");
755
136
    std::pair<unsigned, MVT> LT = getTLI()->getTypeLegalizationCost(DL, Src);
756
136
757
136
    // Assuming that all loads of legal types cost 1.
758
136
    unsigned Cost = LT.first;
759
136
760
136
    if (Src->isVectorTy() &&
761
136
        
Src->getPrimitiveSizeInBits() < LT.second.getSizeInBits()86
) {
762
20
      // This is a vector load that legalizes to a larger type than the vector
763
20
      // itself. Unless the corresponding extending load or truncating store is
764
20
      // legal, then this will scalarize.
765
20
      TargetLowering::LegalizeAction LA = TargetLowering::Expand;
766
20
      EVT MemVT = getTLI()->getValueType(DL, Src);
767
20
      if (Opcode == Instruction::Store)
768
2
        LA = getTLI()->getTruncStoreAction(LT.second, MemVT);
769
18
      else
770
18
        LA = getTLI()->getLoadExtAction(ISD::EXTLOAD, LT.second, MemVT);
771
20
772
20
      if (LA != TargetLowering::Legal && 
LA != TargetLowering::Custom17
) {
773
17
        // This is a vector load/store for some illegal type that is scalarized.
774
17
        // We must account for the cost of building or decomposing the vector.
775
17
        Cost += getScalarizationOverhead(Src, Opcode != Instruction::Store,
776
17
                                         Opcode == Instruction::Store);
777
17
      }
778
20
    }
779
136
780
136
    return Cost;
781
136
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getMemoryOpCost(unsigned int, llvm::Type*, unsigned int, unsigned int, llvm::Instruction const*)
Line
Count
Source
753
20
                       unsigned AddressSpace, const Instruction *I = nullptr) {
754
20
    assert(!Src->isVoidTy() && "Invalid type");
755
20
    std::pair<unsigned, MVT> LT = getTLI()->getTypeLegalizationCost(DL, Src);
756
20
757
20
    // Assuming that all loads of legal types cost 1.
758
20
    unsigned Cost = LT.first;
759
20
760
20
    if (Src->isVectorTy() &&
761
20
        
Src->getPrimitiveSizeInBits() < LT.second.getSizeInBits()0
) {
762
0
      // This is a vector load that legalizes to a larger type than the vector
763
0
      // itself. Unless the corresponding extending load or truncating store is
764
0
      // legal, then this will scalarize.
765
0
      TargetLowering::LegalizeAction LA = TargetLowering::Expand;
766
0
      EVT MemVT = getTLI()->getValueType(DL, Src);
767
0
      if (Opcode == Instruction::Store)
768
0
        LA = getTLI()->getTruncStoreAction(LT.second, MemVT);
769
0
      else
770
0
        LA = getTLI()->getLoadExtAction(ISD::EXTLOAD, LT.second, MemVT);
771
0
772
0
      if (LA != TargetLowering::Legal && LA != TargetLowering::Custom) {
773
0
        // This is a vector load/store for some illegal type that is scalarized.
774
0
        // We must account for the cost of building or decomposing the vector.
775
0
        Cost += getScalarizationOverhead(Src, Opcode != Instruction::Store,
776
0
                                         Opcode == Instruction::Store);
777
0
      }
778
0
    }
779
20
780
20
    return Cost;
781
20
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getMemoryOpCost(unsigned int, llvm::Type*, unsigned int, unsigned int, llvm::Instruction const*)
782
783
  unsigned getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy,
784
                                      unsigned Factor,
785
                                      ArrayRef<unsigned> Indices,
786
                                      unsigned Alignment,
787
617
                                      unsigned AddressSpace) {
788
617
    VectorType *VT = dyn_cast<VectorType>(VecTy);
789
617
    assert(VT && "Expect a vector type for interleaved memory op");
790
617
791
617
    unsigned NumElts = VT->getNumElements();
792
617
    assert(Factor > 1 && NumElts % Factor == 0 && "Invalid interleave factor");
793
617
794
617
    unsigned NumSubElts = NumElts / Factor;
795
617
    VectorType *SubVT = VectorType::get(VT->getElementType(), NumSubElts);
796
617
797
617
    // Firstly, the cost of load/store operation.
798
617
    unsigned Cost = static_cast<T *>(this)->getMemoryOpCost(
799
617
        Opcode, VecTy, Alignment, AddressSpace);
800
617
801
617
    // Legalize the vector type, and get the legalized and unlegalized type
802
617
    // sizes.
803
617
    MVT VecTyLT = getTLI()->getTypeLegalizationCost(DL, VecTy).second;
804
617
    unsigned VecTySize =
805
617
        static_cast<T *>(this)->getDataLayout().getTypeStoreSize(VecTy);
806
617
    unsigned VecTyLTSize = VecTyLT.getStoreSize();
807
617
808
617
    // Return the ceiling of dividing A by B.
809
617
    auto ceil = [](unsigned A, unsigned B) 
{ return (A + B - 1) / B; }498
;
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getInterleavedMemoryOpCost(unsigned int, llvm::Type*, unsigned int, llvm::ArrayRef<unsigned int>, unsigned int, unsigned int)::'lambda'(unsigned int, unsigned int)::operator()(unsigned int, unsigned int) const
Line
Count
Source
809
464
    auto ceil = [](unsigned A, unsigned B) { return (A + B - 1) / B; };
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getInterleavedMemoryOpCost(unsigned int, llvm::Type*, unsigned int, llvm::ArrayRef<unsigned int