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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to