Skip to content

Commit

Permalink
[Hexagon] Fix isTypeForHVX for vector predicates
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Krzysztof Parzyszek committed Oct 14, 2022
1 parent 0d60000 commit b465a98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit b465a98

Please sign in to comment.