Coverage Report

Created: 2018-07-18 22:01

/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
861
  unsigned getPermuteShuffleOverhead(Type *Ty) {
86
861
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
87
861
    unsigned Cost = 0;
88
861
    // Shuffle cost is equal to the cost of extracting element from its argument
89
861
    // plus the cost of inserting them onto the result vector.
90
861
91
861
    // e.g. <4 x float> has a mask of <0,5,2,7> i.e we need to extract from
92
861
    // index 0 of first vector, index 1 of second vector,index 2 of first
93
861
    // vector and finally index 3 of second vector and insert them at index
94
861
    // <0,1,2,3> of result vector.
95
5.19k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i4.33k
) {
96
4.33k
      Cost += static_cast<T *>(this)
97
4.33k
                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
98
4.33k
      Cost += static_cast<T *>(this)
99
4.33k
                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
100
4.33k
    }
101
861
    return Cost;
102
861
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getPermuteShuffleOverhead(llvm::Type*)
Line
Count
Source
85
685
  unsigned getPermuteShuffleOverhead(Type *Ty) {
86
685
    assert(Ty->isVectorTy() && "Can only shuffle vectors");
87
685
    unsigned Cost = 0;
88
685
    // Shuffle cost is equal to the cost of extracting element from its argument
89
685
    // plus the cost of inserting them onto the result vector.
90
685
91
685
    // e.g. <4 x float> has a mask of <0,5,2,7> i.e we need to extract from
92
685
    // index 0 of first vector, index 1 of second vector,index 2 of first
93
685
    // vector and finally index 3 of second vector and insert them at index
94
685
    // <0,1,2,3> of result vector.
95
4.26k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i3.57k
) {
96
3.57k
      Cost += static_cast<T *>(this)
97
3.57k
                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
98
3.57k
      Cost += static_cast<T *>(this)
99
3.57k
                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
100
3.57k
    }
101
685
    return Cost;
