LLVM
22.0.0git
lib
Target
AVR
AVRTargetTransformInfo.cpp
Go to the documentation of this file.
1
//===-- AVRTargetTransformInfo.cpp - AVR specific TTI ---------------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#include "
AVRTargetTransformInfo.h
"
10
11
using namespace
llvm
;
12
13
bool
AVRTTIImpl::isLSRCostLess
(
const
TargetTransformInfo::LSRCost
&C1,
14
const
TargetTransformInfo::LSRCost
&C2)
const
{
15
// AVR specific here are "instruction number 1st priority".
16
// If we need to emit adds inside the loop to add up base registers, then
17
// we need at least one extra temporary register.
18
unsigned
C1NumRegs = C1.
NumRegs
+ (C1.
NumBaseAdds
!= 0);
19
unsigned
C2NumRegs = C2.
NumRegs
+ (C2.
NumBaseAdds
!= 0);
20
return
std::tie(C1.
Insns
, C1NumRegs, C1.
AddRecCost
, C1.
NumIVMuls
,
21
C1.
NumBaseAdds
, C1.
ScaleCost
, C1.
ImmCost
, C1.
SetupCost
) <
22
std::tie(C2.
Insns
, C2NumRegs, C2.
AddRecCost
, C2.
NumIVMuls
,
23
C2.
NumBaseAdds
, C2.
ScaleCost
, C2.
ImmCost
, C2.
SetupCost
);
24
}
AVRTargetTransformInfo.h
This file defines a TargetTransformInfoImplBase conforming object specific to the AVR target machine.
llvm::AVRTTIImpl::isLSRCostLess
bool isLSRCostLess(const TargetTransformInfo::LSRCost &C1, const TargetTransformInfo::LSRCost &C2) const override
Definition:
AVRTargetTransformInfo.cpp:13
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:18
llvm::TargetTransformInfo::LSRCost
Definition:
TargetTransformInfo.h:533
llvm::TargetTransformInfo::LSRCost::NumIVMuls
unsigned NumIVMuls
Definition:
TargetTransformInfo.h:539
llvm::TargetTransformInfo::LSRCost::ScaleCost
unsigned ScaleCost
Definition:
TargetTransformInfo.h:543
llvm::TargetTransformInfo::LSRCost::Insns
unsigned Insns
TODO: Some of these could be merged.
Definition:
TargetTransformInfo.h:536
llvm::TargetTransformInfo::LSRCost::ImmCost
unsigned ImmCost
Definition:
TargetTransformInfo.h:541
llvm::TargetTransformInfo::LSRCost::AddRecCost
unsigned AddRecCost
Definition:
TargetTransformInfo.h:538
llvm::TargetTransformInfo::LSRCost::NumRegs
unsigned NumRegs
Definition:
TargetTransformInfo.h:537
llvm::TargetTransformInfo::LSRCost::NumBaseAdds
unsigned NumBaseAdds
Definition:
TargetTransformInfo.h:540
llvm::TargetTransformInfo::LSRCost::SetupCost
unsigned SetupCost
Definition:
TargetTransformInfo.h:542
Generated on Wed Sep 3 2025 06:22:05 for LLVM by
1.9.6