[cfe-dev] Emitting loop metadata in codegen
ihusar at fit.vutbr.cz
ihusar at fit.vutbr.cz
Tue Sep 3 08:03:25 PDT 2013
Dear Paul and others,
I would like to ask whether you made any progress with this,
we are actually trying to do a similar thing:
- One thing is to introduce ICC-like pragmas and add support for them in
the vectorizer
(in fact this seems like the thing you were doing).
- Second one is to identify a block of code that should be identified as an
instruction set extension (ISE) and automatically generate a
description for an ADL Codal used in Codasip Framework.
I successfully added some pragmas to the clang, but currently I am trying
to figure out how to
correctly store metadata.
Do you have some clues i could follow? E.g. if the code is not private to
Intel, could I take a look?:)
Thank you and best regards
Adam
On Fri, 22 Feb 2013 21:50:57 +0100, Redmond, Paul <paul.redmond at intel.com>
wrote:
> Hi,
>
> As discussed earlier I'm implementing #pragma ivdep in clang. I use
> AttributedStmt with an IVDepAttr to wrap loop Stmts in the AST. So far I
> have only hacked in codegen to attach loop metadata.
>
> To do this correctly I need to attach metadata to all predecessors of
> the loop header. Also, I need to attach metadata to all loads and stores
> in the loop. (see llvm.loop.parallel and llvm.mem.parallel_loop_access)
>
> I'm wondering what the best way to implement this in clang codegen? I
> think this could get really messy and become very fragile if I just
> start modifying EmitForStmt, etc to check for some flag.
>
> One idea I've been thinking about is creating the metadata after code
> emission using a llvm loop pass (living in clang/lib/CodeGen) Basically
> during codegen I would attach a simple metadata (clang.pragma.ivdep or
> something) to a block in the loop and use the pass to translate to the
> metadata understood by llvm. I don't see a precedent for running
> clang-specific passes in codegen though..
>
> Comments and suggestions are appreciated.
>
> paul
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
More information about the cfe-dev
mailing list