102
685
  }
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
378k
  const TargetSubtargetInfo *getST() const {
106
378k
    return static_cast<const T *>(this)->getST();
107
378k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getST() const
Line
Count
Source
105
349k
  const TargetSubtargetInfo *getST() const {
106
349k
    return static_cast<const T *>(this)->getST();
107
349k
  }
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.73k
  const TargetSubtargetInfo *getST() const {
106
6.73k
    return static_cast<const T *>(this)->getST();
107
6.73k
  }
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
535
  const TargetSubtargetInfo *getST() const {
106
535
    return static_cast<const T *>(this)->getST();
107
535
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getST() const
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getST() const
Line
Count
Source
105
22.6k
  const TargetSubtargetInfo *getST() const {
106
22.6k
    return static_cast<const T *>(this)->getST();
107
22.6k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getST() const
108
109
  /// Local query method delegates up to T which *must* implement this!
110
96.0M
  const TargetLoweringBase *getTLI() const {
111
96.0M
    return static_cast<const T *>(this)->getTLI();
112
96.0M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getTLI() const
Line
Count
Source
110
87.3M
  const TargetLoweringBase *getTLI() const {
111
87.3M
    return static_cast<const T *>(this)->getTLI();
112
87.3M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getTLI() const
Line
Count
Source
110
2.85k
  const TargetLoweringBase *getTLI() const {
111
2.85k
    return static_cast<const T *>(this)->getTLI();
112
2.85k
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getTLI() const
Line
Count
Source
110
57.9k
  const TargetLoweringBase *getTLI() const {
111
57.9k
    return static_cast<const T *>(this)->getTLI();
112
57.9k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getTLI() const
Line
Count
Source
110
1.31M
  const TargetLoweringBase *getTLI() const {
111
1.31M
    return static_cast<const T *>(this)->getTLI();
112
1.31M
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getTLI() const
Line
Count
Source
110
40.0k
  const TargetLoweringBase *getTLI() const {
111
40.0k
    return static_cast<const T *>(this)->getTLI();
112
40.0k
  }
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
457
  const TargetLoweringBase *getTLI() const {
111
457
    return static_cast<const T *>(this)->getTLI();
112
457
  }
llvm::BasicTTIImplBase<llvm::NVPTXTTIImpl>::getTLI() const
Line
Count
Source
110
1.18k
  const TargetLoweringBase *getTLI() const {
111
1.18k
    return static_cast<const T *>(this)->getTLI();
112
1.18k
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getTLI() const
Line
Count
Source
110
49.4k
  const TargetLoweringBase *getTLI() const {
111
49.4k
    return static_cast<const T *>(this)->getTLI();
112
49.4k
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getTLI() const
Line
Count
Source
110
10.2k
  const TargetLoweringBase *getTLI() const {
111
10.2k
    return static_cast<const T *>(this)->getTLI();
112
10.2k
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getTLI() const
Line
Count
Source
110
7.29M
  const TargetLoweringBase *getTLI() const {
111
7.29M
    return static_cast<const T *>(this)->getTLI();
112
7.29M
  }
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.61k
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
115
7.61k
    switch (M) {
116
7.61k
      case TTI::MIM_Unindexed:
117
0
        return ISD::UNINDEXED;
118
7.61k
      case TTI::MIM_PreInc:
119
0
        return ISD::PRE_INC;
120
7.61k
      case TTI::MIM_PreDec:
121
0
        return ISD::PRE_DEC;
122
7.61k
      case TTI::MIM_PostInc:
123
7.61k
        return ISD::POST_INC;
124
7.61k
      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.61k
  static ISD::MemIndexedMode getISDIndexedMode(TTI::MemIndexedMode M) {
115
7.61k
    switch (M) {
116
7.61k
      case TTI::MIM_Unindexed:
117
0
        return ISD::UNINDEXED;
118
7.61k
      case TTI::MIM_PreInc:
119
0
        return ISD::PRE_INC;
120
7.61k
      case TTI::MIM_PreDec:
121
0
        return ISD::PRE_DEC;
122
7.61k
      case TTI::MIM_PostInc:
123
7.61k
        return ISD::POST_INC;
124
7.61k
      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
16.5M
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
12.0M
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
39.5k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::AMDGPUTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
423k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
384k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
698k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
33.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.3k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
92.9k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
85.4k
      : BaseT(DL) {}
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::BasicTTIImplBase(llvm::TargetMachine const*, llvm::DataLayout const&)
Line
Count
Source
132
2.64M
      : 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
106k
      : 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
7.96k
                                      unsigned Alignment, bool *Fast) const {
142
7.96k
    EVT E = EVT::getIntegerVT(Context, BitWidth);
143
7.96k
    return getTLI()->allowsMisalignedMemoryAccesses(E, AddressSpace, Alignment, Fast);
144
7.96k
  }
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
112
                                      unsigned Alignment, bool *Fast) const {
142
112
    EVT E = EVT::getIntegerVT(Context, BitWidth);
143
112
    return getTLI()->allowsMisalignedMemoryAccesses(E, AddressSpace, Alignment, Fast);
144
112
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
Line
Count
Source
141
7.82k
                                      unsigned Alignment, bool *Fast) const {
142
7.82k
    EVT E = EVT::getIntegerVT(Context, BitWidth);
143
7.82k
    return getTLI()->allowsMisalignedMemoryAccesses(E, AddressSpace, Alignment, Fast);
144
7.82k
  }
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
10
                                      unsigned Alignment, bool *Fast) const {
142
10
    EVT E = EVT::getIntegerVT(Context, BitWidth);
143
10
    return getTLI()->allowsMisalignedMemoryAccesses(E, AddressSpace, Alignment, Fast);
144
10
  }
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
18
                                      unsigned Alignment, bool *Fast) const {
142
18
    EVT E = EVT::getIntegerVT(Context, BitWidth);
143
18
    return getTLI()->allowsMisalignedMemoryAccesses(E, AddressSpace, Alignment, Fast);
144
18
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::allowsMisalignedMemoryAccesses(llvm::LLVMContext&, unsigned int, unsigned int, unsigned int, bool*) const
145
146
7.68M
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::hasBranchDivergence()
Line
Count
Source
146
5.20M
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::hasBranchDivergence()
Line
Count
Source
146
13.8k
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::hasBranchDivergence()
Line
Count
Source
146
504k
  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.0k
  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.2k
  bool hasBranchDivergence() { return false; }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::hasBranchDivergence()
Line
Count
Source
146
1.81M
  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.31k
  unsigned getFlatAddressSpace() {
153
2.31k
    // Return an invalid address space.
154
2.31k
    return -1;
155
2.31k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getFlatAddressSpace()
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getFlatAddressSpace()
Line
Count
Source
152
2.31k
  unsigned getFlatAddressSpace() {
153
2.31k
    // Return an invalid address space.
154
2.31k
    return -1;
155
2.31k
  }
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.60M
  bool isLegalAddImmediate(int64_t imm) {
158
2.60M
    return getTLI()->isLegalAddImmediate(imm);
159
2.60M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
157
2.53M
  bool isLegalAddImmediate(int64_t imm) {
158
2.53M
    return getTLI()->isLegalAddImmediate(imm);
159
2.53M
  }
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.7k
  bool isLegalAddImmediate(int64_t imm) {
158
24.7k
    return getTLI()->isLegalAddImmediate(imm);
159
24.7k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isLegalAddImmediate(long long)
Line
Count
Source
157
1.21k
  bool isLegalAddImmediate(int64_t imm) {
158
1.21k
    return getTLI()->isLegalAddImmediate(imm);
159
1.21k
  }
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
3.16k
  bool isLegalAddImmediate(int64_t imm) {
158
3.16k
    return getTLI()->isLegalAddImmediate(imm);
159
3.16k
  }
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
37.1k
  bool isLegalAddImmediate(int64_t imm) {
158
37.1k
    return getTLI()->isLegalAddImmediate(imm);
159
37.1k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isLegalAddImmediate(long long)
160
161
524k
  bool isLegalICmpImmediate(int64_t imm) {
162
524k
    return getTLI()->isLegalICmpImmediate(imm);
163
524k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
161
441k
  bool isLegalICmpImmediate(int64_t imm) {
162
441k
    return getTLI()->isLegalICmpImmediate(imm);
163
441k
  }
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
10.9k
  bool isLegalICmpImmediate(int64_t imm) {
162
10.9k
    return getTLI()->isLegalICmpImmediate(imm);
163
10.9k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isLegalICmpImmediate(long long)
Line
Count
Source
161
1.27k
  bool isLegalICmpImmediate(int64_t imm) {
162
1.27k
    return getTLI()->isLegalICmpImmediate(imm);
163
1.27k
  }
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.76k
  bool isLegalICmpImmediate(int64_t imm) {
162
2.76k
    return getTLI()->isLegalICmpImmediate(imm);
163
2.76k
  }
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
67.2k
  bool isLegalICmpImmediate(int64_t imm) {
162
67.2k
    return getTLI()->isLegalICmpImmediate(imm);
163
67.2k
  }
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.0M
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
55.0M
    TargetLoweringBase::AddrMode AM;
169
55.0M
    AM.BaseGV = BaseGV;
170
55.0M
    AM.BaseOffs = BaseOffset;
171
55.0M
    AM.HasBaseReg = HasBaseReg;
172
55.0M
    AM.Scale = Scale;
173
55.0M
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
55.0M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
50.4M
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
50.4M
    TargetLoweringBase::AddrMode AM;
169
50.4M
    AM.BaseGV = BaseGV;
170
50.4M
    AM.BaseOffs = BaseOffset;
171
50.4M
    AM.HasBaseReg = HasBaseReg;
172
50.4M
    AM.Scale = Scale;
173
50.4M
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
50.4M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
2.29k
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
2.29k
    TargetLoweringBase::AddrMode AM;
169
2.29k
    AM.BaseGV = BaseGV;
170
2.29k
    AM.BaseOffs = BaseOffset;
171
2.29k
    AM.HasBaseReg = HasBaseReg;
172
2.29k
    AM.Scale = Scale;
173
2.29k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
2.29k
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
41.2k
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
41.2k
    TargetLoweringBase::AddrMode AM;
169
41.2k
    AM.BaseGV = BaseGV;
170
41.2k
    AM.BaseOffs = BaseOffset;
171
41.2k
    AM.HasBaseReg = HasBaseReg;
172
41.2k
    AM.Scale = Scale;
173
41.2k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
41.2k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
453k
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
453k
    TargetLoweringBase::AddrMode AM;
169
453k
    AM.BaseGV = BaseGV;
170
453k
    AM.BaseOffs = BaseOffset;
171
453k
    AM.HasBaseReg = HasBaseReg;
172
453k
    AM.Scale = Scale;
173
453k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
453k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
21.6k
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
21.6k
    TargetLoweringBase::AddrMode AM;
169
21.6k
    AM.BaseGV = BaseGV;
170
21.6k
    AM.BaseOffs = BaseOffset;
171
21.6k
    AM.HasBaseReg = HasBaseReg;
172
21.6k
    AM.Scale = Scale;
173
21.6k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
21.6k
  }
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
859
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
859
    TargetLoweringBase::AddrMode AM;
169
859
    AM.BaseGV = BaseGV;
170
859
    AM.BaseOffs = BaseOffset;
171
859
    AM.HasBaseReg = HasBaseReg;
172
859
    AM.Scale = Scale;
173
859
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
859
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::isLegalAddressingMode(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int, llvm::Instruction*)
Line
Count
Source
167
30.1k
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
30.1k
    TargetLoweringBase::AddrMode AM;
169
30.1k
    AM.BaseGV = BaseGV;
170
30.1k
    AM.BaseOffs = BaseOffset;
171
30.1k
    AM.HasBaseReg = HasBaseReg;
172
30.1k
    AM.Scale = Scale;
173
30.1k
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
30.1k
  }
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.04M
                             unsigned AddrSpace, Instruction *I = nullptr) {
168
4.04M
    TargetLoweringBase::AddrMode AM;
169
4.04M
    AM.BaseGV = BaseGV;
170
4.04M
    AM.BaseOffs = BaseOffset;
171
4.04M
    AM.HasBaseReg = HasBaseReg;
172
4.04M
    AM.Scale = Scale;
173
4.04M
    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
174
4.04M
  }
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.61k
                          const DataLayout &DL) const {
178
7.61k
    EVT VT = getTLI()->getValueType(DL, Ty);
179
7.61k
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
180
7.61k
  }
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.61k
                          const DataLayout &DL) const {
178
7.61k
    EVT VT = getTLI()->getValueType(DL, Ty);
179
7.61k
    return getTLI()->isIndexedLoadLegal(getISDIndexedMode(M), VT);
180
7.61k
  }
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.55M
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
189
3.55M
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
190
3.55M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
188
3.48M
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
189
3.48M
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
190
3.48M
  }
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
830
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
189
830
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
190
830
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
188
58.2k
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
189
58.2k
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
190
58.2k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isLSRCostLess(llvm::TargetTransformInfo::LSRCost, llvm::TargetTransformInfo::LSRCost)
Line
Count
Source
188
4.32k
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
189
4.32k
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
190
4.32k
  }
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.03k
  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
189
4.03k
    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
190
4.03k
  }
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.44M
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
194
5.44M
    TargetLoweringBase::AddrMode AM;
195
5.44M
    AM.BaseGV = BaseGV;
196
5.44M
    AM.BaseOffs = BaseOffset;
197
5.44M
    AM.HasBaseReg = HasBaseReg;
198
5.44M
    AM.Scale = Scale;
199
5.44M
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
200
5.44M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
Line
Count
Source
193
4.72M
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
194
4.72M
    TargetLoweringBase::AddrMode AM;
195
4.72M
    AM.BaseGV = BaseGV;
196
4.72M
    AM.BaseOffs = BaseOffset;
197
4.72M
    AM.HasBaseReg = HasBaseReg;
198
4.72M
    AM.Scale = Scale;
199
4.72M
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
200
4.72M
  }
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
60.9k
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
194
60.9k
    TargetLoweringBase::AddrMode AM;
195
60.9k
    AM.BaseGV = BaseGV;
196
60.9k
    AM.BaseOffs = BaseOffset;
197
60.9k
    AM.HasBaseReg = HasBaseReg;
198
60.9k
    AM.Scale = Scale;
199
60.9k
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
200
60.9k
  }
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
5.66k
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
194
5.66k
    TargetLoweringBase::AddrMode AM;
195
5.66k
    AM.BaseGV = BaseGV;
196
5.66k
    AM.BaseOffs = BaseOffset;
197
5.66k
    AM.HasBaseReg = HasBaseReg;
198
5.66k
    AM.Scale = Scale;
199
5.66k
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
200
5.66k
  }
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
656k
                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
194
656k
    TargetLoweringBase::AddrMode AM;
195
656k
    AM.BaseGV = BaseGV;
196
656k
    AM.BaseOffs = BaseOffset;
197
656k
    AM.HasBaseReg = HasBaseReg;
198
656k
    AM.Scale = Scale;
199
656k
    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
200
656k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getScalingFactorCost(llvm::Type*, llvm::GlobalValue*, long long, bool, long long, unsigned int)
201
202
1.37M
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
1.37M
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
1.37M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
202
1.34M
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
1.34M
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
1.34M
  }
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
423
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
423
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
423
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
202
3.72k
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
3.72k
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
3.72k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
202
467
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
467
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
467
  }
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.60k
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
1.60k
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
1.60k
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
202
204
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
204
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
204
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
Line
Count
Source
202
22.1k
  bool isTruncateFree(Type *Ty1, Type *Ty2) {
203
22.1k
    return getTLI()->isTruncateFree(Ty1, Ty2);
204
22.1k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isTruncateFree(llvm::Type*, llvm::Type*)
205
206
122k
  bool isProfitableToHoist(Instruction *I) {
207
122k
    return getTLI()->isProfitableToHoist(I);
208
122k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isProfitableToHoist(llvm::Instruction*)
Line
Count
Source
206
78.3k
  bool isProfitableToHoist(Instruction *I) {
207
78.3k
    return getTLI()->isProfitableToHoist(I);
208
78.3k
  }
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.67k
  bool isProfitableToHoist(Instruction *I) {
207
8.67k
    return getTLI()->isProfitableToHoist(I);
208
8.67k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::isProfitableToHoist(llvm::Instruction*)
Line
Count
Source
206
2
  bool isProfitableToHoist(Instruction *I) {
207
2
    return getTLI()->isProfitableToHoist(I);
208
2
  }
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.5k
  bool isProfitableToHoist(Instruction *I) {
207
35.5k
    return getTLI()->isProfitableToHoist(I);
208
35.5k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isProfitableToHoist(llvm::Instruction*)
209
210
559
  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
524
  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.5k
  bool isTypeLegal(Type *Ty) {
213
17.5k
    EVT VT = getTLI()->getValueType(DL, Ty);
214
17.5k
    return getTLI()->isTypeLegal(VT);
215
17.5k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::isTypeLegal(llvm::Type*)
Line
Count
Source
212
16.7k
  bool isTypeLegal(Type *Ty) {
213
16.7k
    EVT VT = getTLI()->getValueType(DL, Ty);
214
16.7k
    return getTLI()->isTypeLegal(VT);
215
16.7k
  }
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
3
  bool isTypeLegal(Type *Ty) {
213
3
    EVT VT = getTLI()->getValueType(DL, Ty);
214
3
    return getTLI()->isTypeLegal(VT);
215
3
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::isTypeLegal(llvm::Type*)
Line
Count
Source
212
651
  bool isTypeLegal(Type *Ty) {
213
651
    EVT VT = getTLI()->getValueType(DL, Ty);
214
651
    return getTLI()->isTypeLegal(VT);
215
651
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::isTypeLegal(llvm::Type*)
216
217
  int getGEPCost(Type *PointeeType, const Value *Ptr,
218
6.47M
                 ArrayRef<const Value *> Operands) {
219
6.47M
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
6.47M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
218
5.83M
                 ArrayRef<const Value *> Operands) {
219
5.83M
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
5.83M
  }
llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
218
1.79k
                 ArrayRef<const Value *> Operands) {
219
1.79k
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
1.79k
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
218
33.1k
                 ArrayRef<const Value *> Operands) {
219
33.1k
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
33.1k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
218
108k
                 ArrayRef<const Value *> Operands) {
219
108k
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
108k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
218
3
                 ArrayRef<const Value *> Operands) {
219
3
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
3
  }
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
331
                 ArrayRef<const Value *> Operands) {
219
331
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
331
  }
llvm::BasicTTIImplBase<llvm::PPCTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
218
746
                 ArrayRef<const Value *> Operands) {
219
746
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
746
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
218
74
                 ArrayRef<const Value *> Operands) {
219
74
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
74
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
218
486k
                 ArrayRef<const Value *> Operands) {
219
486k
    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
220
486k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getGEPCost(llvm::Type*, llvm::Value const*, llvm::ArrayRef<llvm::Value const*>)
221
222
1.69M
  int getExtCost(const Instruction *I, const Value *Src) {
223
1.69M
    if (getTLI()->isExtFree(I))
224
651k
      return TargetTransformInfo::TCC_Free;
225
1.03M
226
1.03M
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)675k
)
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
390k
231
390k
    return TargetTransformInfo::TCC_Basic;
232
390k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
222
1.42M
  int getExtCost(const Instruction *I, const Value *Src) {
223
1.42M
    if (getTLI()->isExtFree(I))
224
618k
      return TargetTransformInfo::TCC_Free;
225
810k
226
810k
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)542k
)
227
736k
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
228
504k
        if (getTLI()->isExtLoad(LI, I, DL))
229
496k
          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
169
  int getExtCost(const Instruction *I, const Value *Src) {
223
169
    if (getTLI()->isExtFree(I))
224
82
      return TargetTransformInfo::TCC_Free;
225
87
226
87
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)77
)
227
87
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
228
33
        if (getTLI()->isExtLoad(LI, I, DL))
229
29
          return TargetTransformInfo::TCC_Free;
230
58
231
58
    return TargetTransformInfo::TCC_Basic;
232
58
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
222
87.1k
  int getExtCost(const Instruction *I, const Value *Src) {
223
87.1k
    if (getTLI()->isExtFree(I))
224
0
      return TargetTransformInfo::TCC_Free;
225
87.1k
226
87.1k
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)43.3k
)
227
87.1k
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
228
57.3k
        if (getTLI()->isExtLoad(LI, I, DL))
229
56.9k
          return TargetTransformInfo::TCC_Free;
230
30.1k
231
30.1k
    return TargetTransformInfo::TCC_Basic;
232
30.1k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
222
6
  int getExtCost(const Instruction *I, const Value *Src) {
223
6
    if (getTLI()->isExtFree(I))
224
0
      return TargetTransformInfo::TCC_Free;
225
6
226
6
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)0
)
227
6
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
228
0
        if (getTLI()->isExtLoad(LI, I, DL))
229
0
          return TargetTransformInfo::TCC_Free;
230
6
231
6
    return TargetTransformInfo::TCC_Basic;
232
6
  }
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
218
  int getExtCost(const Instruction *I, const Value *Src) {
223
218
    if (getTLI()->isExtFree(I))
224
6
      return TargetTransformInfo::TCC_Free;
225
212
226
212
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)92
)
227
212
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
228
108
        if (getTLI()->isExtLoad(LI, I, DL))
229
107
          return TargetTransformInfo::TCC_Free;
230
105
231
105
    return TargetTransformInfo::TCC_Basic;
232
105
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
222
16
  int getExtCost(const Instruction *I, const Value *Src) {
223
16
    if (getTLI()->isExtFree(I))
224
0
      return TargetTransformInfo::TCC_Free;
225
16
226
16
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)4
)
227
16
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
228
9
        if (getTLI()->isExtLoad(LI, I, DL))
229
9
          return TargetTransformInfo::TCC_Free;
230
7
231
7
    return TargetTransformInfo::TCC_Basic;
232
7
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getExtCost(llvm::Instruction const*, llvm::Value const*)
Line
Count
Source
222
174k
  int getExtCost(const Instruction *I, const Value *Src) {
223
174k
    if (getTLI()->isExtFree(I))
224
32.6k
      return TargetTransformInfo::TCC_Free;
225
142k
226
142k
    if (isa<ZExtInst>(I) || 
isa<SExtInst>(I)89.1k
)
227
142k
      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
228
96.3k
        if (getTLI()->isExtLoad(LI, I, DL))
229
96.0k
          return TargetTransformInfo::TCC_Free;
230
45.9k
231
45.9k
    return TargetTransformInfo::TCC_Basic;
232
45.9k
  }
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.15M
                            ArrayRef<Type *> ParamTys) {
241
1.15M
    if (IID == Intrinsic::cttz) {
242
9.98k
      if (getTLI()->isCheapToSpeculateCttz())
243
4.71k
        return TargetTransformInfo::TCC_Basic;
244
5.26k
      return TargetTransformInfo::TCC_Expensive;
245
5.26k
    }
246
1.14M
247
1.14M
    if (IID == Intrinsic::ctlz) {
248
15.1k
      if (getTLI()->isCheapToSpeculateCtlz())
249
8.77k
        return TargetTransformInfo::TCC_Basic;
250
6.37k
      return TargetTransformInfo::TCC_Expensive;
251
6.37k
    }
252
1.12M
253
1.12M
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
254
1.12M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
240
828k
                            ArrayRef<Type *> ParamTys) {
241
828k
    if (IID == Intrinsic::cttz) {
242
855
      if (getTLI()->isCheapToSpeculateCttz())
243
855
        return TargetTransformInfo::TCC_Basic;
244
0
      return TargetTransformInfo::TCC_Expensive;
245
0
    }
246
827k
247
827k
    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
825k
253
825k
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
254
825k
  }
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
814
                            ArrayRef<Type *> ParamTys) {
241
814
    if (IID == Intrinsic::cttz) {
242
12
      if (getTLI()->isCheapToSpeculateCttz())
243
12
        return TargetTransformInfo::TCC_Basic;
244
0
      return TargetTransformInfo::TCC_Expensive;
245
0
    }
246
802
247
802
    if (IID == Intrinsic::ctlz) {
248
12
      if (getTLI()->isCheapToSpeculateCtlz())
249
12
        return TargetTransformInfo::TCC_Basic;
250
0
      return TargetTransformInfo::TCC_Expensive;
251
0
    }
252
790
253
790
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
254
790
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
Line
Count
Source
240
87.5k
                            ArrayRef<Type *> ParamTys) {
241
87.5k
    if (IID == Intrinsic::cttz) {
242
2.57k
      if (getTLI()->isCheapToSpeculateCttz())
243
2.51k
        return TargetTransformInfo::TCC_Basic;
244
58
      return TargetTransformInfo::TCC_Expensive;
245
58
    }
246
84.9k
247
84.9k
    if (IID == Intrinsic::ctlz) {
248
6.22k
      if (getTLI()->isCheapToSpeculateCtlz())
249
5.70k
        return TargetTransformInfo::TCC_Basic;
250
525
      return TargetTransformInfo::TCC_Expensive;
251
525
    }
252
78.7k
253
78.7k
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
254
78.7k
  }
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
234k
                            ArrayRef<Type *> ParamTys) {
241
234k
    if (IID == Intrinsic::cttz) {
242
6.54k
      if (getTLI()->isCheapToSpeculateCttz())
243
1.33k
        return TargetTransformInfo::TCC_Basic;
244
5.20k
      return TargetTransformInfo::TCC_Expensive;
245
5.20k
    }
246
227k
247
227k
    if (IID == Intrinsic::ctlz) {
248
7.13k
      if (getTLI()->isCheapToSpeculateCtlz())
249
1.28k
        return TargetTransformInfo::TCC_Basic;
250
5.85k
      return TargetTransformInfo::TCC_Expensive;
251
5.85k
    }
252
220k
253
220k
    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
254
220k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getIntrinsicCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRef<llvm::Type*>)
255
256
  unsigned getEstimatedNumberOfCaseClusters(const SwitchInst &SI,
257
39.2k
                                            unsigned &JumpTableSize) {
258
39.2k
    /// Try to find the estimated number of clusters. Note that the number of
259
39.2k
    /// clusters identified in this function could be different from the actural
260
39.2k
    /// numbers found in lowering. This function ignore switches that are
261
39.2k
    /// lowered with a mix of jump table / bit test / BTree. This function was
262
39.2k
    /// initially intended to be used when estimating the cost of switch in
263
39.2k
    /// inline cost heuristic, but it's a generic cost model to be used in other
264
39.2k
    /// places (e.g., in loop unrolling).
265
39.2k
    unsigned N = SI.getNumCases();
266
39.2k
    const TargetLoweringBase *TLI = getTLI();
267
39.2k
    const DataLayout &DL = this->getDataLayout();
268
39.2k
269
39.2k
    JumpTableSize = 0;
270
39.2k
    bool IsJTAllowed = TLI->areJTsAllowed(SI.getParent()->getParent());
271
39.2k
272
39.2k
    // Early exit if both a jump table and bit test are not allowed.
273
39.2k
    if (N < 1 || (!IsJTAllowed && 
DL.getIndexSizeInBits(0u) < N0
))
274
0
      return N;
275
39.2k
276
39.2k
    APInt MaxCaseVal = SI.case_begin()->getCaseValue()->getValue();
277
39.2k
    APInt MinCaseVal = MaxCaseVal;
278
382k
    for (auto CI : SI.cases()) {
279
382k
      const APInt &CaseVal = CI.getCaseValue()->getValue();
280
382k
      if (CaseVal.sgt(MaxCaseVal))
281
67.4k
        MaxCaseVal = CaseVal;
282
382k
      if (CaseVal.slt(MinCaseVal))
283
41.4k
        MinCaseVal = CaseVal;
284
382k
    }
285
39.2k
286
39.2k
    // Check if suitable for a bit test
287
39.2k
    if (N <= DL.getIndexSizeInBits(0u)) {
288
38.4k
      SmallPtrSet<const BasicBlock *, 4> Dests;
289
38.4k
      for (auto I : SI.cases())
290
240k
        Dests.insert(I.getCaseSuccessor());
291
38.4k
292
38.4k
      if (TLI->isSuitableForBitTests(Dests.size(), N, MinCaseVal, MaxCaseVal,
293
38.4k
                                     DL))
294
5.02k
        return 1;
295
34.2k
    }
296
34.2k
297
34.2k
    // Check if suitable for a jump table.
298
34.2k
    if (IsJTAllowed) {
299
34.2k
      if (N < 2 || N < TLI->getMinimumJumpTableEntries())
300
21.4k
        return N;
301
12.8k
      uint64_t Range =
302
12.8k
          (MaxCaseVal - MinCaseVal)
303
12.8k
              .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1;
304
12.8k
      // Check whether a range of clusters is dense enough for a jump table
305
12.8k
      if (TLI->isSuitableForJumpTable(&SI, N, Range)) {
306
10.6k
        JumpTableSize = Range;
307
10.6k
        return 1;
308
10.6k
      }
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
28.3k
                                            unsigned &JumpTableSize) {
258
28.3k
    /// Try to find the estimated number of clusters. Note that the number of
259
28.3k
    /// clusters identified in this function could be different from the actural
260
28.3k
    /// numbers found in lowering. This function ignore switches that are
261
28.3k
    /// lowered with a mix of jump table / bit test / BTree. This function was
262
28.3k
    /// initially intended to be used when estimating the cost of switch in
263
28.3k
    /// inline cost heuristic, but it's a generic cost model to be used in other
264
28.3k
    /// places (e.g., in loop unrolling).
265
28.3k
    unsigned N = SI.getNumCases();
266
28.3k
    const TargetLoweringBase *TLI = getTLI();
267
28.3k
    const DataLayout &DL = this->getDataLayout();
268
28.3k
269
28.3k
    JumpTableSize = 0;
270
28.3k
    bool IsJTAllowed = TLI->areJTsAllowed(SI.getParent()->getParent());
271
28.3k
272
28.3k
    // Early exit if both a jump table and bit test are not allowed.
273
28.3k
    if (N < 1 || (!IsJTAllowed && 
DL.getIndexSizeInBits(0u) < N0
))
274
0
      return N;
275
28.3k
276
28.3k
    APInt MaxCaseVal = SI.case_begin()->getCaseValue()->getValue();
277
28.3k
    APInt MinCaseVal = MaxCaseVal;
278
337k
    for (auto CI : SI.cases()) {
279
337k
      const APInt &CaseVal = CI.getCaseValue()->getValue();
280
337k
      if (CaseVal.sgt(MaxCaseVal))
281
49.0k
        MaxCaseVal = CaseVal;
282
337k
      if (CaseVal.slt(MinCaseVal))
283
32.5k
        MinCaseVal = CaseVal;
284
337k
    }
285
28.3k
286
28.3k
    // Check if suitable for a bit test
287
28.3k
    if (N <= DL.getIndexSizeInBits(0u)) {
288
27.5k
      SmallPtrSet<const BasicBlock *, 4> Dests;
289
27.5k
      for (auto I : SI.cases())
290
196k
        Dests.insert(I.getCaseSuccessor());
291
27.5k
292
27.5k
      if (TLI->isSuitableForBitTests(Dests.size(), N, MinCaseVal, MaxCaseVal,
293
27.5k
                                     DL))
294
2.45k
        return 1;
295
25.8k
    }
296
25.8k
297
25.8k
    // Check if suitable for a jump table.
298
25.8k
    if (IsJTAllowed) {
299
25.8k
      if (N < 2 || N < TLI->getMinimumJumpTableEntries())
300
16.0k
        return N;
301
9.84k
      uint64_t Range =
302
9.84k
          (MaxCaseVal - MinCaseVal)
303
9.84k
              .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1;
304
9.84k
      // Check whether a range of clusters is dense enough for a jump table
305
9.84k
      if (TLI->isSuitableForJumpTable(&SI, N, Range)) {
306
8.11k
        JumpTableSize = Range;
307
8.11k
        return 1;
308
8.11k
      }
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.16k
                                            unsigned &JumpTableSize) {
258
2.16k
    /// Try to find the estimated number of clusters. Note that the number of
259
2.16k
    /// clusters identified in this function could be different from the actural
260
2.16k
    /// numbers found in lowering. This function ignore switches that are
261
2.16k
    /// lowered with a mix of jump table / bit test / BTree. This function was
262
2.16k
    /// initially intended to be used when estimating the cost of switch in
263
2.16k
    /// inline cost heuristic, but it's a generic cost model to be used in other
264
2.16k
    /// places (e.g., in loop unrolling).
265
2.16k
    unsigned N = SI.getNumCases();
266
2.16k
    const TargetLoweringBase *TLI = getTLI();
267
2.16k
    const DataLayout &DL = this->getDataLayout();
268
2.16k
269
2.16k
    JumpTableSize = 0;
270
2.16k
    bool IsJTAllowed = TLI->areJTsAllowed(SI.getParent()->getParent());
271
2.16k
272
2.16k
    // Early exit if both a jump table and bit test are not allowed.
273
2.16k
    if (N < 1 || (!IsJTAllowed && 
DL.getIndexSizeInBits(0u) < N0
))
274
0
      return N;
275
2.16k
276
2.16k
    APInt MaxCaseVal = SI.case_begin()->getCaseValue()->getValue();
277
2.16k
    APInt MinCaseVal = MaxCaseVal;
278
9.11k
    for (auto CI : SI.cases()) {
279
9.11k
      const APInt &CaseVal = CI.getCaseValue()->getValue();
280
9.11k
      if (CaseVal.sgt(MaxCaseVal))
281
3.49k
        MaxCaseVal = CaseVal;
282
9.11k
      if (CaseVal.slt(MinCaseVal))
283
1.76k
        MinCaseVal = CaseVal;
284
9.11k
    }
285
2.16k
286
2.16k
    // Check if suitable for a bit test
287
2.16k
    if (N <= DL.getIndexSizeInBits(0u)) {
288
2.16k
      SmallPtrSet<const BasicBlock *, 4> Dests;
289
2.16k
      for (auto I : SI.cases())
290
9.11k
        Dests.insert(I.getCaseSuccessor());
291
2.16k
292
2.16k
      if (TLI->isSuitableForBitTests(Dests.size(), N, MinCaseVal, MaxCaseVal,
293
2.16k
                                     DL))
294
138
        return 1;
295
2.02k
    }
296
2.02k
297
2.02k
    // Check if suitable for a jump table.
298
2.02k
    if (IsJTAllowed) {
299
2.02k
      if (N < 2 || N < TLI->getMinimumJumpTableEntries())
300
1.22k
        return N;
301
801
      uint64_t Range =
302
801
          (MaxCaseVal - MinCaseVal)
303
801
              .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1;
304
801
      // Check whether a range of clusters is dense enough for a jump table
305
801
      if (TLI->isSuitableForJumpTable(&SI, N, Range)) {
306
666
        JumpTableSize = Range;
307
666
        return 1;
308
666
      }
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.78k
                                            unsigned &JumpTableSize) {
258
8.78k
    /// Try to find the estimated number of clusters. Note that the number of
259
8.78k
    /// clusters identified in this function could be different from the actural
260
8.78k
    /// numbers found in lowering. This function ignore switches that are
261
8.78k
    /// lowered with a mix of jump table / bit test / BTree. This function was
262
8.78k
    /// initially intended to be used when estimating the cost of switch in
263
8.78k
    /// inline cost heuristic, but it's a generic cost model to be used in other
264
8.78k
    /// places (e.g., in loop unrolling).
265
8.78k
    unsigned N = SI.getNumCases();
266
8.78k
    const TargetLoweringBase *TLI = getTLI();
267
8.78k
    const DataLayout &DL = this->getDataLayout();
268
8.78k
269
8.78k
    JumpTableSize = 0;
270
8.78k
    bool IsJTAllowed = TLI->areJTsAllowed(SI.getParent()->getParent());
271
8.78k
272
8.78k
    // Early exit if both a jump table and bit test are not allowed.
273
8.78k
    if (N < 1 || (!IsJTAllowed && 
DL.getIndexSizeInBits(0u) < N0
))
274
0
      return N;
275
8.78k
276
8.78k
    APInt MaxCaseVal = SI.case_begin()->getCaseValue()->getValue();
277
8.78k
    APInt MinCaseVal = MaxCaseVal;
278
35.3k
    for (auto CI : SI.cases()) {
279
35.3k
      const APInt &CaseVal = CI.getCaseValue()->getValue();
280
35.3k
      if (CaseVal.sgt(MaxCaseVal))
281
14.9k
        MaxCaseVal = CaseVal;
282
35.3k
      if (CaseVal.slt(MinCaseVal))
283
7.07k
        MinCaseVal = CaseVal;
284
35.3k
    }
285
8.78k
286
8.78k
    // Check if suitable for a bit test
287
8.78k
    if (N <= DL.getIndexSizeInBits(0u)) {
288
8.78k
      SmallPtrSet<const BasicBlock *, 4> Dests;
289
8.78k
      for (auto I : SI.cases())
290
35.1k
        Dests.insert(I.getCaseSuccessor());
291
8.78k
292
8.78k
      if (TLI->isSuitableForBitTests(Dests.size(), N, MinCaseVal, MaxCaseVal,
293
8.78k
                                     DL))
294
2.42k
        return 1;
295
6.36k
    }
296
6.36k
297
6.36k
    // Check if suitable for a jump table.
298
6.36k
    if (IsJTAllowed) {
299
6.36k
      if (N < 2 || N < TLI->getMinimumJumpTableEntries())
300
4.15k
        return N;
301
2.20k
      uint64_t Range =
302
2.20k
          (MaxCaseVal - MinCaseVal)
303
2.20k
              .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1;
304
2.20k
      // Check whether a range of clusters is dense enough for a jump table
305
2.20k
      if (TLI->isSuitableForJumpTable(&SI, N, Range)) {
306
1.83k
        JumpTableSize = Range;
307
1.83k
        return 1;
308
1.83k
      }
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.4k
  bool shouldBuildLookupTables() {
318
61.4k
    const TargetLoweringBase *TLI = getTLI();
319
61.4k
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
320
61.4k
           
TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other)60.3k
;
321
61.4k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::shouldBuildLookupTables()
Line
Count
Source
317
57.3k
  bool shouldBuildLookupTables() {
318
57.3k
    const TargetLoweringBase *TLI = getTLI();
319
57.3k
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
320
57.3k
           TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other);
321
57.3k
  }
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
12
  bool shouldBuildLookupTables() {
318
12
    const TargetLoweringBase *TLI = getTLI();
319
12
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
320
12
           TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other);
321
12
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::shouldBuildLookupTables()
Line
Count
Source
317
1.09k
  bool shouldBuildLookupTables() {
318
1.09k
    const TargetLoweringBase *TLI = getTLI();
319
1.09k
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
320
1.09k
           
TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other)0
;
321
1.09k
  }
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
2.96k
  bool shouldBuildLookupTables() {
318
2.96k
    const TargetLoweringBase *TLI = getTLI();
319
2.96k
    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
320
2.96k
           TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other);
321
2.96k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::shouldBuildLookupTables()
322
323
55
  bool haveFastSqrt(Type *Ty) {
324
55
    const TargetLoweringBase *TLI = getTLI();
325
55
    EVT VT = TLI->getValueType(DL, Ty);
326
55
    return TLI->isTypeLegal(VT) &&
327
55
           
TLI->isOperationLegalOrCustom(ISD::FSQRT, VT)53
;
328
55
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::haveFastSqrt(llvm::Type*)
Line
Count
Source
323
1
  bool haveFastSqrt(Type *Ty) {
324
1
    const TargetLoweringBase *TLI = getTLI();
325
1
    EVT VT = TLI->getValueType(DL, Ty);
326
1
    return TLI->isTypeLegal(VT) &&
327
1
           TLI->isOperationLegalOrCustom(ISD::FSQRT, VT);
328
1
  }
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
513k
  unsigned getFPOpCost(Type *Ty) {
335
513k
    // Check whether FADD is available, as a proxy for floating-point in
336
513k
    // general.
337
513k
    const TargetLoweringBase *TLI = getTLI();
338
513k
    EVT VT = TLI->getValueType(DL, Ty);
339
513k
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
340
511k
      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
512k
  unsigned getFPOpCost(Type *Ty) {
335
512k
    // Check whether FADD is available, as a proxy for floating-point in
336
512k
    // general.
337
512k
    const TargetLoweringBase *TLI = getTLI();
338
512k
    EVT VT = TLI->getValueType(DL, Ty);
339
512k
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
340
510k
      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
729
  unsigned getFPOpCost(Type *Ty) {
335
729
    // Check whether FADD is available, as a proxy for floating-point in
336
729
    // general.
337
729
    const TargetLoweringBase *TLI = getTLI();
338
729
    EVT VT = TLI->getValueType(DL, Ty);
339
729
    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
340
729
      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.5M
;
348
26.2M
    case Instruction::Trunc:
349
718k
      if (TLI->isTruncateFree(OpTy, Ty))
350
670k
        return TargetTransformInfo::TCC_Free;
351
47.3k
      return TargetTransformInfo::TCC_Basic;
352
47.3k
    case Instruction::ZExt:
353
0
      if (TLI->isZExtFree(OpTy, Ty))
354
0
        return TargetTransformInfo::TCC_Free;
355
0
      return TargetTransformInfo::TCC_Basic;
356
25.5M
    }
357
25.5M
358
25.5M
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
25.5M
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
344
23.9M
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
23.9M
    const TargetLoweringBase *TLI = getTLI();
346
23.9M
    switch (Opcode) {
347
23.9M
    
default: break23.3M
;
348
23.9M
    case Instruction::Trunc:
349
628k
      if (TLI->isTruncateFree(OpTy, Ty))
350
585k
        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.21k
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
5.21k
    const TargetLoweringBase *TLI = getTLI();
346
5.21k
    switch (Opcode) {
347
5.21k
    
default: break5.17k
;
348
5.21k
    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.17k
    }
357
5.17k
358
5.17k
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
5.17k
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
344
547k
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
547k
    const TargetLoweringBase *TLI = getTLI();
346
547k
    switch (Opcode) {
347
547k
    
default: break534k
;
348
547k
    case Instruction::Trunc:
349
13.4k
      if (TLI->isTruncateFree(OpTy, Ty))
350
8.95k
        return TargetTransformInfo::TCC_Free;
351
4.52k
      return TargetTransformInfo::TCC_Basic;
352
4.52k
    case Instruction::ZExt:
353
0
      if (TLI->isZExtFree(OpTy, Ty))
354
0
        return TargetTransformInfo::TCC_Free;
355
0
      return TargetTransformInfo::TCC_Basic;
356
534k
    }
357
534k
358
534k
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
534k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
344
86
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
86
    const TargetLoweringBase *TLI = getTLI();
346
86
    switch (Opcode) {
347
86
    
default: break78
;
348
86
    case Instruction::Trunc:
349
8
      if (TLI->isTruncateFree(OpTy, Ty))
350
0
        return TargetTransformInfo::TCC_Free;
351
8
      return TargetTransformInfo::TCC_Basic;
352
8
    case Instruction::ZExt:
353
0
      if (TLI->isZExtFree(OpTy, Ty))
354
0
        return TargetTransformInfo::TCC_Free;
355
0
      return TargetTransformInfo::TCC_Basic;
356
78
    }
357
78
358
78
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
78
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::LanaiTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
llvm::BasicTTIImplBase<llvm::BasicTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
344
2
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
2
    const TargetLoweringBase *TLI = getTLI();
346
2
    switch (Opcode) {
347
2
    default: break;
348
2
    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
2
    }
357
2
358
2
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
2
  }
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.11k
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
5.11k
    const TargetLoweringBase *TLI = getTLI();
346
5.11k
    switch (Opcode) {
347
5.11k
    
default: break4.96k
;
348
5.11k
    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.96k
    }
357
4.96k
358
4.96k
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
4.96k
  }
llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
344
1.02k
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
1.02k
    const TargetLoweringBase *TLI = getTLI();
346
1.02k
    switch (Opcode) {
347
1.02k
    
default: break1.00k
;
348
1.02k
    case Instruction::Trunc:
349
16
      if (TLI->isTruncateFree(OpTy, Ty))
350
13
        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.00k
    }
357
1.00k
358
1.00k
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
1.00k
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
Line
Count
Source
344
1.75M
  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
345
1.75M
    const TargetLoweringBase *TLI = getTLI();
346
1.75M
    switch (Opcode) {
347
1.75M
    
default: break1.67M
;
348
1.75M
    case Instruction::Trunc:
349
76.3k
      if (TLI->isTruncateFree(OpTy, Ty))
350
76.2k
        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.67M
    }
357
1.67M
358
1.67M
    return BaseT::getOperationCost(Opcode, Ty, OpTy);
359
1.67M
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getOperationCost(unsigned int, llvm::Type*, llvm::Type*)
360
361
699k
  unsigned getInliningThresholdMultiplier() { return 1; }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
361
420k
  unsigned getInliningThresholdMultiplier() { return 1; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getInliningThresholdMultiplier()
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
361
76.1k
  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; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::SystemZTTIImpl>::getInliningThresholdMultiplier()
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getInliningThresholdMultiplier()
Line
Count
Source
361
202k
  unsigned getInliningThresholdMultiplier() { return 1; }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getInliningThresholdMultiplier()
362
363
  void getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
364
378k
                               TTI::UnrollingPreferences &UP) {
365
378k
    // This unrolling functionality is target independent, but to provide some
366
378k
    // motivation for its intended use, for x86:
367
378k
368
378k
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
369
378k
    // Manual, Intel Core models and later have a loop stream detector (and
370
378k
    // associated uop queue) that can benefit from partial unrolling.
371
378k
    // The relevant requirements are:
372
378k
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
373
378k
    //    taken, and none of them may be calls.
374
378k
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
375
378k
376
378k
    // According to the Software Optimization Guide for AMD Family 15h
377
378k
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
378
378k
    // and loop buffer which can benefit from partial unrolling.
379
378k
    // The relevant requirements are:
380
378k
    //  - The loop must have fewer than 16 branches
381
378k
    //  - The loop must have less than 40 uops in all executed loop branches
382
378k
383
378k
    // The number of taken branches in a loop is hard to estimate here, and
384
378k
    // benchmarking has revealed that it is better not to be conservative when
385
378k
    // estimating the branch count. As a result, we'll ignore the branch limits
386
378k
    // until someone finds a case where it matters in practice.
387
378k
388
378k
    unsigned MaxOps;
389
378k
    const TargetSubtargetInfo *ST = getST();
390
378k
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
391
0
      MaxOps = PartialUnrollingThreshold;
392
378k
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
393
22.5k
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
394
355k
    else
395
355k
      return;
396
22.5k
397
22.5k
    // Scan the loop: don't unroll loops with calls.
398
69.5k
    
for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); 22.5k
I != E;
399
57.0k
         
++I47.0k
) {
400
57.0k
      BasicBlock *BB = *I;
401
57.0k
402
379k
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; 
++J322k
)
403
332k
        if (isa<CallInst>(J) || 
isa<InvokeInst>(J)317k
) {
404
15.5k
          ImmutableCallSite CS(&*J);
405
15.5k
          if (const Function *F = CS.getCalledFunction()) {
406
14.0k
            if (!static_cast<T *>(this)->isLoweredToCall(F))
407
5.53k
              continue;
408
10.0k
          }
409
10.0k
410
10.0k
          return;
411
10.0k
        }
412
57.0k
    }
413
22.5k
414
22.5k
    // Enable runtime and partial unrolling up to the specified size.
415
22.5k
    // Enable using trip count upper bound to unroll loops.
416
22.5k
    UP.Partial = UP.Runtime = UP.UpperBound = true;
417
12.5k
    UP.PartialThreshold = MaxOps;
418
12.5k
419
12.5k
    // Avoid unrolling when optimizing for size.
420
12.5k
    UP.OptSizeThreshold = 0;
421
12.5k
    UP.PartialOptSizeThreshold = 0;
422
12.5k
423
12.5k
    // Set number of instructions optimized when "back edge"
424
12.5k
    // becomes "fall through" to default value of 2.
425
12.5k
    UP.BEInsns = 2;
426
12.5k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&)
Line
Count
Source
364
349k
                               TTI::UnrollingPreferences &UP) {
365
349k
    // This unrolling functionality is target independent, but to provide some
366
349k
    // motivation for its intended use, for x86:
367
349k
368
349k
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
369
349k
    // Manual, Intel Core models and later have a loop stream detector (and
370
349k
    // associated uop queue) that can benefit from partial unrolling.
371
349k
    // The relevant requirements are:
372
349k
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
373
349k
    //    taken, and none of them may be calls.
374
349k
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
375
349k
376
349k
    // According to the Software Optimization Guide for AMD Family 15h
377
349k
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
378
349k
    // and loop buffer which can benefit from partial unrolling.
379
349k
    // The relevant requirements are:
380
349k
    //  - The loop must have fewer than 16 branches
381
349k
    //  - The loop must have less than 40 uops in all executed loop branches
382
349k
383
349k
    // The number of taken branches in a loop is hard to estimate here, and
384
349k
    // benchmarking has revealed that it is better not to be conservative when
385
349k
    // estimating the branch count. As a result, we'll ignore the branch limits
386
349k
    // until someone finds a case where it matters in practice.
387
349k
388
349k
    unsigned MaxOps;
389
349k
    const TargetSubtargetInfo *ST = getST();
390
349k
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
391
0
      MaxOps = PartialUnrollingThreshold;
392
349k
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
393
16
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
394
348k
    else
395
348k
      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.73k
                               TTI::UnrollingPreferences &UP) {
365
6.73k
    // This unrolling functionality is target independent, but to provide some
366
6.73k
    // motivation for its intended use, for x86:
367
6.73k
368
6.73k
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
369
6.73k
    // Manual, Intel Core models and later have a loop stream detector (and
370
6.73k
    // associated uop queue) that can benefit from partial unrolling.
371
6.73k
    // The relevant requirements are:
372
6.73k
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
373
6.73k
    //    taken, and none of them may be calls.
374
6.73k
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
375
6.73k
376
6.73k
    // According to the Software Optimization Guide for AMD Family 15h
377
6.73k
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
378
6.73k
    // and loop buffer which can benefit from partial unrolling.
379
6.73k
    // The relevant requirements are:
380
6.73k
    //  - The loop must have fewer than 16 branches
381
6.73k
    //  - The loop must have less than 40 uops in all executed loop branches
382
6.73k
383
6.73k
    // The number of taken branches in a loop is hard to estimate here, and
384
6.73k
    // benchmarking has revealed that it is better not to be conservative when
385
6.73k
    // estimating the branch count. As a result, we'll ignore the branch limits
386
6.73k
    // until someone finds a case where it matters in practice.
387
6.73k
388
6.73k
    unsigned MaxOps;
389
6.73k
    const TargetSubtargetInfo *ST = getST();
390
6.73k
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
391
0
      MaxOps = PartialUnrollingThreshold;
392
6.73k
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
393
15
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
394
6.71k
    else
395
6.71k
      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
22.6k
                               TTI::UnrollingPreferences &UP) {
365
22.6k
    // This unrolling functionality is target independent, but to provide some
366
22.6k
    // motivation for its intended use, for x86:
367
22.6k
368
22.6k
    // According to the Intel 64 and IA-32 Architectures Optimization Reference
369
22.6k
    // Manual, Intel Core models and later have a loop stream detector (and
370
22.6k
    // associated uop queue) that can benefit from partial unrolling.
371
22.6k
    // The relevant requirements are:
372
22.6k
    //  - The loop must have no more than 4 (8 for Nehalem and later) branches
373
22.6k
    //    taken, and none of them may be calls.
374
22.6k
    //  - The loop can have no more than 18 (28 for Nehalem and later) uops.
375
22.6k
376
22.6k
    // According to the Software Optimization Guide for AMD Family 15h
377
22.6k
    // Processors, models 30h-4fh (Steamroller and later) have a loop predictor
378
22.6k
    // and loop buffer which can benefit from partial unrolling.
379
22.6k
    // The relevant requirements are:
380
22.6k
    //  - The loop must have fewer than 16 branches
381
22.6k
    //  - The loop must have less than 40 uops in all executed loop branches
382
22.6k
383
22.6k
    // The number of taken branches in a loop is hard to estimate here, and
384
22.6k
    // benchmarking has revealed that it is better not to be conservative when
385
22.6k
    // estimating the branch count. As a result, we'll ignore the branch limits
386
22.6k
    // until someone finds a case where it matters in practice.
387
22.6k
388
22.6k
    unsigned MaxOps;
389
22.6k
    const TargetSubtargetInfo *ST = getST();
390
22.6k
    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
391
0
      MaxOps = PartialUnrollingThreshold;
392
22.6k
    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
393
22.4k
      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
394
152
    else
395
152
      return;
396
22.4k
397
22.4k
    // Scan the loop: don't unroll loops with calls.
398
69.4k
    
for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); 22.4k
I != E;
399
56.9k
         
++I46.9k
) {
400
56.9k
      BasicBlock *BB = *I;
401
56.9k
402
379k
      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; 
++J322k
)
403
332k
        if (isa<CallInst>(J) || 
isa<InvokeInst>(J)317k
) {
404
15.5k
          ImmutableCallSite CS(&*J);
405
15.5k
          if (const Function *F = CS.getCalledFunction()) {
406
14.0k
            if (!static_cast<T *>(this)->isLoweredToCall(F))
407
5.52k
              continue;
408
10.0k
          }
409
10.0k
410
10.0k
          return;
411
10.0k
        }
412
56.9k
    }
413
22.4k
414
22.4k
    // Enable runtime and partial unrolling up to the specified size.
415
22.4k
    // Enable using trip count upper bound to unroll loops.
416
22.4k
    UP.Partial = UP.Runtime = UP.UpperBound = true;
417
12.4k
    UP.PartialThreshold = MaxOps;
418
12.4k
419
12.4k
    // Avoid unrolling when optimizing for size.
420
12.4k
    UP.OptSizeThreshold = 0;
421
12.4k
    UP.PartialOptSizeThreshold = 0;
422
12.4k
423
12.4k
    // Set number of instructions optimized when "back edge"
424
12.4k
    // becomes "fall through" to default value of 2.
425
12.4k
    UP.BEInsns = 2;
426
12.4k
  }
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
81.2k
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
447
81.2k
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
448
81.2k
    unsigned Cost = 0;
449
81.2k
450
335k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i254k
) {
451
254k
      if (Insert)
452
136k
        Cost += static_cast<T *>(this)
453
136k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
454
254k
      if (Extract)
455
121k
        Cost += static_cast<T *>(this)
456
121k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
457
254k
    }
458
81.2k
459
81.2k
    return Cost;
460
81.2k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
446
65.8k
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
447
65.8k
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
448
65.8k
    unsigned Cost = 0;
