take return value's align into consideration when computing minimum alignment
ADD
tests/alive-tv/attrs/align-issue625.srctgt.ll
+define align 2 i64* @src() {
+ %p = alloca i64, align 4
+ store i64 1, i64* %p, align 4
+ ret i64* %p
+}
+
+define align 2 i64* @tgt() {
+ %p = alloca i64, align 4
+ ret i64* %p
+}

MODIFY
tools/transform.cpp
tools/transform.cpp
@@ -696,6 +696,10 @@ static void calculateAndInitConstants(Transform &t) {
}
}
+ if (fn->getFnAttrs().has(FnAttrs::Align)) {
+ min_access_size = gcd(min_access_size, fn->getFnAttrs().align);
+ }
+
auto update_min_vect_sz = [&](const Type &ty) {
auto elemsz = minVectorElemSize(ty);
if (min_vect_elem_sz && elemsz)

take return value's align into consideration when computing minimum alignment (#629)