llvm.org GIT mirror llvm / 88a9f04
Handle an addrspacecast case in memcpyopt git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199836 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Arsenault 5 years ago
2 changed file(s) with 18 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
661661 while (!srcUseList.empty()) {
662662 User *UI = srcUseList.pop_back_val();
663663
664 if (isa(UI)) {
664 if (isa(UI) || isa(UI)) {
665665 for (User::use_iterator I = UI->use_begin(), E = UI->use_end();
666666 I != E; ++I)
667667 srcUseList.push_back(*I);
7777
7878 declare void @test4a(i8* align 1 byval)
7979 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
80 declare void @llvm.memcpy.p1i8.p1i8.i64(i8 addrspace(1)* nocapture, i8 addrspace(1)* nocapture, i64, i32, i1) nounwind
8081
8182 %struct.S = type { i128, [4 x i8]}
8283
150151
151152 ; rdar://11341081
152153 %struct.big = type { [50 x i32] }
154
155 define void @test9_addrspacecast() nounwind ssp uwtable {
156 entry:
157 ; CHECK-LABEL: @test9_addrspacecast(
158 ; CHECK: f1
159 ; CHECK-NOT: memcpy
160 ; CHECK: f2
161 %b = alloca %struct.big, align 4
162 %tmp = alloca %struct.big, align 4
163 call void @f1(%struct.big* sret %tmp)
164 %0 = addrspacecast %struct.big* %b to i8 addrspace(1)*
165 %1 = addrspacecast %struct.big* %tmp to i8 addrspace(1)*
166 call void @llvm.memcpy.p1i8.p1i8.i64(i8 addrspace(1)* %0, i8 addrspace(1)* %1, i64 200, i32 4, i1 false)
167 call void @f2(%struct.big* %b)
168 ret void
169 }
153170
154171 define void @test9() nounwind ssp uwtable {
155172 entry: