brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 686ec6b Raw
48 lines · plain
1; RUN: opt < %s -passes=licm -pass-remarks-missed=licm -o /dev/null 2>&1 | FileCheck %s2; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' %s -o /dev/null -pass-remarks-missed=licm 2>&1 | FileCheck %s3target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"4 5; With the load from %p conditional, we can't optmize this and the remark6; should tell us about it.7 8define void @test(ptr %array, ptr noalias %p) {9Entry:10  br label %Loop11 12Loop:13  %j = phi i32 [ 0, %Entry ], [ %Next, %else]14  %addr = getelementptr i32, ptr %array, i32 %j15  %a = load i32, ptr %addr16  %c = icmp eq i32 %a, 017  br i1 %c, label %then, label %else18 19then:20; CHECK: remark: /tmp/kk.c:2:20: failed to hoist load with loop-invariant address because load is conditionally executed21  %b = load i32, ptr %p, !dbg !822  %a2 = add i32 %a, %b23  store i32 %a2, ptr %addr24  br label %else25 26else:27  %Next = add i32 %j, 128  %cond = icmp eq i32 %Next, 029  br i1 %cond, label %Out, label %Loop30 31Out:32  ret void33}34 35!llvm.dbg.cu = !{!0}36!llvm.module.flags = !{!3, !4}37!llvm.ident = !{!5}38 39!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, enums: !2)40!1 = !DIFile(filename: "/tmp/kk.c", directory: "/tmp")41!2 = !{}42!3 = !{i32 2, !"Debug Info Version", i32 3}43!4 = !{i32 1, !"PIC Level", i32 2}44!5 = !{!"clang version 3.9.0 "}45!6 = distinct !DISubprogram(name: "success", scope: !1, file: !1, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !2)46!7 = !DISubroutineType(types: !2)47!8 = !DILocation(line: 2, column: 20, scope: !6)48