]> granicus.if.org Git - clang/commit
[CodeGen] Widen non-power-of-2 vector HFA base types.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Tue, 19 Apr 2016 17:54:29 +0000 (17:54 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Tue, 19 Apr 2016 17:54:29 +0000 (17:54 +0000)
commitc585033ef89cc7abe89b03cc4e94528abe3ee3aa
treecc90ae08dcdd500841306b2dd969ff5b32da5ca1
parentbdf0c75af06220c58203261de66859dbe0cf9520
[CodeGen] Widen non-power-of-2 vector HFA base types.

Currently, for the ppc64--gnu and aarch64 ABIs, we recognize:
  typedef __attribute__((__ext_vector_type__(3))) float v3f32;
  typedef __attribute__((__ext_vector_type__(16))) char v16i8;
  struct HFA {
    v3f32 a;
    v16i8 b;
  };

as an HFA. Since the first type encountered is used as the base type,
we pass the HFA as:
    [2 x <3 x float>]
Which leads to incorrect IR (relying on padding values) when the
second field is used.

Instead, explicitly widen the vector (after size rounding) in
isHomogeneousAggregate.

Differential Revision: http://reviews.llvm.org/D18998

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266784 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/TargetInfo.cpp
test/CodeGen/aarch64-arguments-hfa-v3.c [new file with mode: 0644]
test/CodeGen/arm64-arguments.c
test/CodeGen/ppc64le-aggregates.c