summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2016-12-01 17:34:50 +0000
committerAdam Nemet <anemet@apple.com>2016-12-01 17:34:50 +0000
commit4ddb8c01b1b3c1cb24e87f992ad00826025ac1ba (patch)
tree4a4fc941e79d25f8b2551481bb7f4c8a7d9920d7 /llvm/test
parent8b5fba8081d1494b367671095c6d74d0a013694f (diff)
downloadbcm5719-llvm-4ddb8c01b1b3c1cb24e87f992ad00826025ac1ba.tar.gz
bcm5719-llvm-4ddb8c01b1b3c1cb24e87f992ad00826025ac1ba.zip
[GVN, OptDiag] Print the interesting instructions involved in missed load-elimination
[recommitting after the fix in r288307] This includes the intervening store and the load/store that we're trying to forward from in the optimization remark for the missed load elimination. This is hooked up under a new mode in ORE that allows for compile-time budget for a bit more analysis to print more insightful messages. This mode is currently enabled for -fsave-optimization-record (-Rpass is trickier since it is controlled in the front-end). With this we can now print the red remark in http://lab.llvm.org:8080/artifacts/opt-view_test-suite/build/SingleSource/Benchmarks/Dhrystone/CMakeFiles/dry.dir/html/_org_test-suite_SingleSource_Benchmarks_Dhrystone_dry.c.html#L446 Differential Revision: https://reviews.llvm.org/D26490 llvm-svn: 288381
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/GVN/opt-remarks.ll45
1 files changed, 44 insertions, 1 deletions
diff --git a/llvm/test/Transforms/GVN/opt-remarks.ll b/llvm/test/Transforms/GVN/opt-remarks.ll
index 14c1feff4a1..e31793038cb 100644
--- a/llvm/test/Transforms/GVN/opt-remarks.ll
+++ b/llvm/test/Transforms/GVN/opt-remarks.ll
@@ -40,7 +40,22 @@
; YAML-NEXT: - String: ' in favor of '
; YAML-NEXT: - InfavorOfValue: load
; YAML-NEXT: ...
-
+; YAML-NEXT: --- !Missed
+; YAML-NEXT: Pass: gvn
+; YAML-NEXT: Name: LoadClobbered
+; YAML-NEXT: DebugLoc: { File: /tmp/s.c, Line: 3, Column: 3 }
+; YAML-NEXT: Function: may_alias
+; YAML-NEXT: Args:
+; YAML-NEXT: - String: 'load of type '
+; YAML-NEXT: - Type: i32
+; YAML-NEXT: - String: ' not eliminated'
+; YAML-NEXT: - String: ' in favor of '
+; YAML-NEXT: - OtherAccess: load
+; YAML-NEXT: DebugLoc: { File: /tmp/s.c, Line: 1, Column: 13 }
+; YAML-NEXT: - String: ' because it is clobbered by '
+; YAML-NEXT: - ClobberedBy: store
+; YAML-NEXT: DebugLoc: { File: /tmp/s.c, Line: 2, Column: 10 }
+; YAML-NEXT: ...
define i32 @arg(i32* %p, i32 %i) {
entry:
@@ -63,3 +78,31 @@ entry:
%add = add i32 %load1, %load
ret i32 %add
}
+
+define i32 @may_alias(i32* %p, i32* %r) !dbg !7 {
+entry:
+ %load1 = load i32, i32* %p, !tbaa !13, !dbg !9
+ store i32 4, i32* %r, !tbaa !13, !dbg !10
+ %load = load i32, i32* %p, !tbaa !13, !dbg !11
+ %add = add i32 %load1, %load
+ ret i32 %add
+}
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4, !5}
+!llvm.ident = !{!6}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 282540) (llvm/trunk 282542)", isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2)
+!1 = !DIFile(filename: "/tmp/s.c", directory: "/tmp")
+!2 = !{}
+!3 = !{i32 2, !"Dwarf Version", i32 4}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
+!5 = !{i32 1, !"PIC Level", i32 2}
+!6 = !{!"clang version 4.0.0 (trunk 282540) (llvm/trunk 282542)"}
+!7 = distinct !DISubprogram(name: "may_alias", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: true, unit: !0, variables: !2)
+!8 = !DISubroutineType(types: !2)
+!9 = !DILocation(line: 1, column: 13, scope: !7)
+!10 = !DILocation(line: 2, column: 10, scope: !7)
+!11 = !DILocation(line: 3, column: 3, scope: !7)
+
+!12 = !{ !"tbaa root" }
+!13 = !{ !"int", !12 }
OpenPOWER on IntegriCloud