449
65.8k
450
242k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i176k
) {
451
176k
      if (Insert)
452
92.7k
        Cost += static_cast<T *>(this)
453
92.7k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
454
176k
      if (Extract)
455
83.7k
        Cost += static_cast<T *>(this)
456
83.7k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
457
176k
    }
458
65.8k
459
65.8k
    return Cost;
460
65.8k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::R600TTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
446
283
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
447
283
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
448
283
    unsigned Cost = 0;
449
283
450
1.37k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i1.09k
) {
451
1.09k
      if (Insert)
452
674
        Cost += static_cast<T *>(this)
453
674
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
454
1.09k
      if (Extract)
455
425
        Cost += static_cast<T *>(this)
456
425
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
457
1.09k
    }
458
283
459
283
    return Cost;
460
283
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
446
3.05k
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
447
3.05k
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
448
3.05k
    unsigned Cost = 0;
449
3.05k
450
10.6k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i7.61k
) {
451
7.61k
      if (Insert)
452
2.79k
        Cost += static_cast<T *>(this)
453
2.79k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
454
7.61k
      if (Extract)
455
5.05k
        Cost += static_cast<T *>(this)
456
5.05k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
457
7.61k
    }
458
3.05k
459
3.05k
    return Cost;
460
3.05k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
446
2
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
447
2
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
448
2
    unsigned Cost = 0;
