[PATCH] D63437: [CodeGen][ARM] Fix FP16 vector coercion

Mikhail Maltsev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 17 08:46:34 PDT 2019


miyuki created this revision.
miyuki added reviewers: eli.friedman, olista01.
Herald added subscribers: kristof.beyls, javed.absar.
Herald added a project: clang.

When a function argument or return type is a homogeneous aggregate
which contains an FP16 vector but the target does not support FP16
operations natively, the type must be converted into an array of
integer vectors by then front end (otherwise LLVM will handle FP16
vectors incorrectly by scalarizing them and promoting FP16 to float,
see https://reviews.llvm.org/D50507).

Currently the logic for checking whether or not a given homogeneous
aggregate contains FP16 vectors is incorrect: it only looks at the
type of the first vector.

This patch fixes the issue by adding a new method
ARMABIInfo::containsAnyFP16Vectors and using it. The traversal logic
of this method is largely the same as in
ABIInfo::isHomogeneousAggregate.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D63437

Files:
  clang/lib/CodeGen/TargetInfo.cpp
  clang/test/CodeGen/arm-vfp16-arguments2.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63437.205088.patch
Type: text/x-patch
Size: 5569 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190617/560f9fc0/attachment.bin>


More information about the cfe-commits mailing list