llvm.org GIT mirror llvm / c10ecd8
fix a really nasty basicaa mod/ref calculation bug that was causing miscompilation of UnitTests/ObjC/messages-2.m with the recent optimizer improvements. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131897 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 8 years ago
2 changed file(s) with 22 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
679679 unsigned ArgNo = 0;
680680 for (ImmutableCallSite::arg_iterator CI = CS.arg_begin(), CE = CS.arg_end();
681681 CI != CE; ++CI, ++ArgNo) {
682 // Only look at the no-capture pointer arguments.
682 // Only look at the no-capture or byval pointer arguments. If this
683 // pointer were passed to arguments that were neither of these, then it
684 // couldn't be no-capture.
683685 if (!(*CI)->getType()->isPointerTy() ||
684 !CS.paramHasAttr(ArgNo+1, Attribute::NoCapture))
686 (!CS.paramHasAttr(ArgNo+1, Attribute::NoCapture) &&
687 !CS.paramHasAttr(ArgNo+1, Attribute::ByVal)))
685688 continue;
686689
687690 // If this is a no-capture pointer argument, see if we can tell that it
235235 ; CHECK-NEXT: call void @llvm.memcpy
236236 ; CHECK-NEXT: ret
237237 }
238
239
240 ; The store here is not dead because the byval call reads it.
241 declare void @test19f({i32}* byval align 4 %P)
242
243 define void @test19({i32} * nocapture byval align 4 %arg5) nounwind ssp {
244 bb:
245 %tmp7 = getelementptr inbounds {i32}* %arg5, i32 0, i32 0
246 store i32 912, i32* %tmp7
247 call void @test19f({i32}* byval align 4 %arg5)
248 ret void
249
250 ; CHECK: @test19(
251 ; CHECK: store i32 912
252 ; CHECK: call void @test19f
253 }
254