aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Target/LoongArch/LoongArchTargetTransformInfo.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2024-02-07 14:58:02 +0000
committerDimitry Andric <dim@FreeBSD.org>2024-04-06 20:14:07 +0000
commitb3edf4467982447620505a28fc82e38a414c07dc (patch)
tree3bbe0ab71c23f020abf58f17f1f43e1dcdaca7c5 /contrib/llvm-project/llvm/lib/Target/LoongArch/LoongArchTargetTransformInfo.cpp
parent868ee3f2855615016ba87c14b9444c18a2e1ba30 (diff)
parent4fdf604ba667503ae582304cebdd3df426778a6b (diff)
downloadsrc-b3edf4467982447620505a28fc82e38a414c07dc.tar.gz
src-b3edf4467982447620505a28fc82e38a414c07dc.zip
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Target/LoongArch/LoongArchTargetTransformInfo.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/Target/LoongArch/LoongArchTargetTransformInfo.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/contrib/llvm-project/llvm/lib/Target/LoongArch/LoongArchTargetTransformInfo.cpp b/contrib/llvm-project/llvm/lib/Target/LoongArch/LoongArchTargetTransformInfo.cpp
index 04349aa52b54..d47dded9ea6e 100644
--- a/contrib/llvm-project/llvm/lib/Target/LoongArch/LoongArchTargetTransformInfo.cpp
+++ b/contrib/llvm-project/llvm/lib/Target/LoongArch/LoongArchTargetTransformInfo.cpp
@@ -21,17 +21,20 @@ using namespace llvm;
TypeSize LoongArchTTIImpl::getRegisterBitWidth(
TargetTransformInfo::RegisterKind K) const {
+ TypeSize DefSize = TargetTransformInfoImplBase::getRegisterBitWidth(K);
switch (K) {
case TargetTransformInfo::RGK_Scalar:
return TypeSize::getFixed(ST->is64Bit() ? 64 : 32);
case TargetTransformInfo::RGK_FixedWidthVector:
- if (ST->hasExtLASX() && ST->hasExpAutoVec())
+ if (!ST->hasExpAutoVec())
+ return DefSize;
+ if (ST->hasExtLASX())
return TypeSize::getFixed(256);
- if (ST->hasExtLSX() && ST->hasExpAutoVec())
+ if (ST->hasExtLSX())
return TypeSize::getFixed(128);
- return TypeSize::getFixed(0);
+ [[fallthrough]];
case TargetTransformInfo::RGK_ScalableVector:
- return TypeSize::getScalable(0);
+ return DefSize;
}
llvm_unreachable("Unsupported register kind");