brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · b31b732 Raw
59 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 52; RUN: opt -S < %s -passes=loop-vectorize -force-vector-width=2 | FileCheck %s3;; Tests that when we simplify the loop-exit branch condition, we preserve the4;; !dbg attachment for all loop-exit branches.5 6define i32 @foo(ptr %p) {7; CHECK-LABEL: define i32 @foo(8; CHECK-SAME: ptr [[P:%.*]]) {9; CHECK-NEXT:  [[ENTRY:.*:]]10; CHECK-NEXT:    br label %[[VECTOR_PH:.*]]11; CHECK:       [[VECTOR_PH]]:12; CHECK-NEXT:    br label %[[VECTOR_BODY:.*]]13; CHECK:       [[VECTOR_BODY]]:14; CHECK-NEXT:    store i8 0, ptr [[P]], align 1, !dbg [[DBG3:![0-9]+]]15; CHECK-NEXT:    br label %[[MIDDLE_BLOCK:.*]]16; CHECK:       [[MIDDLE_BLOCK]]:17; CHECK-NEXT:    br label %[[EXIT:.*]], !dbg [[DBG3]]18; CHECK:       [[EXIT]]:19; CHECK-NEXT:    ret i32 020;21entry:22  br label %loop23 24loop:                                          ; preds = %loop, %entry25  %iv = phi i64 [ %iv.next, %loop ], [ 0, %entry ], !dbg !326  %conv = trunc i64 0 to i8, !dbg !427  store i8 %conv, ptr %p, align 1, !dbg !528  %iv.next = add i64 %iv, 1, !dbg !629  %exitcond = icmp eq i64 %iv, 1, !dbg !730  br i1 %exitcond, label %exit, label %loop, !dbg !831 32exit:                              ; preds = %loop33  ret i32 034}35 36!llvm.dbg.cu = !{!0}37!llvm.module.flags = !{!2}38 39!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 20.0.0git")40!1 = !DIFile(filename: "test.cpp", directory: "/")41!2 = !{i32 2, !"Debug Info Version", i32 3}42!3 = !DILocation(line: 4, scope: !9)43!4 = !DILocation(line: 5, scope: !9)44!5 = !DILocation(line: 6, scope: !9)45!6 = !DILocation(line: 7, scope: !9)46!7 = !DILocation(line: 8, scope: !9)47!8 = !DILocation(line: 9, scope: !9)48!9 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 11, type: !10, unit: !0, retainedNodes: !11)49!10 = distinct !DISubroutineType(types: !11)50!11 = !{}51;.52; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: [[META1:![0-9]+]], producer: "{{.*}}clang version {{.*}}", isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug)53; CHECK: [[META1]] = !DIFile(filename: "{{.*}}test.cpp", directory: {{.*}})54; CHECK: [[DBG3]] = !DILocation(line: 6, scope: [[META4:![0-9]+]])55; CHECK: [[META4]] = distinct !DISubprogram(name: "foo", scope: [[META1]], file: [[META1]], line: 11, type: [[META5:![0-9]+]], spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META6:![0-9]+]])56; CHECK: [[META5]] = distinct !DISubroutineType(types: [[META6]])57; CHECK: [[META6]] = !{}58;.59