[cfe-dev] Need Help: A small problem in Clang

David Blaikie dblaikie at gmail.com
Mon Mar 30 13:22:11 PDT 2015


On Mon, Mar 30, 2015 at 3:54 AM, David Chisnall <David.Chisnall at cl.cam.ac.uk
> wrote:

> Is this a class assignment?


Well spotted - I honestly wouldn't've called that. (we do see some number
of these sort of questions on a regular basis, but you're right - two /very
similar/ ones was noteworthy)

Hrm. Guess that's the price of popularity? Not that I have a problem
helping people (even students doing homework) get started, but for the
issues you quite correctly point out below \/


>   Someone else was asking the same question recently, and it is impossible
> to help because the problem is poorly specified (for example, in optimised
> code this may end up being a small number of vector reads and writes, or a
> single memcpy call).
>
> David
>
> > On 27 Mar 2015, at 08:57, phongph <phongph.hut at gmail.com> wrote:
> >
> > Hi everyone,
> >
> > I am having a small problem as follows, please help me:
> >
> > Implement, using LLVM/Clang, to count the number of memory operations
> > executed in a given function (recording reads and writes of fields and
> > arrays elements) of C programs. Here is an example:
> >
> >            int* test(int* b, int* c) {
> >               ...
> >               for (int i=0; i<10; i++) {
> >                   a[i] =b[i] + c[i];
> >               }
> >               return a;
> >            }
> >
> > After execution of the whole program, the output of the instrumentation
> > should return something like this for each method: "function test: reads
> =
> > 20; writes = 10".
> >
> > Thank you very much!
> >
> >
> >
> > --
> > View this message in context:
> http://clang-developers.42468.n3.nabble.com/Need-Help-A-small-problem-in-Clang-tp4044707.html
> > Sent from the Clang Developers mailing list archive at Nabble.com.
> > _______________________________________________
> > cfe-dev mailing list
> > cfe-dev at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150330/826290cc/attachment.html>


More information about the cfe-dev mailing list