[PATCH] D22822: Adjust coercion of aggregates on RenderScript

Pirama Arumuga Nainar via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 10:47:09 PDT 2016


pirama created this revision.
pirama added a reviewer: rsmith.
pirama added subscribers: llvm-commits, srhines.
Herald added a subscriber: aemerson.

In RenderScript, the size of the argument or return value emitted in the
IR is expected to be the same as the size of corresponding qualified
type.  For ARM and AArch64, the coercion performed by Clang can
change the parameter or return value to a type whose size is different
(usually larger) than the original aggregate type.  Specifically, this
can happen in the following cases:
    - Aggregate parameters of size <= 64 bytes and return values smaller
      than 4 bytes on ARM
    - Aggregate parameters and return values smaller than bytes on
      AArch64

This patch coerces the cases above to an integer array that is the same
size and alignment as the original aggregate.  A new field is added to
TargetInfo to detect a RenderScript target and limit this coercion just
to that case.

Tests added to test/CodeGen/renderscript.c

https://reviews.llvm.org/D22822

Files:
  include/clang/Basic/TargetInfo.h
  lib/Basic/TargetInfo.cpp
  lib/Basic/Targets.cpp
  lib/CodeGen/TargetInfo.cpp
  test/CodeGen/renderscript.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22822.65553.patch
Type: text/x-patch
Size: 10998 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160726/119d1d81/attachment-0001.bin>


More information about the llvm-commits mailing list