Skip to content
Commit e56360a2 authored by Justin Lebar's avatar Justin Lebar
Browse files

[CUDA] Align kernel launch args correctly when the LLVM type's alignment is...

[CUDA] Align kernel launch args correctly when the LLVM type's alignment is different from the clang type's alignment.

Summary:
Before this patch, we computed the offsets in memory of args passed to
GPU kernel functions by throwing all of the args into an LLVM struct.

clang emits packed llvm structs basically whenever it feels like it, and
packed structs have alignment 1.  So we cannot rely on the llvm type's
alignment matching the C++ type's alignment.

This patch fixes our codegen so we always respect the clang types'
alignments.

Reviewers: rnk

Subscribers: cfe-commits, tra

Differential Revision: https://reviews.llvm.org/D22879

llvm-svn: 276927
parent 58b377e8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment