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 !dbg !4 { 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, metadata !{{[0-9]+}}, metadata {{.*}}), !dbg !{{[0-9]+}} 20; CHECK: tail call void @llvm.dbg.value(metadata <4 x i32>* %b, metadata !{{[0-9]+}}, metadata {{.*}}), !dbg !{{[0-9]+}} 21; CHECK: tail call void @llvm.dbg.value(metadata <4 x i32>* %c, 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, metadata !15, metadata !DIExpression()), !dbg !20 41 tail call void @llvm.dbg.value(metadata <4 x i32>* %b, metadata !16, metadata !DIExpression()), !dbg !20 42 tail call void @llvm.dbg.value(metadata <4 x i32>* %c, metadata !17, metadata !DIExpression()), !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, 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 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 194134) (llvm/trunk 194126)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2) 61!1 = !DIFile(filename: "/tmp/add.c", directory: "/home/richards/llvm/build") 62!2 = !{} 63!4 = distinct !DISubprogram(name: "f1", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 4, file: !1, scope: !5, type: !6, retainedNodes: !14) 64!5 = !DIFile(filename: "/tmp/add.c", directory: "/home/richards/llvm/build") 65!6 = !DISubroutineType(types: !7) 66!7 = !{null, !8, !8, !8} 67!8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !9) 68!9 = !DIDerivedType(tag: DW_TAG_typedef, name: "V4SI", line: 1, file: !1, baseType: !10) 69!10 = !DICompositeType(tag: DW_TAG_array_type, size: 128, align: 128, flags: DIFlagVector, baseType: !11, elements: !12) 70!11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 71!12 = !{!13} 72!13 = !DISubrange(count: 4) 73!14 = !{!15, !16, !17} 74!15 = !DILocalVariable(name: "a", line: 3, arg: 1, scope: !4, file: !5, type: !8) 75!16 = !DILocalVariable(name: "b", line: 3, arg: 2, scope: !4, file: !5, type: !8) 76!17 = !DILocalVariable(name: "c", line: 3, arg: 3, scope: !4, file: !5, type: !8) 77!18 = !{i32 2, !"Dwarf Version", i32 4} 78!19 = !{!"clang version 3.4 (trunk 194134) (llvm/trunk 194126)"} 79!20 = !DILocation(line: 3, scope: !4) 80!21 = !DILocation(line: 5, scope: !4) 81!22 = !{!23, !23, i64 0} 82!23 = !{!"omnipotent char", !24, i64 0} 83!24 = !{!"Simple C/C++ TBAA"} 84!25 = !DILocation(line: 6, scope: !4) 85!26 = !{i32 1, !"Debug Info Version", i32 3} 86