[PATCH] D74362: Cheap Function Entry Instrumentation for Dead Code Detection

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 30 17:30:17 PDT 2020


MaskRay added a comment.

A high-level comment: does this pass achieve something not doable with XRay, a mature instrumentation framework in LLVM?



================
Comment at: llvm/test/Instrumentation/InstrFuncEntry/funcentry.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -debug -instrfuncentry -func-entry-write-mapping=%T/mapping -S -func-entry-instruction-threshold=1 < %s 2>&1 | FileCheck %s
+; RUN: opt -instrfuncentry -func-entry-write-mapping=%T/mapping -func-entry-instruction-threshold=1 < %s | llc -o - | FileCheck %s --check-prefix=ASMCHECK
----------------
%T in lit is deprecated.


================
Comment at: llvm/test/Instrumentation/InstrFuncEntry/verify-files-created.ll:4
+; RUN: grep _llvm_funcentry_array_5977508082728489289 %T/mapping/func-entry-global-buffer.txt | FileCheck %s --check-prefix=CHECK-BUFFER
+; RUN: grep MD5 %T/mapping/func-entry-write-mapping.txt | FileCheck %s --check-prefix=CHECK-MAPPING
+; Cleanup
----------------
We generally avoid grep in tests. Just use FileCheck.


================
Comment at: llvm/test/Instrumentation/InstrFuncEntry/verify-files-created.ll:6
+; Cleanup
+; RUN: rm -rf %T
+
----------------
This is dangerous. %T refers to the parent directory. You may accidentally delete files in a sibling testing process.


================
Comment at: llvm/test/Instrumentation/InstrFuncEntry/verify-files-created.ll:43
+}
+
----------------
No trailing empty line


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74362/new/

https://reviews.llvm.org/D74362





More information about the llvm-commits mailing list