449
2
450
26
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i24
) {
451
24
      if (Insert)
452
0
        Cost += static_cast<T *>(this)
453
0
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
454
24
      if (Extract)
455
24
        Cost += static_cast<T *>(this)
456
24
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
457
24
    }
458
2
459
2
    return Cost;
460
2
  }
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
257
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
447
257
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
448
257
    unsigned Cost = 0;
449
257
450
2.00k
    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
982
        Cost += static_cast<T *>(this)
456
982
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
457
1.75k
    }
458
257
459
257
    return Cost;
460
257
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getScalarizationOverhead(llvm::Type*, bool, bool)
Line
Count
Source
446
11.7k
  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
447
11.7k
    assert(Ty->isVectorTy() && "Can only scalarize vectors");
448
11.7k
    unsigned Cost = 0;
449
11.7k
450
79.3k
    for (int i = 0, e = Ty->getVectorNumElements(); i < e; 
++i67.5k
) {
451
67.5k
      if (Insert)
452
38.1k
        Cost += static_cast<T *>(this)
453
38.1k
                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
454
67.5k
      if (Extract)
455
31.5k
        Cost += static_cast<T *>(this)
456
31.5k
                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
457
67.5k
    }
458
11.7k
459
11.7k
    return Cost;
460
11.7k
  }
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
20.1k
                                            unsigned VF) {
467
20.1k
    unsigned Cost = 0;
468
20.1k
    SmallPtrSet<const Value*, 4> UniqueOperands;
469
27.7k
    for (const Value *A : Args) {
470
27.7k
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second24.1k
) {
471
24.1k
        Type *VecTy = nullptr;
472
24.1k
        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
23.5k
        else
479
23.5k
          VecTy = VectorType::get(A->getType(), VF);
480
24.1k
481
24.1k
        Cost += getScalarizationOverhead(VecTy, false, true);
482
24.1k
      }
483
27.7k
    }
484
20.1k
485
20.1k
    return Cost;
486
20.1k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
466
15.5k
                                            unsigned VF) {
467
15.5k
    unsigned Cost = 0;
468
15.5k
    SmallPtrSet<const Value*, 4> UniqueOperands;
469
20.3k
    for (const Value *A : Args) {
470
20.3k
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second19.1k
) {
471
19.1k
        Type *VecTy = nullptr;
472
19.1k
        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
19.1k
        else
479
19.1k
          VecTy = VectorType::get(A->getType(), VF);
480
19.1k
481
19.1k
        Cost += getScalarizationOverhead(VecTy, false, true);
482
19.1k
      }
483
20.3k
    }
484
15.5k
485
15.5k
    return Cost;
486
15.5k
  }
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
16
                                            unsigned VF) {
467
16
    unsigned Cost = 0;
468
16
    SmallPtrSet<const Value*, 4> UniqueOperands;
469
28
    for (const Value *A : Args) {
470
28
      if (!isa<Constant>(A) && UniqueOperands.insert(A).second) {
471
28
        Type *VecTy = nullptr;
472
28
        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
22
        else
479
22
          VecTy = VectorType::get(A->getType(), VF);
480
28
481
28
        Cost += getScalarizationOverhead(VecTy, false, true);
482
28
      }
483
28
    }
484
16
485
16
    return Cost;
486
16
  }
llvm::BasicTTIImplBase<llvm::ARMTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
466
631
                                            unsigned VF) {
467
631
    unsigned Cost = 0;
468
631
    SmallPtrSet<const Value*, 4> UniqueOperands;
469
1.14k
    for (const Value *A : Args) {
470
1.14k
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second853
) {
471
853
        Type *VecTy = nullptr;
472
853
        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
853
        else
479
853
          VecTy = VectorType::get(A->getType(), VF);
480
853
481
853
        Cost += getScalarizationOverhead(VecTy, false, true);
482
853
      }
483
1.14k
    }
484
631
485
631
    return Cost;
486
631
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
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
93
                                            unsigned VF) {
467
93
    unsigned Cost = 0;
468
93
    SmallPtrSet<const Value*, 4> UniqueOperands;
469
185
    for (const Value *A : Args) {
470
185
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second1
) {
471
1
        Type *VecTy = nullptr;
472
1
        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
1
        else
479
1
          VecTy = VectorType::get(A->getType(), VF);
480
1
481
1
        Cost += getScalarizationOverhead(VecTy, false, true);
482
1
      }
483
185
    }
484
93
485
93
    return Cost;
486
93
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
Line
Count
Source
466
3.84k
                                            unsigned VF) {
467
3.84k
    unsigned Cost = 0;
468
3.84k
    SmallPtrSet<const Value*, 4> UniqueOperands;
469
5.98k
    for (const Value *A : Args) {
470
5.98k
      if (!isa<Constant>(A) && 
UniqueOperands.insert(A).second4.10k
) {
471
4.10k
        Type *VecTy = nullptr;
472
4.10k
        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.45k
        else
479
3.45k
          VecTy = VectorType::get(A->getType(), VF);
480
4.10k
481
4.10k
        Cost += getScalarizationOverhead(VecTy, false, true);
482
4.10k
      }
483
5.98k
    }
484
3.84k
485
3.84k
    return Cost;
486
3.84k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value const*>, unsigned int)
487
488
5.21k
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
489
5.21k
    assert(VecTy->isVectorTy());
490
5.21k
491
5.21k
    unsigned Cost = 0;
492
5.21k
493
5.21k
    Cost += getScalarizationOverhead(VecTy, true, false);
494
5.21k
    if (!Args.empty())
495
84
      Cost += getOperandsScalarizationOverhead(Args,
496
84
                                               VecTy->getVectorNumElements());
497
5.13k
    else
498
5.13k
      // When no information on arguments is provided, we add the cost
499
5.13k
      // associated with one argument as a heuristic.
500
5.13k
      Cost += getScalarizationOverhead(VecTy, false, true);
501
5.21k
502
5.21k
    return Cost;
503
5.21k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getScalarizationOverhead(llvm::Type*, llvm::ArrayRef<llvm::Value const*>)
Line
Count
Source
488
4.35k
  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
489
4.35k
    assert(VecTy->isVectorTy());
490
4.35k
491
4.35k
    unsigned Cost = 0;
492
4.35k
493
4.35k
    Cost += getScalarizationOverhead(VecTy, true, false);
494
4.35k
    if (!Args.empty())
495
0
      Cost += getOperandsScalarizationOverhead(Args,
496
0
                                               VecTy->getVectorNumElements());
497
4.35k
    else
498
4.35k
      // When no information on arguments is provided, we add the cost
499
4.35k
      // associated with one argument as a heuristic.
500
4.35k
      Cost += getScalarizationOverhead(VecTy, false, true);
501
4.35k
502
4.35k
    return Cost;
503
4.35k
  }
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
65
  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
21
  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
479k
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
514
479k
    // Check if any of the operands are vector operands.
515
479k
    const TargetLoweringBase *TLI = getTLI();
516
479k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
517
479k
    assert(ISD && "Invalid opcode");
518
479k
519
479k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
520
479k
521
479k
    bool IsFloat = Ty->isFPOrFPVectorTy();
522
479k
    // Assume that floating point arithmetic operations cost twice as much as
523
479k
    // integer operations.
524
479k
    unsigned OpCost = (IsFloat ? 
2258k
:
1220k
);
525
479k
526
479k
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
527
425k
      // The operation is legal. Assume it costs 1.
528
425k
      // TODO: Once we have extract/insert subvector cost we need to use them.
529
425k
      return LT.first * OpCost;
530
425k
    }
531
53.7k
532
53.7k
    if (!TLI->isOperationExpand(ISD, LT.second)) {
533
44.6k
      // If the operation is custom lowered, then assume that the code is twice
534
44.6k
      // as expensive.
535
44.6k
      return LT.first * 2 * OpCost;
536
44.6k
    }
537
9.05k
538
9.05k
    // Else, assume that we need to scalarize this op.
539
9.05k
    // TODO: If one of the types get legalized by splitting, handle this
540
9.05k
    // similarly to what getCastInstrCost() does.
541
9.05k
    if (Ty->isVectorTy()) {
542
5.19k
      unsigned Num = Ty->getVectorNumElements();
543
5.19k
      unsigned Cost = static_cast<T *>(this)
544
5.19k
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
545
5.19k
      // Return the cost of multiple scalar invocation plus the cost of
546
5.19k
      // inserting and extracting the values.
547
5.19k
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
548
5.19k
    }
549
3.85k
550
3.85k
    // We don't know anything about this scalar instruction.
551
3.85k
    return OpCost;
552
3.85k
  }
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
395k
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
514
395k
    // Check if any of the operands are vector operands.
515
395k
    const TargetLoweringBase *TLI = getTLI();
516
395k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
517
395k
    assert(ISD && "Invalid opcode");
518
395k
519
395k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
520
395k
521
395k
    bool IsFloat = Ty->isFPOrFPVectorTy();
522
395k
    // Assume that floating point arithmetic operations cost twice as much as
523
395k
    // integer operations.
524
395k
    unsigned OpCost = (IsFloat ? 
2253k
:
1141k
);
525
395k
526
395k
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
527
346k
      // The operation is legal. Assume it costs 1.
528
346k
      // TODO: Once we have extract/insert subvector cost we need to use them.
529
346k
      return LT.first * OpCost;
530
346k
    }
531
48.6k
532
48.6k
    if (!TLI->isOperationExpand(ISD, LT.second)) {
533
43.4k
      // If the operation is custom lowered, then assume that the code is twice
534
43.4k
      // as expensive.
535
43.4k
      return LT.first * 2 * OpCost;
536
43.4k
    }
537
5.17k
538
5.17k
    // Else, assume that we need to scalarize this op.
539
5.17k
    // TODO: If one of the types get legalized by splitting, handle this
540
5.17k
    // similarly to what getCastInstrCost() does.
541
5.17k
    if (Ty->isVectorTy()) {
542
4.35k
      unsigned Num = Ty->getVectorNumElements();
543
4.35k
      unsigned Cost = static_cast<T *>(this)
544
4.35k
                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
545
4.35k
      // Return the cost of multiple scalar invocation plus the cost of
546
4.35k
      // inserting and extracting the values.
547
4.35k
      return getScalarizationOverhead(Ty, Args) + Num * Cost;
548
4.35k
    }
549
816
550
816
    // We don't know anything about this scalar instruction.
551
816
    return OpCost;
552
816
  }
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
12.7k
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
514
12.7k
    // Check if any of the operands are vector operands.
515
12.7k
    const TargetLoweringBase *TLI = getTLI();
516
12.7k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
517
12.7k
    assert(ISD && "Invalid opcode");
518
12.7k
519
12.7k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
520
12.7k
521
12.7k
    bool IsFloat = Ty->isFPOrFPVectorTy();
522
12.7k
    // Assume that floating point arithmetic operations cost twice as much as
523
12.7k
    // integer operations.
524
12.7k
    unsigned OpCost = (IsFloat ? 
22.90k
:
19.83k
);
525
12.7k
526
12.7k
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
527
10.8k
      // The operation is legal. Assume it costs 1.
528
10.8k
      // TODO: Once we have extract/insert subvector cost we need to use them.
529
10.8k
      return LT.first * OpCost;
530
10.8k
    }
531
1.87k
532
1.87k
    if (!TLI->isOperationExpand(ISD, LT.second)) {
533
1.16k
      // If the operation is custom lowered, then assume that the code is twice
534
1.16k
      // as expensive.
535
1.16k
      return LT.first * 2 * OpCost;
536
1.16k
    }
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
18
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
514
18
    // Check if any of the operands are vector operands.
515
18
    const TargetLoweringBase *TLI = getTLI();
516
18
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
517
18
    assert(ISD && "Invalid opcode");
518
18
519
18
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
520
18
521
18
    bool IsFloat = Ty->isFPOrFPVectorTy();
522
18
    // Assume that floating point arithmetic operations cost twice as much as
523
18
    // integer operations.
524
18
    unsigned OpCost = (IsFloat ? 
20
: 1);
525
18
526
18
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
527
18
      // The operation is legal. Assume it costs 1.
528
18
      // TODO: Once we have extract/insert subvector cost we need to use them.
529
18
      return LT.first * OpCost;
530
18
    }
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
254
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
514
254
    // Check if any of the operands are vector operands.
515
254
    const TargetLoweringBase *TLI = getTLI();
516
254
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
517
254
    assert(ISD && "Invalid opcode");
518
254
519
254
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
520
254
521
254
    bool IsFloat = Ty->isFPOrFPVectorTy();
522
254
    // Assume that floating point arithmetic operations cost twice as much as
523
254
    // integer operations.
524
254
    unsigned OpCost = (IsFloat ? 
20
: 1);
525
254
526
254
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
527
186
      // The operation is legal. Assume it costs 1.
528
186
      // TODO: Once we have extract/insert subvector cost we need to use them.
529
186
      return LT.first * OpCost;
530
186
    }
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
70.8k
      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
514
70.8k
    // Check if any of the operands are vector operands.
515
70.8k
    const TargetLoweringBase *TLI = getTLI();
516
70.8k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
517
70.8k
    assert(ISD && "Invalid opcode");
518
70.8k
519
70.8k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
520
70.8k
521
70.8k
    bool IsFloat = Ty->isFPOrFPVectorTy();
522
70.8k
    // Assume that floating point arithmetic operations cost twice as much as
523
70.8k
    // integer operations.
524
70.8k
    unsigned OpCost = (IsFloat ? 
21.70k
:
169.1k
);
525
70.8k
526
70.8k
    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
527
67.7k
      // The operation is legal. Assume it costs 1.
528
67.7k
      // TODO: Once we have extract/insert subvector cost we need to use them.
529
67.7k
      return LT.first * OpCost;
530
67.7k
    }
531
3.07k
532
3.07k
    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
3.07k
538
3.07k
    // Else, assume that we need to scalarize this op.
539
3.07k
    // TODO: If one of the types get legalized by splitting, handle this
540
3.07k
    // similarly to what getCastInstrCost() does.
541
3.07k
    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
3.02k
550
3.02k
    // We don't know anything about this scalar instruction.
551
3.02k
    return OpCost;
552
3.02k
  }
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
61.3k
                          Type *SubTp) {
556
61.3k
    switch (Kind) {
557
61.3k
    case TTI::SK_Select:
558
861
    case TTI::SK_Transpose:
559
861
    case TTI::SK_PermuteSingleSrc:
560
861
    case TTI::SK_PermuteTwoSrc:
561
861
      return getPermuteShuffleOverhead(Tp);
562
60.4k
    default:
563
60.4k
      return 1;
564
61.3k
    }
565
61.3k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type*, int, llvm::Type*)
Line
Count
Source
555
58.1k
                          Type *SubTp) {
556
58.1k
    switch (Kind) {
557
58.1k
    case TTI::SK_Select:
558
685
    case TTI::SK_Transpose:
559
685
    case TTI::SK_PermuteSingleSrc:
560
685
    case TTI::SK_PermuteTwoSrc:
561
685
      return getPermuteShuffleOverhead(Tp);
562
57.4k
    default:
563
57.4k
      return 1;
564
58.1k
    }
565
58.1k
  }
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.97k
                          Type *SubTp) {
556
1.97k
    switch (Kind) {
557
1.97k
    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.97k
    }
565
1.97k
  }
566
567
  unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
568
106k
                            const Instruction *I = nullptr) {
569
106k
    const TargetLoweringBase *TLI = getTLI();
570
106k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
571
106k
    assert(ISD && "Invalid opcode");
572
106k
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
573
106k
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
574
106k
575
106k
    // Check for NOOP conversions.
576
106k
    if (SrcLT.first == DstLT.first &&
577
106k
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()102k
) {
578
34.7k
579
34.7k
      // Bitcast between types that are legalized to the same type are free.
580
34.7k
      if (Opcode == Instruction::BitCast || 
Opcode == Instruction::Trunc24.1k
)
581
12.6k
        return 0;
582
93.8k
    }
583
93.8k
584
93.8k
    if (Opcode == Instruction::Trunc &&
585
93.8k
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)41.6k
)
586
23.3k
      return 0;
587
70.4k
588
70.4k
    if (Opcode == Instruction::ZExt &&
589
70.4k
        
TLI->isZExtFree(SrcLT.second, DstLT.second)18.2k
)
590
4.35k
      return 0;
591
66.1k
592
66.1k
    if (Opcode == Instruction::AddrSpaceCast &&
593
66.1k
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
594
12
                                 Dst->getPointerAddressSpace()))
595
3
      return 0;
596
66.1k
597
66.1k
    // If this is a zext/sext of a load, return 0 if the corresponding
598
66.1k
    // extending load exists on target.
599
66.1k
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt52.2k
) &&
600
66.1k
        
I26.3k
&&
isa<LoadInst>(I->getOperand(0))1.76k
) {
601
772
        EVT ExtVT = EVT::getEVT(Dst);
602
772
        EVT LoadVT = EVT::getEVT(Src);
603
772
        unsigned LType =
604
772
          ((Opcode == Instruction::ZExt) ? 
ISD::ZEXTLOAD528
:
ISD::SEXTLOAD244
);
605
772
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
606
533
          return 0;
607
65.6k
    }
608
65.6k
609
65.6k
    // If the cast is marked as legal (or promote) then assume low cost.
610
65.6k
    if (SrcLT.first == DstLT.first &&
611
65.6k
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)61.6k
)
612
58.5k
      return 1;
613
7.07k
614
7.07k
    // Handle scalar conversions.
615
7.07k
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()2.71k
) {
616
2.71k
      // Scalar bitcasts are usually free.
617
2.71k
      if (Opcode == Instruction::BitCast)
618
108
        return 0;
619
2.60k
620
2.60k
      // Just check the op cost. If the operation is legal then assume it costs
621
2.60k
      // 1.
622
2.60k
      if (!TLI->isOperationExpand(ISD, DstLT.second))
623
2.37k
        return 1;
624
235
625
235
      // Assume that illegal scalar instruction are expensive.
626
235
      return 4;
627
235
    }
628
4.35k
629
4.35k
    // Check vector-to-vector casts.
630
4.35k
    if (Dst->isVectorTy() && Src->isVectorTy()) {
631
4.35k
      // If the cast is between same-sized registers, then the check is simple.
632
4.35k
      if (SrcLT.first == DstLT.first &&
633
4.35k
          
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()1.51k
) {
634
1.29k
635
1.29k
        // Assume that Zext is done using AND.
636
1.29k
        if (Opcode == Instruction::ZExt)
637
641
          return 1;
638
658
639
658
        // Assume that sext is done using SHL and SRA.
640
658
        if (Opcode == Instruction::SExt)
641
73
          return 2;
642
585
643
585
        // Just check the op cost. If the operation is legal then assume it
644
585
        // costs
645
585
        // 1 and multiply by the type-legalization overhead.
646
585
        if (!TLI->isOperationExpand(ISD, DstLT.second))
647
12
          return SrcLT.first * 1;
648
3.63k
      }
649
3.63k
650
3.63k
      // If we are legalizing by splitting, query the concrete TTI for the cost
651
3.63k
      // of casting the original vector twice. We also need to factor in the
652
3.63k
      // cost of the split itself. Count that as 1, to be consistent with
653
3.63k
      // TLI->getTypeLegalizationCost().
654
3.63k
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
655
3.63k
           TargetLowering::TypeSplitVector) ||
656
3.63k
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
657
2.48k
           TargetLowering::TypeSplitVector)) {
658
2.48k
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
659
2.48k
                                         Dst->getVectorNumElements() / 2);
660
2.48k
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
661
2.48k
                                         Src->getVectorNumElements() / 2);
662
2.48k
        T *TTI = static_cast<T *>(this);
663
2.48k
        return TTI->getVectorSplitCost() +
