scaling an llvm-based heap profiler · scaling an llvm-based heap profiler 1. vector getvalues(...

79
Memoro Thierry Treyer Performance & Capacity Intern Mark Santaniello Performance & Capacity Engineer James Larus EPFL IC School Dean Scaling an LLVM-Based Heap Profiler 1

Upload: others

Post on 13-Oct-2020

16 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Memoro

Thierry TreyerPerformance & Capacity Intern

Mark SantanielloPerformance & Capacity Engineer

James LarusEPFL IC School Dean

Scaling an LLVM-Based Heap Profiler

1

Page 2: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

vector<BigT> getValues( map<Id, BigT>& largeMap, vector<Id>& keys) {

vector<BigT> values; values.reserve(largeMap.size());

for (const auto& key: keys) values.emplace_back(largeMap[key]);

return values; }

2

Page 3: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

40 GiBof DRAM wasted per server

3

Page 4: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

vector<BigT> getValues( map<Id, BigT>& largeMap, vector<Id>& keys) {

vector<BigT> values; values.reserve(largeMap.size());

for (const auto& key: keys) values.emplace_back(largeMap[key]);

return values; }

4

Page 5: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

vector<BigT> getValues( map<Id, BigT>& largeMap, vector<Id>& keys) {

vector<BigT> values; values.reserve(largeMap.size());

for (const auto& key: keys) values.emplace_back(largeMap[key]);

return values; }

5

Page 6: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

vector<BigT> getValues( map<Id, BigT>& largeMap, vector<Id>& keys) {

vector<BigT> values; values.reserve(keys.size());

for (const auto& key: keys) values.emplace_back(largeMap[key]);

return values; }

6

Page 7: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

LLVM

Sanitizers

Memoro

LLVM-Based Profiler

7

Page 8: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

LLVM

Sanitizers

Memoro

Manipulate the IR

LLVM-Based Profiler

7

Page 9: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

LLVM

Sanitizers

Memoro

Manipulate the IR

Infrastructure

LLVM-Based Profiler

7

Page 10: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

LLVM

Sanitizers

Memoro

Manipulate the IR

Infrastructure

Collecting and Displaying data

LLVM-Based Profiler

7

Page 11: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Visualizer

Open Challenges

Run-Time Overhead

Memoro +

8

Page 12: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Source Code Compile Run Analyze

Overview

9

Page 13: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Source Code Compile Run Analyze

No modification

Overview

9

Page 14: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Source Code Compile Run Analyze

No modification Instrument loads/storesInstrument intrinsicsCollect types

Overview

INSTRUMENTATION PASS (LLVM)

9

Page 15: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Source Code Compile Run Analyze

No modification Instrument loads/stores Intercept alloc/freeInstrument intrinsicsCollect types

Intercept loads/storesIntercept syscallsCollect stats

Overview

INSTRUMENTATION PASS (LLVM)

RUN-TIME (COMPILER-RT)

9

Page 16: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Source Code Compile Run Analyze

No modification Instrument loads/stores Intercept alloc/free Score APInstrument intrinsicsCollect types

Intercept loads/storesIntercept syscalls

Guide exploration

Collect stats

Overview

INSTRUMENTATION PASS (LLVM)

RUN-TIME (COMPILER-RT)

VISUALIZER (ELECTRON)

9

Page 17: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Source Code Compile Run Analyze

No modification Instrument loads/stores Intercept alloc/free Score APInstrument intrinsicsCollect types

Intercept loads/storesIntercept syscalls

Guide exploration

Collect stats

Overview

INSTRUMENTATION PASS (LLVM)

RUN-TIME (COMPILER-RT)

VISUALIZER (ELECTRON)

9

Page 18: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Visualizer

Open Challenges

Run-Time Overhead

Memoro +

10

Page 19: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Visualizer

Open Challenges

Run-Time Overhead

Memoro +

10

Page 20: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

1,000xslowdown due to Memoro's run-time

11

Page 21: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Run-Time Sampling

void interceptLoadStore(…) { // Sample accesses if (sample_count++ % access_sampling_rate != 0) return;

/* Process access... */ }

int sample_count = 0;

12

Page 22: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Run-Time Sampling

void interceptLoadStore(…) { // Sample accesses if (sample_count++ % access_sampling_rate != 0) return;

/* Process access... */ }

THREADLOCAL int sample_count = 0;

12

Page 23: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Power to the user!MEMORO_OPTIONS="…" ./myapp - access_sampling_rate - ...

// Public API: memoro_interface.h #include <memoro_interface.h> void foo(…) { MemoroFlags *mflags = memoro::getFlags(); mflags->access_sampling_rate = 50; /* ... */ }

13

Page 24: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

99%

🕵

14

Page 25: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Time spent by address type

0% 25% 50% 75% 100%

Primary Heap Secondary Heap Not Heap

99%

🕵

14

Page 26: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Time spent by address type

0% 25% 50% 75% 100%

Primary Heap Secondary Heap Stack

99%

🕵

14

Page 27: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Secondary − large allocations O(n)

Primary O(1)

ld 0x…

MetadataAddrSize

First Access TimeAccess Range Low

🕵The Allocators

15

Page 28: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Secondary − large allocations O(n)

Primary O(1)

ld 0x…

MetadataAddrSize

First Access TimeAccess Range Low

🔒

🕵The Allocators

15

Page 29: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

🕵Stack

Heap

Issue with non-heap addresses

16

Page 30: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

🕵1. Allocators only know about heap Stack

Heap

Issue with non-heap addresses

16

Page 31: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

🕵1. Allocators only know about heap

2. Traverse all allocations to discard them

Stack

Heap

Issue with non-heap addresses

16

Page 32: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

🕵1. Allocators only know about heap

2. Traverse all allocations to discard them

3. Takes a global lock

Stack

Heap

Issue with non-heap addresses

16

Page 33: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

🕵1. Allocators only know about heap

2. Traverse all allocations to discard them

3. Takes a global lock

Stack

Heap

Issue with non-heap addresses

0% 25% 50% 75% 100%Primary Heap Secondary Heap Stack

16

Page 34: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Stack

Heap

Run-Time Filter

17

Page 35: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

1. Thread start: store stack top Stack

Heap

Run-Time Filter0xABCD

17

Page 36: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

1. Thread start: store stack top

2. Get current stack bottom

Stack

Heap

Run-Time Filter0xABCD

0xAAAA

17

Page 37: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

1. Thread start: store stack top

2. Get current stack bottom

3. Discard if Addr. in this range

Stack

Heap

Run-Time Filter0xABCD

0xAAAA0xAABB

0x1234

17

Page 38: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

0.58%

0.58%Time spent by address type

0% 25% 50% 75% 100%

Primary Heap Secondary Heap Not heap Stack Filtered

99%

<2%

18

Page 39: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

1,000xslowdown due to Memoro's run-time

19

Page 40: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

5xslowdown due to Memoro's run-time

20

Page 41: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Visualizer

Open Challenges

Run-Time Overhead

Memoro +

21

Page 42: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Visualizer

Open Challenges

Run-Time Overhead

Memoro +

21

Page 43: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

+ 100,000Stack Traces

+ 1BAllocations

22

Page 44: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

23

Page 45: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Truncate

Scor

e

0%

10%

20%

30%

40%

Bin Size100 300 1k 3k 10k 30k 100k

24

Page 46: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Truncate

Scor

e

0%

10%

20%

30%

40%

Bin Size100 300 1k 3k 10k 30k 100k

HIDE

24

Page 47: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

25

Page 48: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

BEFORE AFTER

25

Page 49: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

VS.foo() bar()

Death by a thousand cuts

main()

.

.

.

main()

.

.

.

26

Page 50: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

VS.foo() bar()

Death by a thousand cuts

main()

.

.

.

main()

.

.

.

26

Page 51: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

VS.foo() bar()

Death by a thousand cuts

main()

.

.

.

main()

.

.

.

main()

26

Page 52: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

VS.foo() bar()

Death by a thousand cuts

main()

.

.

.

main()

.

.

.

.

26

Page 53: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

VS.foo() bar()

Death by a thousand cuts

main()

.

.

.

main()

.

.

..

26

Page 54: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

VS.foo() bar()

Death by a thousand cuts

main()

.

.

.

main()

.

.

. .

26

Page 55: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

VS.foo() bar()

Death by a thousand cuts

main()

.

.

.

main()

.

.

.bar()

26

Page 56: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

VS.foo() bar()

Death by a thousand cuts

main()

.

.

.

main()

.

.

.

26

Page 57: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

VS.foo() bar()

Death by a thousand cuts

main()

.

.

.

main()

.

.

.

26

Page 58: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

main() main()

Death by a thousand cuts

bar()

.

.

.

foo()

.

.

.

27

Page 59: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Memoro +

28

Page 60: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

vector<BigT> getValues( map<Id, BigT>& largeMap, vector<Id>& keys) {

vector<BigT> values; values.reserve(largeMap.size());

for (const auto& key: keys) values.emplace_back(largeMap[key]);

return values; }

29

Page 61: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Demo

30

Page 62: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Visualizer

Open Challenges

Run-Time Overhead

Memoro +

31

Page 63: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Dumping Profile

Your regular service

32

Page 64: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Dumping Profile

AtExit()Your regular service

32

Page 65: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Dumping Profile

AtExit()Your regular service

32

Page 66: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Dumping Profile

AtExit()Facebookservice

32

Page 67: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Dumping Profile

AtExit()Facebookservice

32

Page 68: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Dumping Profile

AtExit()Facebookservice

32

Page 69: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Dumping Profile

AtExit()Facebookservice

lldb call AtExit()

32

Page 70: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Dumping Profile

AtExit()Facebookservice

lldb call AtExit()

32

Page 71: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Dumping Profile

AtExit()Facebookservice

lldb call AtExit()

a. Signal to dump (SIGPROF)

32

Page 72: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Dumping Profile

AtExit()Facebookservice

lldb call AtExit()

a. Signal to dump (SIGPROF)

b. Ring buffer + Periodic write

32

Page 73: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Compile-Time Stack Analysis

33

Page 74: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Compile-Time Stack Analysis

ld/st

33

Page 75: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Compile-Time Stack Analysis

llvm::GetUnderlyingObject()ld/st

33

Page 76: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Compile-Time Stack Analysis

llvm::GetUnderlyingObject()

Ratio

Inst

rum

ente

d lo

ad/st

ore

0

22500

45000

67500

90000

GetUnderlyingObject(depth = X)0 1 2 4 8

ld/st

33

Page 77: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Compile-Time Stack Analysis

llvm::GetUnderlyingObject()

Ratio

Inst

rum

ente

d lo

ad/st

ore

0

22500

45000

67500

90000

GetUnderlyingObject(depth = X)0 1 2 4 8

ld/st

bar()

foo()

33

Page 78: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Compile-Time Stack Analysis

llvm::GetUnderlyingObject()

Ratio

Inst

rum

ente

d lo

ad/st

ore

0

22500

45000

67500

90000

GetUnderlyingObject(depth = X)0 1 2 4 8

ld/st

bar()

foo()

33

Page 79: Scaling an LLVM-Based Heap Profiler · Scaling an LLVM-Based Heap Profiler 1. vector getValues( map& largeMap, ... Overview INSTRUMENTATION PASS (LLVM)

Thank you!

Thierry TreyerPerformance & Capacity Intern

Mark SantanielloPerformance & Capacity Engineer

James LarusEPFL IC School Dean

34

github.com/epfl-vlsc/memoro