[PATCH] D81837: [ARM][bfloat] Removing lowering of bfloat arguments and returns from Clang's CodeGen

2020-06-18 Thread Ties Stuij via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG035795659b60: [ARM][bfloat] Do not coerce bfloat arguments 
and returns to integers (authored by stuij).

Changed prior to commit:
  https://reviews.llvm.org/D81837?vs=271130=271775#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81837

Files:
  clang/lib/CodeGen/TargetInfo.cpp
  clang/test/CodeGen/arm-bf16-params-returns.c
  clang/test/CodeGen/arm-mangle-bf16.cpp


Index: clang/test/CodeGen/arm-mangle-bf16.cpp
===
--- clang/test/CodeGen/arm-mangle-bf16.cpp
+++ clang/test/CodeGen/arm-mangle-bf16.cpp
@@ -1,8 +1,6 @@
-// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-feature +bf16 
-emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK64
-// RUN: %clang_cc1 -triple arm-arm-none-eabi -target-feature +bf16 -mfloat-abi 
hard -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK32-HARD
-// RUN: %clang_cc1 -triple arm-arm-none-eabi -target-feature +bf16 -mfloat-abi 
softfp -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK32-SOFTFP
+// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-feature +bf16 
-emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple arm-arm-none-eabi -target-feature +bf16 -mfloat-abi 
hard -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple arm-arm-none-eabi -target-feature +bf16 -mfloat-abi 
softfp -emit-llvm -o - %s | FileCheck %s
 
-// CHECK64: define {{.*}}void @_Z3foou6__bf16(bfloat %b)
-// CHECK32-HARD: define {{.*}}void @_Z3foou6__bf16(bfloat %b)
-// CHECK32-SOFTFP: define {{.*}}void @_Z3foou6__bf16(i32 %b.coerce)
+// CHECK: define {{.*}}void @_Z3foou6__bf16(bfloat %b)
 void foo(__bf16 b) {}
Index: clang/test/CodeGen/arm-bf16-params-returns.c
===
--- clang/test/CodeGen/arm-bf16-params-returns.c
+++ clang/test/CodeGen/arm-bf16-params-returns.c
@@ -1,7 +1,6 @@
 // RUN: %clang_cc1 -triple armv8.6a-arm-none-eabi -target-abi aapcs 
-mfloat-abi hard -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o 
- %s | opt -S -mem2reg -sroa | FileCheck %s --check-prefix=CHECK32-HARD
-// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-abi aapcs -mfloat-abi 
hard -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt 
-S -mem2reg -sroa | FileCheck %s --check-prefix=CHECK64-HARD
 // RUN: %clang_cc1 -triple armv8.6a-arm-none-eabi -target-abi aapcs 
-mfloat-abi softfp -target-feature +bf16 -target-feature +neon -emit-llvm -O2 
-o - %s | opt -S -mem2reg -sroa | FileCheck %s --check-prefix=CHECK32-SOFTFP
-// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-abi aapcs -mfloat-abi 
softfp -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt 
-S -mem2reg -sroa | FileCheck %s --check-prefix=CHECK64-SOFTFP
+// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-abi aapcs 
-target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S 
-mem2reg -sroa | FileCheck %s --check-prefix=CHECK64
 
 #include 
 
@@ -11,22 +10,17 @@
 }
 // CHECK32-HARD: define arm_aapcs_vfpcc bfloat @test_ret_bf16(bfloat returned 
%v) {{.*}} {
 // CHECK32-HARD: ret bfloat %v
-// CHECK64-HARD: define bfloat @test_ret_bf16(bfloat returned %v) {{.*}} {
-// CHECK64-HARD: ret bfloat %v
-// CHECK32-SOFTFP: define i32 @test_ret_bf16(i32 [[V0:.*]]) {{.*}} {
-// CHECK32-SOFTFP: %tmp2.0.insert.ext = and i32 [[V0]], 65535
-// CHECK32-SOFTFP: ret i32 %tmp2.0.insert.ext
-// CHECK64-SOFTFP: define bfloat @test_ret_bf16(bfloat returned %v) {{.*}} {
-// CHECK64-SOFTFP: ret bfloat %v
+// CHECK32-SOFTFP: define bfloat @test_ret_bf16(bfloat returned %v) {{.*}} {
+// CHECK32-SOFTFP: ret bfloat %v
+// CHECK64: define bfloat @test_ret_bf16(bfloat returned %v) {{.*}} {
+// CHECK64: ret bfloat %v
 
 bfloat16x4_t test_ret_bf16x4_t(bfloat16x4_t v) {
   return v;
 }
 // CHECK32-HARD: define arm_aapcs_vfpcc <4 x bfloat> @test_ret_bf16x4_t(<4 x 
bfloat> returned %v) {{.*}} {
 // CHECK32-HARD: ret <4 x bfloat> %v
-// CHECK64-HARD: define <4 x bfloat> @test_ret_bf16x4_t(<4 x bfloat> returned 
%v) {{.*}} {
-// CHECK64-HARD: ret <4 x bfloat> %v
 // CHECK32-SOFTFP: define <2 x i32> @test_ret_bf16x4_t(<2 x i32> [[V0:.*]]) 
{{.*}} {
 // CHECK32-SOFTFP: ret <2 x i32> %v
-// CHECK64-SOFTFP: define <4 x bfloat> @test_ret_bf16x4_t(<4 x bfloat> 
returned %v) {{.*}} {
-// CHECK64-SOFTFP: ret <4 x bfloat> %v
+// CHECK64: define <4 x bfloat> @test_ret_bf16x4_t(<4 x bfloat> returned %v) 
{{.*}} {
+// CHECK64: ret <4 x bfloat> %v
Index: clang/lib/CodeGen/TargetInfo.cpp
===
--- clang/lib/CodeGen/TargetInfo.cpp
+++ clang/lib/CodeGen/TargetInfo.cpp
@@ -6265,13 +6265,6 @@
   if (isIllegalVectorType(Ty))
 return coerceIllegalVector(Ty);
 
-  // __bf16 gets passed using the bfloat IR type, or using i32 but
-  // with 

[PATCH] D81837: [ARM][bfloat] Removing lowering of bfloat arguments and returns from Clang's CodeGen

2020-06-16 Thread Momchil Velikov via Phabricator via cfe-commits
chill added a comment.

Pretty straightforward, LGTM. I'd suggest rewording the title (presumably 
commit message summary) into something like "Do not coerce bfloat arguments and 
returns to integers", as we're obviously still lowering C and C++ to LLVM LR.ยงยง


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81837



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81837: [ARM][bfloat] Removing lowering of bfloat arguments and returns from Clang's CodeGen

2020-06-16 Thread Ties Stuij via Phabricator via cfe-commits
stuij updated this revision to Diff 271130.
stuij added a comment.

We only remove clang-side lowering for non-vector bfloat types.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81837

Files:
  clang/lib/CodeGen/TargetInfo.cpp
  clang/test/CodeGen/arm-bf16-params-returns.c
  clang/test/CodeGen/arm-mangle-bf16.cpp


Index: clang/test/CodeGen/arm-mangle-bf16.cpp
===
--- clang/test/CodeGen/arm-mangle-bf16.cpp
+++ clang/test/CodeGen/arm-mangle-bf16.cpp
@@ -1,8 +1,6 @@
-// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-feature +bf16 
-emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK64
-// RUN: %clang_cc1 -triple arm-arm-none-eabi -target-feature +bf16 -mfloat-abi 
hard -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK32-HARD
-// RUN: %clang_cc1 -triple arm-arm-none-eabi -target-feature +bf16 -mfloat-abi 
softfp -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK32-SOFTFP
+// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-feature +bf16 
-emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple arm-arm-none-eabi -target-feature +bf16 -mfloat-abi 
hard -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple arm-arm-none-eabi -target-feature +bf16 -mfloat-abi 
softfp -emit-llvm -o - %s | FileCheck %s
 
-// CHECK64: define {{.*}}void @_Z3foou6__bf16(bfloat %b)
-// CHECK32-HARD: define {{.*}}void @_Z3foou6__bf16(bfloat %b)
-// CHECK32-SOFTFP: define {{.*}}void @_Z3foou6__bf16(i32 %b.coerce)
+// CHECK: define {{.*}}void @_Z3foou6__bf16(bfloat %b)
 void foo(__bf16 b) {}
Index: clang/test/CodeGen/arm-bf16-params-returns.c
===
--- clang/test/CodeGen/arm-bf16-params-returns.c
+++ clang/test/CodeGen/arm-bf16-params-returns.c
@@ -13,9 +13,8 @@
 // CHECK32-HARD: ret bfloat %v
 // CHECK64-HARD: define bfloat @test_ret_bf16(bfloat returned %v) {{.*}} {
 // CHECK64-HARD: ret bfloat %v
-// CHECK32-SOFTFP: define i32 @test_ret_bf16(i32 [[V0:.*]]) {{.*}} {
-// CHECK32-SOFTFP: %tmp2.0.insert.ext = and i32 [[V0]], 65535
-// CHECK32-SOFTFP: ret i32 %tmp2.0.insert.ext
+// CHECK32-SOFTFP: define bfloat @test_ret_bf16(bfloat returned %v) {{.*}} {
+// CHECK32-SOFTFP: ret bfloat %v
 // CHECK64-SOFTFP: define bfloat @test_ret_bf16(bfloat returned %v) {{.*}} {
 // CHECK64-SOFTFP: ret bfloat %v
 
Index: clang/lib/CodeGen/TargetInfo.cpp
===
--- clang/lib/CodeGen/TargetInfo.cpp
+++ clang/lib/CodeGen/TargetInfo.cpp
@@ -6276,13 +6276,6 @@
 return ABIArgInfo::getDirect(ResType);
   }
 
-  // __bf16 gets passed using the bfloat IR type, or using i32 but
-  // with the top 16 bits unspecified.
-  if (Ty->isBFloat16Type() && IsFloatABISoftFP) {
-llvm::Type *ResType = llvm::Type::getInt32Ty(getVMContext());
-return ABIArgInfo::getDirect(ResType);
-  }
-
   if (!isAggregateTypeForABI(Ty)) {
 // Treat an enum type as its underlying type.
 if (const EnumType *EnumTy = Ty->getAs()) {
@@ -6497,15 +6490,6 @@
 return ABIArgInfo::getDirect(ResType);
   }
 
-  // if we're using the softfp float abi, __bf16 get returned as if it were an
-  // int but with the top 16 bits unspecified.
-  if (RetTy->isBFloat16Type()) {
-llvm::Type *ResType = IsAAPCS_VFP ?
-  llvm::Type::getBFloatTy(getVMContext()) :
-  llvm::Type::getInt32Ty(getVMContext());
-return ABIArgInfo::getDirect(ResType);
-  }
-
   if (!isAggregateTypeForABI(RetTy)) {
 // Treat an enum type as its underlying type.
 if (const EnumType *EnumTy = RetTy->getAs())


Index: clang/test/CodeGen/arm-mangle-bf16.cpp
===
--- clang/test/CodeGen/arm-mangle-bf16.cpp
+++ clang/test/CodeGen/arm-mangle-bf16.cpp
@@ -1,8 +1,6 @@
-// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-feature +bf16 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK64
-// RUN: %clang_cc1 -triple arm-arm-none-eabi -target-feature +bf16 -mfloat-abi hard -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK32-HARD
-// RUN: %clang_cc1 -triple arm-arm-none-eabi -target-feature +bf16 -mfloat-abi softfp -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK32-SOFTFP
+// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-feature +bf16 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple arm-arm-none-eabi -target-feature +bf16 -mfloat-abi hard -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple arm-arm-none-eabi -target-feature +bf16 -mfloat-abi softfp -emit-llvm -o - %s | FileCheck %s
 
-// CHECK64: define {{.*}}void @_Z3foou6__bf16(bfloat %b)
-// CHECK32-HARD: define {{.*}}void @_Z3foou6__bf16(bfloat %b)
-// CHECK32-SOFTFP: define {{.*}}void @_Z3foou6__bf16(i32 %b.coerce)
+// CHECK: define {{.*}}void @_Z3foou6__bf16(bfloat %b)
 void foo(__bf16 b) {}
Index: 

[PATCH] D81837: [ARM][bfloat] Removing lowering of bfloat arguments and returns from Clang's CodeGen

2020-06-15 Thread Ties Stuij via Phabricator via cfe-commits
stuij updated this revision to Diff 270721.
stuij added a comment.

adjust arm bfloat mangle tests for these changes


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81837

Files:
  clang/lib/CodeGen/ABIInfo.h
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/CodeGen/TargetInfo.cpp
  clang/test/CodeGen/arm-bf16-getset-intrinsics.c
  clang/test/CodeGen/arm-bf16-params-returns.c
  clang/test/CodeGen/arm-bf16-reinterpret-intrinsics.c
  clang/test/CodeGen/arm-mangle-bf16.cpp

Index: clang/test/CodeGen/arm-mangle-bf16.cpp
===
--- clang/test/CodeGen/arm-mangle-bf16.cpp
+++ clang/test/CodeGen/arm-mangle-bf16.cpp
@@ -1,8 +1,6 @@
-// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-feature +bf16 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK64
-// RUN: %clang_cc1 -triple arm-arm-none-eabi -target-feature +bf16 -mfloat-abi hard -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK32-HARD
-// RUN: %clang_cc1 -triple arm-arm-none-eabi -target-feature +bf16 -mfloat-abi softfp -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK32-SOFTFP
+// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-feature +bf16 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple arm-arm-none-eabi -target-feature +bf16 -mfloat-abi hard -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple arm-arm-none-eabi -target-feature +bf16 -mfloat-abi softfp -emit-llvm -o - %s | FileCheck %s
 
-// CHECK64: define {{.*}}void @_Z3foou6__bf16(bfloat %b)
-// CHECK32-HARD: define {{.*}}void @_Z3foou6__bf16(bfloat %b)
-// CHECK32-SOFTFP: define {{.*}}void @_Z3foou6__bf16(i32 %b.coerce)
+// CHECK: define {{.*}}void @_Z3foou6__bf16(bfloat %b)
 void foo(__bf16 b) {}
Index: clang/test/CodeGen/arm-bf16-reinterpret-intrinsics.c
===
--- clang/test/CodeGen/arm-bf16-reinterpret-intrinsics.c
+++ clang/test/CodeGen/arm-bf16-reinterpret-intrinsics.c
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -triple armv8.2a-arm-none-eabi -target-feature +neon -target-feature +bf16 -mfloat-abi hard \
-// RUN: -disable-O0-optnone -S -emit-llvm -o - %s \
-// RUN: | opt -S -instcombine \
-// RUN: | FileCheck %s
+// RUN: -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -instcombine | FileCheck %s
+// RUN: %clang_cc1 -triple armv8.2a-arm-none-eabi -target-feature +neon -target-feature +bf16 -mfloat-abi softfp \
+// RUN: -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -instcombine | FileCheck %s
 
 // REQUIRES: arm-registered-target
 
Index: clang/test/CodeGen/arm-bf16-params-returns.c
===
--- clang/test/CodeGen/arm-bf16-params-returns.c
+++ clang/test/CodeGen/arm-bf16-params-returns.c
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -triple armv8.6a-arm-none-eabi -target-abi aapcs -mfloat-abi hard -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -mem2reg -sroa | FileCheck %s --check-prefix=CHECK32-HARD
-// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-abi aapcs -mfloat-abi hard -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -mem2reg -sroa | FileCheck %s --check-prefix=CHECK64-HARD
-// RUN: %clang_cc1 -triple armv8.6a-arm-none-eabi -target-abi aapcs -mfloat-abi softfp -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -mem2reg -sroa | FileCheck %s --check-prefix=CHECK32-SOFTFP
-// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-abi aapcs -mfloat-abi softfp -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -mem2reg -sroa | FileCheck %s --check-prefix=CHECK64-SOFTFP
+// RUN: %clang_cc1 -triple armv8.6a-arm-none-eabi -target-abi aapcs -mfloat-abi hard -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -mem2reg -sroa | FileCheck %s
+// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-abi aapcs -mfloat-abi hard -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -mem2reg -sroa | FileCheck %s
+// RUN: %clang_cc1 -triple armv8.6a-arm-none-eabi -target-abi aapcs -mfloat-abi softfp -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -mem2reg -sroa | FileCheck %s
+// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-abi aapcs -mfloat-abi softfp -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -mem2reg -sroa | FileCheck %s
 
 #include 
 
@@ -9,24 +9,11 @@
 __bf16 test_ret_bf16(__bf16 v) {
   return v;
 }
-// CHECK32-HARD: define arm_aapcs_vfpcc bfloat @test_ret_bf16(bfloat returned %v) {{.*}} {
-// CHECK32-HARD: ret bfloat %v
-// CHECK64-HARD: define bfloat @test_ret_bf16(bfloat returned %v) {{.*}} {
-// CHECK64-HARD: ret bfloat %v
-// CHECK32-SOFTFP: define i32 @test_ret_bf16(i32 [[V0:.*]]) {{.*}} {
-// CHECK32-SOFTFP: %tmp2.0.insert.ext = and i32 [[V0]], 65535
-// CHECK32-SOFTFP: ret i32 

[PATCH] D81837: [ARM][bfloat] Removing lowering of bfloat arguments and returns from Clang's CodeGen

2020-06-15 Thread Ties Stuij via Phabricator via cfe-commits
stuij created this revision.
Herald added subscribers: cfe-commits, danielkiss, kristof.beyls.
Herald added a project: clang.
stuij added a child revision: D81373: [WIP] Basic bfloat support on Arm.

As part of moving the argument lowering handling for bfloat arguments and
returns to the backend, this patch removes the code that was responsible for
handling the coercion of those arguments in Clang's Codegen.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81837

Files:
  clang/lib/CodeGen/ABIInfo.h
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/CodeGen/TargetInfo.cpp
  clang/test/CodeGen/arm-bf16-getset-intrinsics.c
  clang/test/CodeGen/arm-bf16-params-returns.c
  clang/test/CodeGen/arm-bf16-reinterpret-intrinsics.c

Index: clang/test/CodeGen/arm-bf16-reinterpret-intrinsics.c
===
--- clang/test/CodeGen/arm-bf16-reinterpret-intrinsics.c
+++ clang/test/CodeGen/arm-bf16-reinterpret-intrinsics.c
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -triple armv8.2a-arm-none-eabi -target-feature +neon -target-feature +bf16 -mfloat-abi hard \
-// RUN: -disable-O0-optnone -S -emit-llvm -o - %s \
-// RUN: | opt -S -instcombine \
-// RUN: | FileCheck %s
+// RUN: -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -instcombine | FileCheck %s
+// RUN: %clang_cc1 -triple armv8.2a-arm-none-eabi -target-feature +neon -target-feature +bf16 -mfloat-abi softfp \
+// RUN: -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -instcombine | FileCheck %s
 
 // REQUIRES: arm-registered-target
 
Index: clang/test/CodeGen/arm-bf16-params-returns.c
===
--- clang/test/CodeGen/arm-bf16-params-returns.c
+++ clang/test/CodeGen/arm-bf16-params-returns.c
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -triple armv8.6a-arm-none-eabi -target-abi aapcs -mfloat-abi hard -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -mem2reg -sroa | FileCheck %s --check-prefix=CHECK32-HARD
-// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-abi aapcs -mfloat-abi hard -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -mem2reg -sroa | FileCheck %s --check-prefix=CHECK64-HARD
-// RUN: %clang_cc1 -triple armv8.6a-arm-none-eabi -target-abi aapcs -mfloat-abi softfp -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -mem2reg -sroa | FileCheck %s --check-prefix=CHECK32-SOFTFP
-// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-abi aapcs -mfloat-abi softfp -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -mem2reg -sroa | FileCheck %s --check-prefix=CHECK64-SOFTFP
+// RUN: %clang_cc1 -triple armv8.6a-arm-none-eabi -target-abi aapcs -mfloat-abi hard -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -mem2reg -sroa | FileCheck %s
+// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-abi aapcs -mfloat-abi hard -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -mem2reg -sroa | FileCheck %s
+// RUN: %clang_cc1 -triple armv8.6a-arm-none-eabi -target-abi aapcs -mfloat-abi softfp -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -mem2reg -sroa | FileCheck %s
+// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-abi aapcs -mfloat-abi softfp -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -mem2reg -sroa | FileCheck %s
 
 #include 
 
@@ -9,24 +9,11 @@
 __bf16 test_ret_bf16(__bf16 v) {
   return v;
 }
-// CHECK32-HARD: define arm_aapcs_vfpcc bfloat @test_ret_bf16(bfloat returned %v) {{.*}} {
-// CHECK32-HARD: ret bfloat %v
-// CHECK64-HARD: define bfloat @test_ret_bf16(bfloat returned %v) {{.*}} {
-// CHECK64-HARD: ret bfloat %v
-// CHECK32-SOFTFP: define i32 @test_ret_bf16(i32 [[V0:.*]]) {{.*}} {
-// CHECK32-SOFTFP: %tmp2.0.insert.ext = and i32 [[V0]], 65535
-// CHECK32-SOFTFP: ret i32 %tmp2.0.insert.ext
-// CHECK64-SOFTFP: define bfloat @test_ret_bf16(bfloat returned %v) {{.*}} {
-// CHECK64-SOFTFP: ret bfloat %v
+// CHECK: define {{.*}}bfloat @test_ret_bf16(bfloat returned %v) {{.*}} {
+// CHECK: ret bfloat %v
 
 bfloat16x4_t test_ret_bf16x4_t(bfloat16x4_t v) {
   return v;
 }
-// CHECK32-HARD: define arm_aapcs_vfpcc <4 x bfloat> @test_ret_bf16x4_t(<4 x bfloat> returned %v) {{.*}} {
-// CHECK32-HARD: ret <4 x bfloat> %v
-// CHECK64-HARD: define <4 x bfloat> @test_ret_bf16x4_t(<4 x bfloat> returned %v) {{.*}} {
-// CHECK64-HARD: ret <4 x bfloat> %v
-// CHECK32-SOFTFP: define <2 x i32> @test_ret_bf16x4_t(<2 x i32> [[V0:.*]]) {{.*}} {
-// CHECK32-SOFTFP: ret <2 x i32> %v
-// CHECK64-SOFTFP: define <4 x bfloat> @test_ret_bf16x4_t(<4 x bfloat> returned %v) {{.*}} {
-// CHECK64-SOFTFP: ret <4 x bfloat> %v
+// CHECK: define {{.*}}<4 x bfloat> @test_ret_bf16x4_t(<4 x bfloat> returned %v) {{.*}} {
+// CHECK: ret <4 x bfloat> %v
Index: clang/test/CodeGen/arm-bf16-getset-intrinsics.c