llvm.org GIT mirror llvm / cd77a50
Preserve line no. info. Radar 9097659 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127182 91177308-0d34-0410-b5e6-96231b3b80d8 Devang Patel 8 years ago
2 changed file(s) with 51 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
492492 Value *NumBytes =
493493 Expander.expandCodeFor(NumBytesS, IntPtr, Preheader->getTerminator());
494494
495 Value *NewCall;
495 CallInst *NewCall;
496496 if (SplatValue)
497497 NewCall = Builder.CreateMemSet(BasePtr, SplatValue,NumBytes,StoreAlignment);
498498 else {
516516
517517 DEBUG(dbgs() << " Formed memset: " << *NewCall << "\n"
518518 << " from store to: " << *Ev << " at: " << *TheStore << "\n");
519 (void)NewCall;
519 NewCall->setDebugLoc(TheStore->getDebugLoc());
520520
521521 // Okay, the memset has been formed. Zap the original store and anything that
522522 // feeds into it.
0 ; RUN: opt -loop-idiom < %s -S | FileCheck %s
1 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
2 target triple = "x86_64-apple-darwin10.0.0"
3
4
5 define void @foo(double* nocapture %a) nounwind ssp {
6 entry:
7 tail call void @llvm.dbg.value(metadata !{double* %a}, i64 0, metadata !5), !dbg !8
8 tail call void @llvm.dbg.value(metadata !9, i64 0, metadata !10), !dbg !14
9 br label %for.body
10
11 for.body: ; preds = %entry, %for.body
12 %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.body ]
13 %arrayidx = getelementptr double* %a, i64 %indvar
14 ; CHECK: call void @llvm.memset{{.+}} !dbg
15 store double 0.000000e+00, double* %arrayidx, align 8, !dbg !15
16 %indvar.next = add i64 %indvar, 1
17 %exitcond = icmp ne i64 %indvar.next, 1000
18 br i1 %exitcond, label %for.body, label %for.end, !dbg !14
19
20 for.end: ; preds = %for.body
21 tail call void @llvm.dbg.value(metadata !{null}, i64 0, metadata !10), !dbg !16
22 ret void, !dbg !17
23 }
24
25 declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
26
27 declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone
28
29 !llvm.dbg.sp = !{!0}
30
31 !0 = metadata !{i32 589870, i32 0, metadata !1, metadata !"foo", metadata !"foo", metadata !"", metadata !1, i32 2, metadata !3, i1 false, i1 true, i32 0, i32 0, i32 0, i32 256, i1 false, void (double*)* @foo} ; [ DW_TAG_subprogram ]
32 !1 = metadata !{i32 589865, metadata !"li.c", metadata !"/private/tmp", metadata !2} ; [ DW_TAG_file_type ]
33 !2 = metadata !{i32 589841, i32 0, i32 12, metadata !"li.c", metadata !"/private/tmp", metadata !"clang version 2.9 (trunk 127165:127174)", i1 true, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ]
34 !3 = metadata !{i32 589845, metadata !1, metadata !"", metadata !1, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !4, i32 0, i32 0} ; [ DW_TAG_subroutine_type ]
35 !4 = metadata !{null}
36 !5 = metadata !{i32 590081, metadata !0, metadata !"a", metadata !1, i32 16777218, metadata !6, i32 0} ; [ DW_TAG_arg_variable ]
37 !6 = metadata !{i32 589839, metadata !2, metadata !"", null, i32 0, i64 64, i64 64, i64 0, i32 0, metadata !7} ; [ DW_TAG_pointer_type ]
38 !7 = metadata !{i32 589860, metadata !2, metadata !"double", null, i32 0, i64 64, i64 64, i64 0, i32 0, i32 4} ; [ DW_TAG_base_type ]
39 !8 = metadata !{i32 2, i32 18, metadata !0, null}
40 !9 = metadata !{i32 0}
41 !10 = metadata !{i32 590080, metadata !11, metadata !"i", metadata !1, i32 3, metadata !13, i32 0} ; [ DW_TAG_auto_variable ]
42 !11 = metadata !{i32 589835, metadata !12, i32 3, i32 3, metadata !1, i32 1} ; [ DW_TAG_lexical_block ]
43 !12 = metadata !{i32 589835, metadata !0, i32 2, i32 21, metadata !1, i32 0} ; [ DW_TAG_lexical_block ]
44 !13 = metadata !{i32 589860, metadata !2, metadata !"int", null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ]
45 !14 = metadata !{i32 3, i32 3, metadata !12, null}
46 !15 = metadata !{i32 4, i32 5, metadata !11, null}
47 !16 = metadata !{i32 3, i32 29, metadata !11, null}
48 !17 = metadata !{i32 5, i32 1, metadata !12, null}