llvm.org GIT mirror llvm / ddf0706
Merging r168280: into 3.2 release branch. Don't try to calculate the alignment of an unsigned type. Fixes PR14371! git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168480 91177308-0d34-0410-b5e6-96231b3b80d8 Pawel Wodnicki 6 years ago
2 changed file(s) with 18 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
163163 return TD.getPreferredAlignment(GV);
164164
165165 if (PointerType *PT = dyn_cast(V->getType()))
166 return TD.getABITypeAlignment(PT->getElementType());
166 if (PT->getElementType()->isSized())
167 return TD.getABITypeAlignment(PT->getElementType());
167168
168169 return 0;
169170 }
9393 tail call void @f(i32* %b)
9494 ret void
9595 }
96
97 ; PR14371
98 %opaque_type = type opaque
99 %real_type = type { { i32, i32* } }
100
101 @opaque_global = external constant %opaque_type, align 4
102
103 define void @test7() {
104 entry:
105 %0 = alloca %real_type, align 4
106 %1 = bitcast %real_type* %0 to i8*
107 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %1, i8* bitcast (%opaque_type* @opaque_global to i8*), i32 8, i32 1, i1 false)
108 ret void
109 }
110
111 declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind