[PATCH] [Polly] Support ModRef function behaviour

Johannes Doerfert doerfert at cs.uni-saarland.de
Wed Sep 10 11:59:08 PDT 2014


On 09/10, Hal Finkel wrote:
> ----- Original Message -----
> > From: "Johannes Doerfert" <doerfert at cs.uni-saarland.de>
> > To: doerfert at cs.uni-saarland.de, sebpop at gmail.com, simbuerg at fim.uni-passau.de, dpeixott at codeaurora.org,
> > tobias at grosser.es
> > Cc: llvm-commits at cs.uiuc.edu
> > Sent: Wednesday, September 10, 2014 1:32:32 PM
> > Subject: Re: [PATCH] [Polly] Support ModRef function behaviour
> > 
> > >>! In D5227#11, @dpeixott wrote:
> > >>>! In D5227#10, @jdoerfert wrote:
> > >>>>! In D5227#7, @dpeixott wrote:
> > >>> As far as I know detailed mod-ref-behaviour is currently only
> > >>> returned in the case of intrinsic functions. These functions are
> > >>> defined with the appropriate values and tablegen generates some
> > >>> code to return the correct values. You could use an intrinsic
> > >>> function in your test (e.g. llvm.prefetch).
> > >> 
> > >> Unfortunatly I cannot export the "onlyReadsArgumentPointees" of
> > >> llvm.prefetch to IR... it gets overaproximated to
> > >> "onlyReadsMemory" for now.
> > > 
> > > You could try the llvm.gcread (OnlyReadsArgumentPointes) and
> > > llvm.gcwrite (OnlyAccessesArgumentPointers) if you want to
> > > generate a test case. There are also a number of target-specific
> > > intrinsics you could use (e.g. llvm.arm.neon.vld1
> > >  (OnlyReadsArgumentPointes) llvm.arm.neon.vst1
> > >  (OnlyAccessesArgumentPointers)). An easy way find them is to
> > > check include/llvm/IR/Intrinsics.gen in the build directory.
> > 
> > Same problem as for prefetch, they have the attibute only between the
> > time they are created and written to IR. In LLVM-IR there is yet no
> > onlyReadsArgumentPointees or onlyAccessesArgumentPointees. The first
> > attribute gets lowered to onlyReads and the second one will be lost
> > in LLVM-IR.
> > I talked to Hal about this and offered to help add the new attributes
> > to the IR, maybe I should ping him again.
> 
> Sure, but I don't understand your statement. You can get at this information at the IR level by using ModRefBehavior getModRefBehavior(ImmutableCallSite CS) or ModRefBehavior getModRefBehavior(const Function *F) functions from AliasAnalysis. BasicAA does understand the properties of these intrinsics.
You are both right, my bad.

I thought the attribute (like readonly) is needed to do so but it is not
for intrinsics.

Test case featuring llvm.prefetch is coming up!

-- 

Johannes Doerfert
Researcher / PhD Student

Compiler Design Lab (Prof. Hack)
Saarland University, Computer Science
Building E1.3, Room 4.26

Tel. +49 (0)681 302-57521 : doerfert at cs.uni-saarland.de
Fax. +49 (0)681 302-3065  : http://www.cdl.uni-saarland.de/people/doerfert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140910/20650af1/attachment.sig>


More information about the llvm-commits mailing list