664
2.48k
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
665
2.48k
      }
666
1.14k
667
1.14k
      // In other cases where the source or destination are illegal, assume
668
1.14k
      // the operation will get scalarized.
669
1.14k
      unsigned Num = Dst->getVectorNumElements();
670
1.14k
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
671
1.14k
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
672
1.14k
673
1.14k
      // Return the cost of multiple scalar invocation plus the cost of
674
1.14k
      // inserting and extracting the values.
675
1.14k
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
676
1.14k
    }
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
95.1k
                            const Instruction *I = nullptr) {
569
95.1k
    const TargetLoweringBase *TLI = getTLI();
570
95.1k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
571
95.1k
    assert(ISD && "Invalid opcode");
572
95.1k
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
573
95.1k
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
574
95.1k
575
95.1k
    // Check for NOOP conversions.
576
95.1k
    if (SrcLT.first == DstLT.first &&
577
95.1k
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()93.7k
) {
578
29.2k
579
29.2k
      // Bitcast between types that are legalized to the same type are free.
580
29.2k
      if (Opcode == Instruction::BitCast || 
Opcode == Instruction::Trunc19.9k
)
581
10.9k
        return 0;
582
84.2k
    }
583
84.2k
584
84.2k
    if (Opcode == Instruction::Trunc &&
585
84.2k
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)39.2k
)
586
22.8k
      return 0;
587
61.4k
588
61.4k
    if (Opcode == Instruction::ZExt &&
589
61.4k
        
TLI->isZExtFree(SrcLT.second, DstLT.second)16.2k
)
590
4.13k
      return 0;
591
57.2k
592
57.2k
    if (Opcode == Instruction::AddrSpaceCast &&
593
57.2k
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
594
0
                                 Dst->getPointerAddressSpace()))
595
0
      return 0;
596
57.2k
597
57.2k
    // If this is a zext/sext of a load, return 0 if the corresponding
598
57.2k
    // extending load exists on target.
599
57.2k
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt45.1k
) &&
600
57.2k
        
I24.1k
&&
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
57.2k
    }
608
57.2k
609
57.2k
    // If the cast is marked as legal (or promote) then assume low cost.
610
57.2k
    if (SrcLT.first == DstLT.first &&
611
57.2k
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)55.8k
)
612
54.8k
      return 1;
613
2.46k
614
2.46k
    // Handle scalar conversions.
615
2.46k
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()1.12k
) {
616
1.12k
      // Scalar bitcasts are usually free.
617
1.12k
      if (Opcode == Instruction::BitCast)
618
0
        return 0;
619
1.12k
620
1.12k
      // Just check the op cost. If the operation is legal then assume it costs
621
1.12k
      // 1.
622
1.12k
      if (!TLI->isOperationExpand(ISD, DstLT.second))
623
1.12k
        return 1;
624
0
625
0
      // Assume that illegal scalar instruction are expensive.
626
0
      return 4;
627
0
    }
628
1.33k
629
1.33k
    // Check vector-to-vector casts.
630
1.33k
    if (Dst->isVectorTy() && Src->isVectorTy()) {
631
1.33k
      // If the cast is between same-sized registers, then the check is simple.
632
1.33k
      if (SrcLT.first == DstLT.first &&
633
1.33k
          
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.33k
      }
649
1.33k
650
1.33k
      // If we are legalizing by splitting, query the concrete TTI for the cost
651
1.33k
      // of casting the original vector twice. We also need to factor in the
652
1.33k
      // cost of the split itself. Count that as 1, to be consistent with
653
1.33k
      // TLI->getTypeLegalizationCost().
654
1.33k
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
655
1.33k
           TargetLowering::TypeSplitVector) ||
656
1.33k
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
657
1.29k
           TargetLowering::TypeSplitVector)) {
658
1.29k
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
659
1.29k
                                         Dst->getVectorNumElements() / 2);
660
1.29k
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
661
1.29k
                                         Src->getVectorNumElements() / 2);
662
1.29k
        T *TTI = static_cast<T *>(this);
663
1.29k
        return TTI->getVectorSplitCost() +
664
1.29k
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
665
1.29k
      }
666
39
667
39
      // In other cases where the source or destination are illegal, assume
668
39
      // the operation will get scalarized.
669
39
      unsigned Num = Dst->getVectorNumElements();
670
39
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
671
39
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
672
39
673
39
      // Return the cost of multiple scalar invocation plus the cost of
674
39
      // inserting and extracting the values.
675
39
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
676
39
    }
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.26k
                            const Instruction *I = nullptr) {
569
1.26k
    const TargetLoweringBase *TLI = getTLI();
570
1.26k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
571
1.26k
    assert(ISD && "Invalid opcode");
572
1.26k
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
573
1.26k
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
574
1.26k
575
1.26k
    // Check for NOOP conversions.
576
1.26k
    if (SrcLT.first == DstLT.first &&
577
1.26k
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()905
) {
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
893
    }
583
893
584
893
    if (Opcode == Instruction::Trunc &&
585
893
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)190
)
586
0
      return 0;
587
893
588
893
    if (Opcode == Instruction::ZExt &&
589
893
        
TLI->isZExtFree(SrcLT.second, DstLT.second)240
)
590
0
      return 0;
591
893
592
893
    if (Opcode == Instruction::AddrSpaceCast &&
593
893
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
594
0
                                 Dst->getPointerAddressSpace()))
595
0
      return 0;
596
893
597
893
    // If this is a zext/sext of a load, return 0 if the corresponding
598
893
    // extending load exists on target.
599
893
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt653
) &&
600
893
        
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
893
    }
608
893
609
893
    // If the cast is marked as legal (or promote) then assume low cost.
610
893
    if (SrcLT.first == DstLT.first &&
611
893
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)538
)
612
394
      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
142
                            const Instruction *I = nullptr) {
569
142
    const TargetLoweringBase *TLI = getTLI();
570
142
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
571
142
    assert(ISD && "Invalid opcode");
572
142
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
573
142
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
574
142
575
142
    // Check for NOOP conversions.
576
142
    if (SrcLT.first == DstLT.first &&
577
142
        SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()) {
578
47
579
47
      // Bitcast between types that are legalized to the same type are free.
580
47
      if (Opcode == Instruction::BitCast || Opcode == Instruction::Trunc)
581
3
        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.96k
                            const Instruction *I = nullptr) {
569
9.96k
    const TargetLoweringBase *TLI = getTLI();
570
9.96k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
571
9.96k
    assert(ISD && "Invalid opcode");
572
9.96k
    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
573
9.96k
    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
574
9.96k
575
9.96k
    // Check for NOOP conversions.
576
9.96k
    if (SrcLT.first == DstLT.first &&
577
9.96k
        
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()7.76k
) {
578
4.86k
579
4.86k
      // Bitcast between types that are legalized to the same type are free.
580
4.86k
      if (Opcode == Instruction::BitCast || 
Opcode == Instruction::Trunc3.85k
)
581
1.40k
        return 0;
582
8.55k
    }
583
8.55k
584
8.55k
    if (Opcode == Instruction::Trunc &&
585
8.55k
        
TLI->isTruncateFree(SrcLT.second, DstLT.second)2.16k
)
586
552
      return 0;
587
8.00k
588
8.00k
    if (Opcode == Instruction::ZExt &&
589
8.00k
        
TLI->isZExtFree(SrcLT.second, DstLT.second)1.72k
)
590
219
      return 0;
591
7.78k
592
7.78k
    if (Opcode == Instruction::AddrSpaceCast &&
593
7.78k
        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
594
0
                                 Dst->getPointerAddressSpace()))
595
0
      return 0;
596
7.78k
597
7.78k
    // If this is a zext/sext of a load, return 0 if the corresponding
598
7.78k
    // extending load exists on target.
599
7.78k
    if ((Opcode == Instruction::ZExt || 
Opcode == Instruction::SExt6.28k
) &&
600
7.78k
        
I1.86k
&&
isa<LoadInst>(I->getOperand(0))1.73k
) {
601
760
        EVT ExtVT = EVT::getEVT(Dst);
602
760
        EVT LoadVT = EVT::getEVT(Src);
603
760
        unsigned LType =
604
760
          ((Opcode == Instruction::ZExt) ? 
ISD::ZEXTLOAD522
:
ISD::SEXTLOAD238
);
605
760
        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
606
521
          return 0;
607
7.26k
    }
608
7.26k
609
7.26k
    // If the cast is marked as legal (or promote) then assume low cost.
610
7.26k
    if (SrcLT.first == DstLT.first &&
611
7.26k
        
TLI->isOperationLegalOrPromote(ISD, DstLT.second)5.09k
)
612
3.16k
      return 1;
613
4.10k
614
4.10k
    // Handle scalar conversions.
615
4.10k
    if (!Src->isVectorTy() && 
!Dst->isVectorTy()1.44k
) {
616
1.44k
      // Scalar bitcasts are usually free.
617
1.44k
      if (Opcode == Instruction::BitCast)
618
26
        return 0;
619
1.41k
620
1.41k
      // Just check the op cost. If the operation is legal then assume it costs
621
1.41k
      // 1.
622
1.41k
      if (!TLI->isOperationExpand(ISD, DstLT.second))
623
1.17k
        return 1;
624
235
625
235
      // Assume that illegal scalar instruction are expensive.
626
235
      return 4;
627
235
    }
628
2.66k
629
2.66k
    // Check vector-to-vector casts.
630
2.66k
    if (Dst->isVectorTy() && Src->isVectorTy()) {
631
2.66k
      // If the cast is between same-sized registers, then the check is simple.
632
2.66k
      if (SrcLT.first == DstLT.first &&
633
2.66k
          
SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()1.36k
) {
634
1.22k
635
1.22k
        // Assume that Zext is done using AND.
636
1.22k
        if (Opcode == Instruction::ZExt)
637
641
          return 1;
638
586
639
586
        // Assume that sext is done using SHL and SRA.
640
586
        if (Opcode == Instruction::SExt)
641
73
          return 2;
642
513
643
513
        // Just check the op cost. If the operation is legal then assume it
644
513
        // costs
645
513
        // 1 and multiply by the type-legalization overhead.
646
513
        if (!TLI->isOperationExpand(ISD, DstLT.second))
647
0
          return SrcLT.first * 1;
648
1.94k
      }
649
1.94k
650
1.94k
      // If we are legalizing by splitting, query the concrete TTI for the cost
651
1.94k
      // of casting the original vector twice. We also need to factor in the
652
1.94k
      // cost of the split itself. Count that as 1, to be consistent with
653
1.94k
      // TLI->getTypeLegalizationCost().
654
1.94k
      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
655
1.94k
           TargetLowering::TypeSplitVector) ||
656
1.94k
          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
657
1.13k
           TargetLowering::TypeSplitVector)) {
658
961
        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
659
961
                                         Dst->getVectorNumElements() / 2);
660
961
        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
661
961
                                         Src->getVectorNumElements() / 2);
662
961
        T *TTI = static_cast<T *>(this);
663
961
        return TTI->getVectorSplitCost() +
664
961
               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
665
961
      }
666
986
667
986
      // In other cases where the source or destination are illegal, assume
668
986
      // the operation will get scalarized.
669
986
      unsigned Num = Dst->getVectorNumElements();
670
986
      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
671
986
          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
672
986
673
986
      // Return the cost of multiple scalar invocation plus the cost of
674
986
      // inserting and extracting the values.
675
986
      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
676
986
    }
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
123k
  unsigned getCFInstrCost(unsigned Opcode) {
701
123k
    // Branches are assumed to be predicted.
702
123k
    return 0;
703
123k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getCFInstrCost(unsigned int)
Line
Count
Source
700
103k
  unsigned getCFInstrCost(unsigned Opcode) {
701
103k
    // Branches are assumed to be predicted.
702
103k
    return 0;
703
103k
  }
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.26k
  unsigned getCFInstrCost(unsigned Opcode) {
701
3.26k
    // Branches are assumed to be predicted.
702
3.26k
    return 0;
703
3.26k
  }
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
611
  unsigned getCFInstrCost(unsigned Opcode) {
701
611
    // Branches are assumed to be predicted.
702
611
    return 0;
703
611
  }
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getCFInstrCost(unsigned int)
Line
Count
Source
700
15.4k
  unsigned getCFInstrCost(unsigned Opcode) {
701
15.4k
    // Branches are assumed to be predicted.
702
15.4k
    return 0;
703
15.4k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getCFInstrCost(unsigned int)
704
705
  unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
706
188k
                              const Instruction *I) {
707
188k
    const TargetLoweringBase *TLI = getTLI();
708
188k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
709
188k
    assert(ISD && "Invalid opcode");
710
188k
711
188k
    // Selects on vectors are actually vector selects.
712
188k
    if (ISD == ISD::SELECT) {
713
69.9k
      assert(CondTy && "CondTy must exist");
714
69.9k
      if (CondTy->isVectorTy())
715
26.1k
        ISD = ISD::VSELECT;
716
69.9k
    }
717
188k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
718
188k
719
188k
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()60.7k
) &&
720
188k
        
!TLI->isOperationExpand(ISD, LT.second)188k
) {
721
163k
      // The operation is legal. Assume it costs 1. Multiply
722
163k
      // by the type-legalization overhead.
723
163k
      return LT.first * 1;
724
163k
    }
