[prev in list] [next in list] [prev in thread] [next in thread]
List: llvm-dev
Subject: [llvm-dev] Identify accessed memory regions with LLVM pass
From: Harish via llvm-dev <llvm-dev () lists ! llvm ! org>
Date: 2021-12-28 5:58:27
Message-ID: CA+BROwBFdR450m-j1Knw9zJw5hviYZFd3o8oOHDRuNXAdECijA () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
I am working on an architecture that uses scratchpad memory. So I am
planning to implement a pass that inserts data transfer
instructions(custom) before the computation. Look at the below example
where the fun() needs A, B, C arrays. Before invoking fun(), I have the
move these arrays to the scratchpad. How do I identify the memory region
accessed by these arrays? Any pointers would be helpful.
void fun(int *A, int *B, int *C, int start, int end){
for (int i = start; i < end; ++i) {
[i] = A[i] + B[i];
}
}
void test(){
int start, end;
int *A, *B, *C;
// Intialize variables
// TODO:
// 1. Identify the memory region accessed by A, B and C
// 2. Move the accessed regions to scratchpad memory
fun(A, B, C, start, end);
}
[Attachment #5 (text/html)]
<div dir="ltr"><div> I am working on an architecture that uses scratchpad memory. So \
I am planning to implement a pass that inserts data transfer
instructions(custom) before the computation. Look at the below example
where the fun() needs A, B, C arrays. Before invoking fun(), I have the
move these arrays to the scratchpad. How do I identify the memory region
accessed by these arrays? Any pointers would be helpful.</div><div><pre><code>void \
fun(int *A, int *B, int *C, int start, int end){ for (int i = start; i < end; \
++i) { [i] = A[i] + B[i];
}
}
void test(){
int start, end;
int *A, *B, *C;
// Intialize variables
// TODO:
// 1. Identify the memory region accessed by A, B and C
// 2. Move the accessed regions to scratchpad memory
fun(A, B, C, start, end);
}</code></pre></div></div>
[Attachment #6 (text/plain)]
_______________________________________________
LLVM Developers mailing list
llvm-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic