Adjust coercion of aggregates on RenderScript
Summary: 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 Reviewers: rsmith Subscribers: aemerson, srhines, llvm-commits Differential Revision: https://reviews.llvm.org/D22822 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276904 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Basic/TargetInfo.h 5 additions, 0 deletionsinclude/clang/Basic/TargetInfo.h
- lib/Basic/TargetInfo.cpp 1 addition, 0 deletionslib/Basic/TargetInfo.cpp
- lib/Basic/Targets.cpp 4 additions, 1 deletionlib/Basic/Targets.cpp
- lib/CodeGen/TargetInfo.cpp 46 additions, 0 deletionslib/CodeGen/TargetInfo.cpp
- test/CodeGen/renderscript.c 115 additions, 0 deletionstest/CodeGen/renderscript.c
Loading
Please register or sign in to comment