1; RUN: opt %s -scalarizer -scalarize-load-store -S | FileCheck %s 2target 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-S128" 3 4; Function Attrs: nounwind uwtable 5define void @f1(<4 x i32>* nocapture %a, <4 x i32>* nocapture readonly %b, <4 x i32>* nocapture readonly %c) #0 { 6; CHECK: @f1( 7; CHECK: %a.i0 = bitcast <4 x i32>* %a to i32* 8; CHECK: %a.i1 = getelementptr i32, i32* %a.i0, i32 1 9; CHECK: %a.i2 = getelementptr i32, i32* %a.i0, i32 2 10; CHECK: %a.i3 = getelementptr i32, i32* %a.i0, i32 3 11; CHECK: %c.i0 = bitcast <4 x i32>* %c to i32* 12; CHECK: %c.i1 = getelementptr i32, i32* %c.i0, i32 1 13; CHECK: %c.i2 = getelementptr i32, i32* %c.i0, i32 2 14; CHECK: %c.i3 = getelementptr i32, i32* %c.i0, i32 3 15; CHECK: %b.i0 = bitcast <4 x i32>* %b to i32* 16; CHECK: %b.i1 = getelementptr i32, i32* %b.i0, i32 1 17; CHECK: %b.i2 = getelementptr i32, i32* %b.i0, i32 2 18; CHECK: %b.i3 = getelementptr i32, i32* %b.i0, i32 3 19; CHECK: tail call void @llvm.dbg.value(metadata <4 x i32>* %a, i64 0, metadata !{{[0-9]+}}, metadata {{.*}}), !dbg !{{[0-9]+}} 20; CHECK: tail call void @llvm.dbg.value(metadata <4 x i32>* %b, i64 0, metadata !{{[0-9]+}}, metadata {{.*}}), !dbg !{{[0-9]+}} 21; CHECK: tail call void @llvm.dbg.value(metadata <4 x i32>* %c, i64 0, metadata !{{[0-9]+}}, metadata {{.*}}), !dbg !{{[0-9]+}} 22; CHECK: %bval.i0 = load i32, i32* %b.i0, align 16, !dbg ![[TAG1:[0-9]+]], !tbaa ![[TAG2:[0-9]+]] 23; CHECK: %bval.i1 = load i32, i32* %b.i1, align 4, !dbg ![[TAG1]], !tbaa ![[TAG2]] 24; CHECK: %bval.i2 = load i32, i32* %b.i2, align 8, !dbg ![[TAG1]], !tbaa ![[TAG2]] 25; CHECK: %bval.i3 = load i32, i32* %b.i3, align 4, !dbg ![[TAG1]], !tbaa ![[TAG2]] 26; CHECK: %cval.i0 = load i32, i32* %c.i0, align 16, !dbg ![[TAG1]], !tbaa ![[TAG2]] 27; CHECK: %cval.i1 = load i32, i32* %c.i1, align 4, !dbg ![[TAG1]], !tbaa ![[TAG2]] 28; CHECK: %cval.i2 = load i32, i32* %c.i2, align 8, !dbg ![[TAG1]], !tbaa ![[TAG2]] 29; CHECK: %cval.i3 = load i32, i32* %c.i3, align 4, !dbg ![[TAG1]], !tbaa ![[TAG2]] 30; CHECK: %add.i0 = add i32 %bval.i0, %cval.i0, !dbg ![[TAG1]] 31; CHECK: %add.i1 = add i32 %bval.i1, %cval.i1, !dbg ![[TAG1]] 32; CHECK: %add.i2 = add i32 %bval.i2, %cval.i2, !dbg ![[TAG1]] 33; CHECK: %add.i3 = add i32 %bval.i3, %cval.i3, !dbg ![[TAG1]] 34; CHECK: store i32 %add.i0, i32* %a.i0, align 16, !dbg ![[TAG1]], !tbaa ![[TAG2]] 35; CHECK: store i32 %add.i1, i32* %a.i1, align 4, !dbg ![[TAG1]], !tbaa ![[TAG2]] 36; CHECK: store i32 %add.i2, i32* %a.i2, align 8, !dbg ![[TAG1]], !tbaa ![[TAG2]] 37; CHECK: store i32 %add.i3, i32* %a.i3, align 4, !dbg ![[TAG1]], !tbaa ![[TAG2]] 38; CHECK: ret void 39entry: 40 tail call void @llvm.dbg.value(metadata <4 x i32>* %a, i64 0, metadata !15, metadata !MDExpression()), !dbg !20 41 tail call void @llvm.dbg.value(metadata <4 x i32>* %b, i64 0, metadata !16, metadata !MDExpression()), !dbg !20 42 tail call void @llvm.dbg.value(metadata <4 x i32>* %c, i64 0, metadata !17, metadata !MDExpression()), !dbg !20 43 %bval = load <4 x i32>, <4 x i32>* %b, align 16, !dbg !21, !tbaa !22 44 %cval = load <4 x i32>, <4 x i32>* %c, align 16, !dbg !21, !tbaa !22 45 %add = add <4 x i32> %bval, %cval, !dbg !21 46 store <4 x i32> %add, <4 x i32>* %a, align 16, !dbg !21, !tbaa !22 47 ret void, !dbg !25 48} 49 50; Function Attrs: nounwind readnone 51declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1 52 53attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } 54attributes #1 = { nounwind readnone } 55 56!llvm.dbg.cu = !{!0} 57!llvm.module.flags = !{!18, !26} 58!llvm.ident = !{!19} 59 60!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 194134) (llvm/trunk 194126)", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) 61!1 = !MDFile(filename: "/tmp/add.c", directory: "/home/richards/llvm/build") 62!2 = !{} 63!3 = !{!4} 64!4 = !MDSubprogram(name: "f1", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !1, scope: !5, type: !6, function: void (<4 x i32>*, <4 x i32>*, <4 x i32>*)* @f1, variables: !14) 65!5 = !MDFile(filename: "/tmp/add.c", directory: "/home/richards/llvm/build") 66!6 = !MDSubroutineType(types: !7) 67!7 = !{null, !8, !8, !8} 68!8 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !9) 69!9 = !MDDerivedType(tag: DW_TAG_typedef, name: "V4SI", line: 1, file: !1, baseType: !10) 70!10 = !MDCompositeType(tag: DW_TAG_array_type, size: 128, align: 128, flags: DIFlagVector, baseType: !11, elements: !12) 71!11 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 72!12 = !{!13} 73!13 = !MDSubrange(count: 4) 74!14 = !{!15, !16, !17} 75!15 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 3, arg: 1, scope: !4, file: !5, type: !8) 76!16 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 3, arg: 2, scope: !4, file: !5, type: !8) 77!17 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "c", line: 3, arg: 3, scope: !4, file: !5, type: !8) 78!18 = !{i32 2, !"Dwarf Version", i32 4} 79!19 = !{!"clang version 3.4 (trunk 194134) (llvm/trunk 194126)"} 80!20 = !MDLocation(line: 3, scope: !4) 81!21 = !MDLocation(line: 5, scope: !4) 82!22 = !{!23, !23, i64 0} 83!23 = !{!"omnipotent char", !24, i64 0} 84!24 = !{!"Simple C/C++ TBAA"} 85!25 = !MDLocation(line: 6, scope: !4) 86!26 = !{i32 1, !"Debug Info Version", i32 3} 87