-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[LoongArch] Fixing the incorrect return value of LoongArchTTIImpl::getRegisterBitWidth #79441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…tRegisterBitWidth When we do not enable vector features, we should return the default value (TargetTransformInfoImplBase::getRegisterBitWidth) instead of zero. This should fix the LoongArch buildbot breakage from llvm#78943. https://lab.llvm.org/staging/#/builders/5
@llvm/pr-subscribers-backend-loongarch Author: wanglei (wangleiat) ChangesWhen we do not enable vector features, we should return the default value ( This should fix the LoongArch buildbot breakage from #78943. Full diff: https://github.com/llvm/llvm-project/pull/79441.diff 1 Files Affected:
diff --git a/llvm/lib/Target/LoongArch/LoongArchTargetTransformInfo.cpp b/llvm/lib/Target/LoongArch/LoongArchTargetTransformInfo.cpp
index 04349aa52b54089..d47dded9ea6ecf2 100644
--- a/llvm/lib/Target/LoongArch/LoongArchTargetTransformInfo.cpp
+++ b/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");
|
…tRegisterBitWidth (llvm#79441) When we do not enable vector features, we should return the default value (`TargetTransformInfoImplBase::getRegisterBitWidth`) instead of zero. This should fix the LoongArch [buildbot breakage](https://lab.llvm.org/staging/#/builders/5/builds/486) from llvm#78943. (cherry picked from commit 1e9924c)
…tRegisterBitWidth (llvm#79441) When we do not enable vector features, we should return the default value (`TargetTransformInfoImplBase::getRegisterBitWidth`) instead of zero. This should fix the LoongArch [buildbot breakage](https://lab.llvm.org/staging/#/builders/5/builds/486) from llvm#78943. (cherry picked from commit 1e9924c)
…tRegisterBitWidth (llvm#79441) When we do not enable vector features, we should return the default value (`TargetTransformInfoImplBase::getRegisterBitWidth`) instead of zero. This should fix the LoongArch [buildbot breakage](https://lab.llvm.org/staging/#/builders/5/builds/486) from llvm#78943. (cherry picked from commit 1e9924c)
…tRegisterBitWidth (llvm#79441) When we do not enable vector features, we should return the default value (`TargetTransformInfoImplBase::getRegisterBitWidth`) instead of zero. This should fix the LoongArch [buildbot breakage](https://lab.llvm.org/staging/#/builders/5/builds/486) from llvm#78943. (cherry picked from commit 1e9924c)
…tRegisterBitWidth (llvm#79441) When we do not enable vector features, we should return the default value (`TargetTransformInfoImplBase::getRegisterBitWidth`) instead of zero. This should fix the LoongArch [buildbot breakage](https://lab.llvm.org/staging/#/builders/5/builds/486) from llvm#78943. (cherry picked from commit 1e9924c)
…tRegisterBitWidth (llvm#79441) When we do not enable vector features, we should return the default value (`TargetTransformInfoImplBase::getRegisterBitWidth`) instead of zero. This should fix the LoongArch [buildbot breakage](https://lab.llvm.org/staging/#/builders/5/builds/486) from llvm#78943. (cherry picked from commit 1e9924c)
…tRegisterBitWidth (llvm#79441) When we do not enable vector features, we should return the default value (`TargetTransformInfoImplBase::getRegisterBitWidth`) instead of zero. This should fix the LoongArch [buildbot breakage](https://lab.llvm.org/staging/#/builders/5/builds/486) from (cherry picked from commit 1e9924c) (cherry picked from commit 900e7cb) Change-Id: I6e6a5cd987e1129872980c09441f5ca176069ddd
When we do not enable vector features, we should return the default value (
TargetTransformInfoImplBase::getRegisterBitWidth
) instead of zero.This should fix the LoongArch buildbot breakage from #78943.