Giter Site home page Giter Site logo

Comments (2)

linnaea avatar linnaea commented on July 22, 2024

Repro

typedef struct __attribute__ ((packed)) {
    uint a;
    uint b;
    uint c;
} s;

kernel void k(__global const s* ins, __global uint* out) {
  uint a = ins[0].a;
  uint b = ins[0].b;
  uint c = ins[0].c;
  out[0] = a;
  out[1] = b;
  out[2] = c;
}

Gives the following sequence

  %0 = bitcast %struct.s addrspace(1)* %ins to <3 x i32> addrspace(1)*
  %1 = load <3 x i32>, <3 x i32> addrspace(1)* %0, align 1
  %2 = extractelement <3 x i32> %1, i32 0
  %3 = extractelement <3 x i32> %1, i32 1
  %4 = extractelement <3 x i32> %1, i32 2
  %5 = bitcast i32 addrspace(1)* %out to <3 x i32> addrspace(1)*
  %6 = insertelement <3 x i32> undef, i32 %2, i32 0
  %7 = insertelement <3 x i32> %6, i32 %3, i32 1
  %8 = insertelement <3 x i32> %7, i32 %4, i32 2
  store <3 x i32> %8, <3 x i32> addrspace(1)* %5, align 4
  ret void

from beignet.

linnaea avatar linnaea commented on July 22, 2024

Should be fixed in e576632

from beignet.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.