[polly] r210753 - Check for an empty error log.

David Peixotto dpeixott at codeaurora.org
Thu Jun 12 10:02:57 PDT 2014


> -----Original Message-----
> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-
> bounces at cs.uiuc.edu] On Behalf Of Andreas Simbuerger
> Sent: Thursday, June 12, 2014 12:25 AM
> To: llvm-commits at cs.uiuc.edu
> Subject: [polly] r210753 - Check for an empty error log.
> 
> Author: simbuerg
> Date: Thu Jun 12 02:25:08 2014
> New Revision: 210753
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=210753&view=rev
> Log:
> Check for an empty error log.
> 
> Fixes #19976.
> 
> The error log does not contain an error, in case we reject a candidate
> without generating a diagnostic message by using invalid<>(...). This is
> the case for the top-level region of a function.
> 
> The patch comes without a test-case because adding a useful one requires
> additional code just for triggering it. Before the patch it would only
> trigger, if we try to print the CFG with Scop error annotations.
> 
> Modified:
>     polly/trunk/lib/Analysis/ScopDetection.cpp
> 
> Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
> URL: http://llvm.org/viewvc/llvm-
> project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=210753&r1=210752&r2
> =210753&view=diff
> ==========================================================================
> ====
> --- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
> +++ polly/trunk/lib/Analysis/ScopDetection.cpp Thu Jun 12 02:25:08 2014
> @@ -219,7 +219,14 @@ std::string ScopDetection::regionIsInval
>    // Get the first error we found. Even in keep-going mode, this is the
> first
>    // reason that caused the candidate to be rejected.
>    RejectLog Errors = RejectLogs.at(R);
> -  return (*Errors.begin())->getMessage();
> +
> +  // This can happen when we marked a region invalid, but didn't track
> + // an error for it.
> +  if (Errors.size() == 0)
> +    return "";
> +
> +  RejectReasonPtr RR = *Errors.begin();  return RR->getMessage();
>  }

Sorry for the late review, but it seems like it would be better to make sure
we track a reject reason for each invalid region. How about adding a reject
reason for the top level region to fix the bug?




More information about the llvm-commits mailing list