Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[memprof] Only insert dynamic shadow load when needed
We don't need to insert a load of the dynamic shadow address unless there are interesting memory accesses to profile. Split out of D124703. Differential Revision: https://reviews.llvm.org/D124797
- Loading branch information
1 parent
b26e44e
commit 084b65f
Showing
2 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
llvm/test/Instrumentation/HeapProfiler/no-instrumentation.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
;; Test that we don't add any instrumentation code to functions without | ||
;; interesting memory accesses. | ||
; | ||
; RUN: opt < %s -passes='function(memprof),module(memprof-module)' -S -debug 2>&1 | FileCheck %s | ||
|
||
;; Require asserts for -debug | ||
; REQUIRES: asserts | ||
|
||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" | ||
target triple = "x86_64-unknown-linux-gnu" | ||
|
||
define void @_Z3foov() { | ||
entry: | ||
ret void | ||
} | ||
|
||
;; Confirm we ran memprof and decided not to instrument | ||
; CHECK: MEMPROF done instrumenting: 0 define void @_Z3foov | ||
|
||
;; We should not add any instrumentation related code | ||
; CHECK: define void @_Z3foov | ||
; CHECK-NEXT: entry: | ||
; CHECK-NEXT: ret void |