[PATCH] D30810: Preserve vec3 type.

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 14 15:54:32 PDT 2017


ahatanak added a comment.

It looks like converting vec3 to vec4 is incorrect in some cases. In the following program, IRGen emits "store <4 x float>" to store g1 to *a, which will overwrite s1.f2.

  typedef __attribute__((__ext_vector_type__(3))) float float3;
  
  struct S1 {
    float3 f1;
    float f2;
  };
  
  float3 g1;
  
  void __attribute__((noinline)) foo2(float3 *a) {
    *a = g1;
  }
  
  void foo1() {
    struct S1 s1;
    foo2(&s1.f1);
  }


https://reviews.llvm.org/D30810





More information about the cfe-commits mailing list