[PATCH] D82443: [ARM] Narrowing half-precision lowering to supported CCs

Puyan Lotfi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 14:59:16 PDT 2020


plotfi updated this revision to Diff 274251.
plotfi added a comment.

Updated diff to only handle fastcc


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82443/new/

https://reviews.llvm.org/D82443

Files:
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/test/CodeGen/ARM/arm-half-promote.ll


Index: llvm/test/CodeGen/ARM/arm-half-promote.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/ARM/arm-half-promote.ll
@@ -0,0 +1,8 @@
+; RUN: llc -mtriple=thumbv7s-apple-ios7.0.0 %s -o -
+
+target datalayout = "e-m:o-p:32:32-Fi8-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
+target triple = "thumbv7s-apple-ios7.0.0"
+
+define fastcc { <8 x half>, <8 x half> } @f1() {
+  ret { <8 x half>, <8 x half> } zeroinitializer
+}
Index: llvm/lib/Target/ARM/ARMISelLowering.cpp
===================================================================
--- llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -4173,7 +4173,11 @@
 bool ARMTargetLowering::splitValueIntoRegisterParts(
     SelectionDAG &DAG, const SDLoc &DL, SDValue Val, SDValue *Parts,
     unsigned NumParts, MVT PartVT, Optional<CallingConv::ID> CC) const {
-  bool IsABIRegCopy = CC.hasValue();
+  bool IsABIRegCopy = false;
+  if (CC.hasValue()) {
+    auto CCVal = CC.getValue();
+    IsABIRegCopy = (CCVal != CallingConv::Fast);
+  }
   EVT ValueVT = Val.getValueType();
   if (IsABIRegCopy && (ValueVT == MVT::f16 || ValueVT == MVT::bf16) &&
       PartVT == MVT::f32) {
@@ -4191,7 +4195,11 @@
 SDValue ARMTargetLowering::joinRegisterPartsIntoValue(
     SelectionDAG &DAG, const SDLoc &DL, const SDValue *Parts, unsigned NumParts,
     MVT PartVT, EVT ValueVT, Optional<CallingConv::ID> CC) const {
-  bool IsABIRegCopy = CC.hasValue();
+  bool IsABIRegCopy = false;
+  if (CC.hasValue()) {
+    auto CCVal = CC.getValue();
+    IsABIRegCopy = (CCVal != CallingConv::Fast);
+  }
   if (IsABIRegCopy && (ValueVT == MVT::f16 || ValueVT == MVT::bf16) &&
       PartVT == MVT::f32) {
     unsigned ValueBits = ValueVT.getSizeInBits();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82443.274251.patch
Type: text/x-patch
Size: 1787 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200629/2813df1f/attachment.bin>


More information about the llvm-commits mailing list