[llvm] b465a98 - [Hexagon] Fix isTypeForHVX for vector predicates
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 14 14:40:02 PDT 2022
Author: Krzysztof Parzyszek
Date: 2022-10-14T14:38:41-07:00
New Revision: b465a983168bf87dc269848c82ffc49ac8dbec20
URL: https://github.com/llvm/llvm-project/commit/b465a983168bf87dc269848c82ffc49ac8dbec20
DIFF: https://github.com/llvm/llvm-project/commit/b465a983168bf87dc269848c82ffc49ac8dbec20.diff
LOG: [Hexagon] Fix isTypeForHVX for vector predicates
HexagonSubtarget::isTypeFixHVX would stop breaking the type up when it
reached 64 bits in width. HVX vector predicates can be shorter than that,
for example <32 x i1> would have a bitwidth of 32, and it's still a valid
HVX type.
Added:
Modified:
llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp b/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
index ba37e04851be..fd85087d7234 100644
--- a/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
@@ -222,7 +222,7 @@ bool HexagonSubtarget::isTypeForHVX(Type *VecTy, bool IncludeBool) const {
// The given type may be something like <17 x i32>, which is not MVT,
// but can be represented as (non-simple) EVT.
EVT Ty = EVT::getEVT(VecTy, /*HandleUnknown*/false);
- if (Ty.getSizeInBits() <= 64 || !Ty.getVectorElementType().isSimple())
+ if (!Ty.getVectorElementType().isSimple())
return false;
auto isHvxTy = [this, IncludeBool](MVT SimpleTy) {
@@ -236,7 +236,7 @@ bool HexagonSubtarget::isTypeForHVX(Type *VecTy, bool IncludeBool) const {
// qualifies for HVX, dividing it in half after each step.
MVT ElemTy = Ty.getVectorElementType().getSimpleVT();
unsigned VecLen = PowerOf2Ceil(Ty.getVectorNumElements());
- while (ElemTy.getSizeInBits() * VecLen > 64) {
+ while (VecLen > 1) {
MVT SimpleTy = MVT::getVectorVT(ElemTy, VecLen);
if (SimpleTy.isValid() && isHvxTy(SimpleTy))
return true;
More information about the llvm-commits
mailing list