[llvm-bugs] [Bug 44527] New: [clang] 'align_value' attribute not added to variables in types (LLVM type can't express it?)

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jan 12 06:06:23 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=44527

            Bug ID: 44527
           Summary: [clang] 'align_value' attribute not added to variables
                    in types (LLVM type can't express it?)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: lebedev.ri at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

typedef double * aligned_double_ptr __attribute__((align_value(64)));

struct S {
    aligned_double_ptr y;
};

void foo(S*s){
    s->y = 0;
}

As per https://godbolt.org/z/PtLP2e
we get

%struct.S = type { double* }
define dso_local void @_Z3fooP1S(%struct.S* nocapture %0) local_unnamed_addr #0
{
  %2 = getelementptr inbounds %struct.S, %struct.S* %0, i64 0, i32 0
  store double* null, double** %2, align 8, !tbaa !2
  ret void
}


So the alignment info did not reach IR.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200112/1bf8fea0/attachment.html>


More information about the llvm-bugs mailing list