[llvm] cd99768 - [Hexagon] Fix isTypeForHVX to recognize floating point types
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 30 10:01:27 PST 2021
Author: Krzysztof Parzyszek
Date: 2021-12-30T10:01:05-08:00
New Revision: cd997689f26d1f6558ab7a04499bd5594d09861e
URL: https://github.com/llvm/llvm-project/commit/cd997689f26d1f6558ab7a04499bd5594d09861e
DIFF: https://github.com/llvm/llvm-project/commit/cd997689f26d1f6558ab7a04499bd5594d09861e.diff
LOG: [Hexagon] Fix isTypeForHVX to recognize floating point types
Co-authored-by: Sumanth Gundapaneni <sgundapa at quicinc.com>
Added:
Modified:
llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
llvm/test/CodeGen/Hexagon/autohvx/calling-conv.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp b/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
index 08bb4580b585..21bb1633fa79 100644
--- a/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
@@ -228,7 +228,9 @@ bool HexagonSubtarget::isTypeForHVX(Type *VecTy, bool IncludeBool) const {
if (!VecTy->isVectorTy() || isa<ScalableVectorType>(VecTy))
return false;
// Avoid types like <2 x i32*>.
- if (!cast<VectorType>(VecTy)->getElementType()->isIntegerTy())
+ Type *ScalTy = VecTy->getScalarType();
+ if (!ScalTy->isIntegerTy() &&
+ !(ScalTy->isFloatingPointTy() && useHVXFloatingPoint()))
return false;
// The given type may be something like <17 x i32>, which is not MVT,
// but can be represented as (non-simple) EVT.
diff --git a/llvm/test/CodeGen/Hexagon/autohvx/calling-conv.ll b/llvm/test/CodeGen/Hexagon/autohvx/calling-conv.ll
index 884eb6e7ac75..6ebe077ae120 100644
--- a/llvm/test/CodeGen/Hexagon/autohvx/calling-conv.ll
+++ b/llvm/test/CodeGen/Hexagon/autohvx/calling-conv.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -march=hexagon < %s | FileCheck %s
+; RUN: llc -march=hexagon -hexagon-vector-combine=false < %s | FileCheck %s
define void @f0(<128 x i8> %a0, <128 x i8>* %a1) #0 {
; CHECK-LABEL: f0:
More information about the llvm-commits
mailing list