[polly] r287270 - [FIX] Do not try to hoist memory intrinsic

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 18 04:47:52 PST 2016


On 11/18, Tobias Grosser wrote:
> On Thu, Nov 17, 2016, at 11:11 PM, Johannes Doerfert via llvm-commits
> wrote:
> > Author: jdoerfert
> > Date: Thu Nov 17 16:11:56 2016
> > New Revision: 287270
> > 
> > URL: http://llvm.org/viewvc/llvm-project?rev=287270&view=rev
> > Log:
> > [FIX] Do not try to hoist memory intrinsic
> > 
> > Since we do not necessarily treat memory intrinsics as non-affine
> > anymore, we have to check for them explicitly before we try to hoist an
> > access.
> 
> Hi Johannes,
> 
> thanks for the fix! Would it be possible to add a test case or is this
> hard for some reason?
I did not have time to distill one from the SPEC benchmarks (and
possibly others) that failed (with enabled hoisting) after the "memory
intrinsics are affine patch". However, it should not be hard though. Any
affine memory read that was caused by a memory intrinsic, e.g., memcpy,
should do... 

I would guess that is sufficient to explicitly enabling hoisting for the
memcpy testcase we already have to exposed the problem. Since initially
there was no flag to disable hoisting, no test case explicitly enables
it, thus the test coverage we lost (unit tests + lnt) by disabling
hoisting is enormous...

In my opinion the actual coverage problem is that hoisting is disabled
globally on __all__ buildbots. Using __only__ profitable buildbots for a
while caused us so much pain at some point. I would not have thought we
would willingly go through the same trouble again but it seems history
repeats itself.
 
Cheers,
  JD

> > 
> > Modified:
> >     polly/trunk/include/polly/ScopInfo.h
> >     polly/trunk/lib/Analysis/ScopInfo.cpp
> > 
> > Modified: polly/trunk/include/polly/ScopInfo.h
> > URL:
> > http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=287270&r1=287269&r2=287270&view=diff
> > ==============================================================================
> > --- polly/trunk/include/polly/ScopInfo.h (original)
> > +++ polly/trunk/include/polly/ScopInfo.h Thu Nov 17 16:11:56 2016
> > @@ -747,6 +747,11 @@ public:
> >    /// Is this a write memory access?
> >    bool isWrite() const { return isMustWrite() || isMayWrite(); }
> >  
> > +  /// Is this a memory intrinsic access (memcpy, memset, memmove)?
> > +  bool isMemoryIntrinsic() const {
> > +    return isa<MemIntrinsic>(getAccessInstruction());
> > +  }
> > +
> >    /// Check if a new access relation was imported or set by a pass.
> >    bool hasNewAccessRelation() const { return NewAccessRelation; }
> >  
> > 
> > Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
> > URL:
> > http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=287270&r1=287269&r2=287270&view=diff
> > ==============================================================================
> > --- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
> > +++ polly/trunk/lib/Analysis/ScopInfo.cpp Thu Nov 17 16:11:56 2016
> > @@ -676,7 +676,7 @@ void MemoryAccess::assumeNoOutOfBound()
> >  }
> >  
> >  void MemoryAccess::buildMemIntrinsicAccessRelation() {
> > -  assert(isa<MemIntrinsic>(getAccessInstruction()));
> > +  assert(isMemoryIntrinsic());
> >    assert(Subscripts.size() == 2 && Sizes.size() == 1);
> >  
> >    auto *SubscriptPWA = getPwAff(Subscripts[0]);
> > @@ -3487,7 +3487,8 @@ __isl_give isl_set *Scop::getNonHoistabl
> >    auto &Stmt = *Access->getStatement();
> >    BasicBlock *BB = Stmt.getEntryBlock();
> >  
> > -  if (Access->isScalarKind() || Access->isWrite() ||
> > !Access->isAffine())
> > +  if (Access->isScalarKind() || Access->isWrite() || !Access->isAffine()
> > ||
> > +      Access->isMemoryIntrinsic())
> >      return nullptr;
> >  
> >    // Skip accesses that have an invariant base pointer which is defined
> >    but
> > 
> > 
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits

-- 

Johannes Doerfert
Researcher / PhD Student

Compiler Design Lab (Prof. Hack)
Saarland Informatics Campus, Germany
Building E1.3, Room 4.31

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: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161118/c29de1c6/attachment.sig>


More information about the llvm-commits mailing list