725
25.3k
726
25.3k
    // Otherwise, assume that the cast is scalarized.
727
25.3k
    // TODO: If one of the types get legalized by splitting, handle this
728
25.3k
    // similarly to what getCastInstrCost() does.
729
25.3k
    if (ValTy->isVectorTy()) {
730
23.0k
      unsigned Num = ValTy->getVectorNumElements();
731
23.0k
      if (CondTy)
732
23.0k
        CondTy = CondTy->getScalarType();
733
23.0k
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
734
23.0k
          Opcode, ValTy->getScalarType(), CondTy, I);
735
23.0k
736
23.0k
      // Return the cost of multiple scalar invocation plus the cost of
737
23.0k
      // inserting and extracting the values.
738
23.0k
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
739
23.0k
    }
740
2.30k
741
2.30k
    // Unknown scalar opcode.
742
2.30k
    return 1;
743
2.30k
  }
llvm::BasicTTIImplBase<llvm::AArch64TTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
706
167k
                              const Instruction *I) {
707
167k
    const TargetLoweringBase *TLI = getTLI();
708
167k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
709
167k
    assert(ISD && "Invalid opcode");
710
167k
711
167k
    // Selects on vectors are actually vector selects.
712
167k
    if (ISD == ISD::SELECT) {
713
63.1k
      assert(CondTy && "CondTy must exist");
714
63.1k
      if (CondTy->isVectorTy())
715
22.0k
        ISD = ISD::VSELECT;
716
63.1k
    }
717
167k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
718
167k
719
167k
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()53.9k
) &&
720
167k
        
!TLI->isOperationExpand(ISD, LT.second)167k
) {
721
146k
      // The operation is legal. Assume it costs 1. Multiply
722
146k
      // by the type-legalization overhead.
723
146k
      return LT.first * 1;
724
146k
    }
725
20.8k
726
20.8k
    // Otherwise, assume that the cast is scalarized.
727
20.8k
    // TODO: If one of the types get legalized by splitting, handle this
728
20.8k
    // similarly to what getCastInstrCost() does.
729
20.8k
    if (ValTy->isVectorTy()) {
730
20.8k
      unsigned Num = ValTy->getVectorNumElements();
731
20.8k
      if (CondTy)
732
20.8k
        CondTy = CondTy->getScalarType();
733
20.8k
      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
734
20.8k
          Opcode, ValTy->getScalarType(), CondTy, I);
735
20.8k
736
20.8k
      // Return the cost of multiple scalar invocation plus the cost of
737
20.8k
      // inserting and extracting the values.
738
20.8k
      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
739
20.8k
    }
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.81k
                              const Instruction *I) {
707
3.81k
    const TargetLoweringBase *TLI = getTLI();
708
3.81k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
709
3.81k
    assert(ISD && "Invalid opcode");
710
3.81k
711
3.81k
    // Selects on vectors are actually vector selects.
712
3.81k
    if (ISD == ISD::SELECT) {
713
438
      assert(CondTy && "CondTy must exist");
714
438
      if (CondTy->isVectorTy())
715
96
        ISD = ISD::VSELECT;
716
438
    }
717
3.81k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
718
3.81k
719
3.81k
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()1.07k
) &&
720
3.81k
        !TLI->isOperationExpand(ISD, LT.second)) {
721
1.35k
      // The operation is legal. Assume it costs 1. Multiply
722
1.35k
      // by the type-legalization overhead.
723
1.35k
      return LT.first * 1;
724
1.35k
    }
725
2.45k
726
2.45k
    // Otherwise, assume that the cast is scalarized.
727
2.45k
    // TODO: If one of the types get legalized by splitting, handle this
728
2.45k
    // similarly to what getCastInstrCost() does.
729
2.45k
    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.30k
741
2.30k
    // Unknown scalar opcode.
742
2.30k
    return 1;
743
2.30k
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::Instruction const*)
Line
Count
Source
706
6
                              const Instruction *I) {
707
6
    const TargetLoweringBase *TLI = getTLI();
708
6
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
709
6
    assert(ISD && "Invalid opcode");
710
6
711
6
    // Selects on vectors are actually vector selects.
712
6
    if (ISD == ISD::SELECT) {
713
0
      assert(CondTy && "CondTy must exist");
714
0
      if (CondTy->isVectorTy())
715
0
        ISD = ISD::VSELECT;
716
0
    }
717
6
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
718
6
719
6
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()0
) &&
720
6
        !TLI->isOperationExpand(ISD, LT.second)) {
721
6
      // The operation is legal. Assume it costs 1. Multiply
722
6
      // by the type-legalization overhead.
723
6
      return LT.first * 1;
724
6
    }
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
100
                              const Instruction *I) {
707
100
    const TargetLoweringBase *TLI = getTLI();
708
100
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
709
100
    assert(ISD && "Invalid opcode");
710
100
711
100
    // Selects on vectors are actually vector selects.
712
100
    if (ISD == ISD::SELECT) {
713
0
      assert(CondTy && "CondTy must exist");
714
0
      if (CondTy->isVectorTy())
715
0
        ISD = ISD::VSELECT;
716
0
    }
717
100
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
718
100
719
100
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()0
) &&
720
100
        !TLI->isOperationExpand(ISD, LT.second)) {
721
100
      // The operation is legal. Assume it costs 1. Multiply
722
100
      // by the type-legalization overhead.
723
100
      return LT.first * 1;
724
100
    }
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.8k
                              const Instruction *I) {
707
16.8k
    const TargetLoweringBase *TLI = getTLI();
708
16.8k
    int ISD = TLI->InstructionOpcodeToISD(Opcode);
709
16.8k
    assert(ISD && "Invalid opcode");
710
16.8k
711
16.8k
    // Selects on vectors are actually vector selects.
712
16.8k
    if (ISD == ISD::SELECT) {
713
6.31k
      assert(CondTy && "CondTy must exist");
714
6.31k
      if (CondTy->isVectorTy())
715
3.98k
        ISD = ISD::VSELECT;
716
6.31k
    }
717
16.8k
    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
718
16.8k
719
16.8k
    if (!(ValTy->isVectorTy() && 
!LT.second.isVector()5.64k
) &&
720
16.8k
        
!TLI->isOperationExpand(ISD, LT.second)16.7k
) {
721
14.8k
      // The operation is legal. Assume it costs 1. Multiply
722
14.8k
      // by the type-legalization overhead.
723
14.8k
      return LT.first * 1;
724
14.8k
    }
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
238k
  unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index) {
746
238k
    std::pair<unsigned, MVT> LT =
747
238k
        getTLI()->getTypeLegalizationCost(DL, Val->getScalarType());
748
238k
749
238k
    return LT.first;
750
238k
  }
llvm::BasicTTIImplBase<llvm::GCNTTIImpl>::getVectorInstrCost(unsigned int, llvm::Type*, unsigned int)
Line
Count
Source
745
608
  unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index) {
746
608
    std::pair<unsigned, MVT> LT =
747
608
        getTLI()->getTypeLegalizationCost(DL, Val->getScalarType());
748
608
749
608
    return LT.first;
750
608
  }
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
224k
  unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index) {
746
224k
    std::pair<unsigned, MVT> LT =
747
224k
        getTLI()->getTypeLegalizationCost(DL, Val->getScalarType());
748
224k
749
224k
    return LT.first;
750
224k
  }
Unexecuted instantiation: llvm::BasicTTIImplBase<llvm::XCoreTTIImpl>::getVectorInstrCost(unsigned int, llvm::Type*, unsigned int)
751
752
  unsigned getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
753
857
                       unsigned AddressSpace, const Instruction *I = nullptr) {
754
857
    assert(!Src->isVoidTy() && "Invalid type");
755
857
    std::pair<unsigned, MVT> LT = getTLI()->getTypeLegalizationCost(DL, Src);
756
857
757
857
    // Assuming that all loads of legal types cost 1.
758
857
    unsigned Cost = LT.first;
759
857
760
857
    if (Src->isVectorTy() &&
761
857
        
Src->getPrimitiveSizeInBits() < LT.second.getSizeInBits()484
) {
762
59
      // This is a vector load that legalizes to a larger type than the vector
763
59
      // itself. Unless the corresponding extending load or truncating store is
764
59
      // legal, then this will scalarize.
765
59
      TargetLowering::LegalizeAction LA = TargetLowering::Expand;
766
59
      EVT MemVT = getTLI()->getValueType(DL, Src);
767
59
      if (Opcode == Instruction::Store)
768
21
        LA = getTLI()->getTruncStoreAction(LT.second, MemVT);
769
38
      else
770
38
        LA = getTLI()->getLoadExtAction(ISD::EXTLOAD, LT.second, MemVT);
771
59
772
59
      if (LA != TargetLowering::Legal && 
LA != TargetLowering::Custom54
) {
773
54
        // This is a vector load/store for some illegal type that is scalarized.
774
54
        // We must account for the cost of building or decomposing the vector.
775
54
        Cost += getScalarizationOverhead(Src, Opcode != Instruction::Store,
776
54
                                         Opcode == Instruction::Store);
777
54
      }
778
59
    }
779
857
780
857
    return Cost;
781
857
  }
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
677
                       unsigned AddressSpace, const Instruction *I = nullptr) {
754
677
    assert(!Src->isVoidTy() && "Invalid type");
755
677
    std::pair<unsigned, MVT> LT = getTLI()->getTypeLegalizationCost(DL, Src);
756
677
757
677
    // Assuming that all loads of legal types cost 1.
758
677
    unsigned Cost = LT.first;
759
677
760
677
    if (Src->isVectorTy() &&
761
677
        
Src->getPrimitiveSizeInBits() < LT.second.getSizeInBits()384
) {
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
677
780
677
    return Cost;
781
677
  }
llvm::BasicTTIImplBase<llvm::HexagonTTIImpl>::getMemoryOpCost(unsigned int, llvm::Type*, unsigned int, unsigned int, llvm::Instruction const*)
Line
Count
Source
753
16
                       unsigned AddressSpace, const Instruction *I = nullptr) {
754
16
    assert(!Src->isVoidTy() && "Invalid type");
755
16
    std::pair<unsigned, MVT> LT = getTLI()->getTypeLegalizationCost(DL, Src);
756
16
757
16
    // Assuming that all loads of legal types cost 1.
758
16
    unsigned Cost = LT.first;
759
16
760
16
    if (Src->isVectorTy() &&
761
16
        
Src->getPrimitiveSizeInBits() < LT.second.getSizeInBits()10
) {
762
2
      // This is a vector load that legalizes to a larger type than the vector
763
2
      // itself. Unless the corresponding extending load or truncating store is
764
2
      // legal, then this will scalarize.
765
2
      TargetLowering::LegalizeAction LA = TargetLowering::Expand;
766
2
      EVT MemVT = getTLI()->getValueType(DL, Src);
767
2
      if (Opcode == Instruction::Store)
768
2
        LA = getTLI()->getTruncStoreAction(LT.second, MemVT);
769
0
      else
770
0
        LA = getTLI()->getLoadExtAction(ISD::EXTLOAD, LT.second, MemVT);
771
2
772
2
      if (LA != TargetLowering::Legal && LA != TargetLowering::Custom) {
773
2
        // This is a vector load/store for some illegal type that is scalarized.
774
2
        // We must account for the cost of building or decomposing the vector.
775
2
        Cost += getScalarizationOverhead(Src, Opcode != Instruction::Store,
776
2
                                         Opcode == Instruction::Store);
777
2
      }
778
2
    }
779
16
780
16
    return Cost;
781
16
  }
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
564
                                      unsigned AddressSpace) {
788
564
    VectorType *VT = dyn_cast<VectorType>(VecTy);
789
564
    assert(VT && "Expect a vector type for interleaved memory op");
790
564
791
564
    unsigned NumElts = VT->getNumElements();
792
564
    assert(Factor > 1 && NumElts % Factor == 0 && "Invalid interleave factor");
793
564
794
564
    unsigned NumSubElts = NumElts / Factor;
795
564
    VectorType *SubVT = VectorType::get(VT->getElementType(), NumSubElts);
796
564
797
564
    // Firstly, the cost of load/store operation.
798
564
    unsigned Cost = static_cast<T *>(this)->getMemoryOpCost(
799
564
        Opcode, VecTy, Alignment, AddressSpace);
800
564
801
564
    // Legalize the vector type, and get the legalized and unlegalized type
802
564
    // sizes.
803
564
    MVT VecTyLT = getTLI()->getTypeLegalizationCost(DL, VecTy).second;
804
564
    unsigned VecTySize =
805
564
        static_cast<T *>(this)->getDataLayout().getTypeStoreSize(VecTy);
806
564
    unsigned VecTyLTSize = VecTyLT.getStoreSize();
807
564
808
564
    // Return the ceiling of dividing A by B.
809
564
    auto ceil = [](unsigned A, unsigned B) 
{ return (A + B - 1) / B; }490
;