[polly] r265379 - ScopInfo: Check for possibly nested GEP in fixed-size delin

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 5 08:59:50 PDT 2016


You might want to add a test case for the actual fix of the bug.

On 04/05, Tobias Grosser via llvm-commits wrote:
> Author: grosser
> Date: Tue Apr  5 01:23:45 2016
> New Revision: 265379
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=265379&view=rev
> Log:
> ScopInfo: Check for possibly nested GEP in fixed-size delin
> 
> We currently only consider the first GEP when delinearizing access functions,
> which makes us loose information about additional index expression offsets,
> which results in our SCoP model to be incorrect. With this patch we now
> compare the base pointers used to ensure we do not miss any additional offsets.
> This fixes llvm.org/PR27195.
> 
> We may consider supporting nested GEP in our delinearization heuristics in
> the future.
> 
> Modified:
>     polly/trunk/lib/Analysis/ScopInfo.cpp
> 
> Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=265379&r1=265378&r2=265379&view=diff
> ==============================================================================
> --- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
> +++ polly/trunk/lib/Analysis/ScopInfo.cpp Tue Apr  5 01:23:45 2016
> @@ -3985,6 +3985,14 @@ bool ScopInfo::buildAccessMultiDimFixed(
>    std::tie(Subscripts, Sizes) = getIndexExpressionsFromGEP(GEP, *SE);
>    auto *BasePtr = GEP->getOperand(0);
>  
> +  if (auto *BasePtrCast = dyn_cast<BitCastInst>(BasePtr))
> +    BasePtr = BasePtrCast->getOperand(0);
> +
> +  // Check for identical base pointers to ensure that we do not miss index
> +  // offsets that have been added before this GEP is applied.
> +  if (BasePtr != BasePointer->getValue())
> +    return false;
> +
>    std::vector<const SCEV *> SizesSCEV;
>  
>    for (auto *Subscript : Subscripts) {
> 
> 
> _______________________________________________
> 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 University, Computer Science
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: 213 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160405/4aa4bc28/attachment.sig>


More information about the llvm-commits mailing list