[PATCH] D29837: [LazyMachineBFI] Add testcase

Adam Nemet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 10 10:42:07 PST 2017


anemet created this revision.
Herald added a subscriber: fhahn.
Herald added a reviewer: javed.absar.

This is based on Justin's testcase and checking whether BFI is not populated
in case hotness is off.

This is a patch meant on top of Justin's patch to enable Machine opt-remarks
in the
AsmPrinter (http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170130/426595.html)


https://reviews.llvm.org/D29837

Files:
  test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll


Index: test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll
===================================================================
--- /dev/null
+++ test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll
@@ -0,0 +1,34 @@
+; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -pass-remarks-analysis=asm-printer \
+; RUN:     -pass-remarks-with-hotness -debug-only=block-freq -debug-pass=Executions 2>&1 | FileCheck %s \
+; RUN:     -check-prefix=HOTNESS
+; RUUN: llc < %s -mtriple=arm64-apple-ios7.0 -pass-remarks-analysis=asm-printer \
+; RUUN:      -debug-only=block-freq 2>&1 | FileCheck %s -check-prefix=NO_HOTNESS
+
+; REQUIRES: asserts
+
+; Verify that we only populate MachineBFI on behalf of ORE when hotness is
+; requested.
+
+; HOTNESS: Executing Pass 'Machine Optimization Remark Emitter' on Function 'empty_func'
+; HOTNESS-NEXT: {{^$}}
+; HOTNESS-NEXT: block-frequency: empty_func
+
+; NO_HOTNESS: Executing Pass 'Machine Optimization Remark Emitter' on Function 'empty_func'
+; NO_HOTNESS-NEXT-NOT: {{^$}}
+; NO_HOTNESS-NEXT-NOT: block-frequency: empty_func
+
+; HOTNESS: arm64-summary-remarks.ll:5:0: 1 instructions in function (hotness: 33)
+; NO_HOTNESS: arm64-summary-remarks.ll:5:0: 1 instructions in function{{$}}
+
+define void @empty_func() nounwind ssp !dbg !3 !prof !4 {
+  ret void
+}
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!2}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1)
+!1 = !DIFile(filename: "arm64-summary-remarks.ll", directory: "")
+!2 = !{i32 2, !"Debug Info Version", i32 3}
+!3 = distinct !DISubprogram(name: "empty_func", scope: !1, file: !1, line: 5, unit: !0)
+!4 = !{!"function_entry_count", i64 33}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29837.88017.patch
Type: text/x-patch
Size: 1649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170210/0b728ccf/attachment.bin>


More information about the llvm-commits mailing list