[polly] r262113 - ScopInfo: Add function to invalidate ScopArrayInfo object

Hongbin Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 23:16:47 PST 2016


On Sat, Feb 27, 2016 at 2:04 PM, Tobias Grosser via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: grosser
> Date: Sat Feb 27 00:04:40 2016
> New Revision: 262113
>
> URL: http://llvm.org/viewvc/llvm-project?rev=262113&view=rev
> Log:
> ScopInfo: Add function to invalidate ScopArrayInfo object
>
> In case the underlying basepointer of a ScopArrayInfo object is moved to
> another
> module while the scop is still processed is it necessary to free dependent
> ScopArrayInfo objects as they might otherwise be looked accidentally when a
> new llvm basepointer value is reassigned the very same memory location as
> the
> llvm value that has been moved earlier.
>
> This function is not yet used in Polly itself, but is useful for external
> users.
>
> Modified:
>     polly/trunk/include/polly/ScopInfo.h
>
> Modified: polly/trunk/include/polly/ScopInfo.h
> URL:
> http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=262113&r1=262112&r2=262113&view=diff
>
> ==============================================================================
> --- polly/trunk/include/polly/ScopInfo.h (original)
> +++ polly/trunk/include/polly/ScopInfo.h Sat Feb 27 00:04:40 2016
> @@ -1931,6 +1931,14 @@ public:
>    const ScopArrayInfo *getScopArrayInfo(Value *BasePtr,
>                                          ScopArrayInfo::MemoryKind Kind);
>
> +  /// @brief Invalidate ScopArrayInfo object for base address.
> +  ///
> +  /// @param BasePtr The base pointer of the ScopArrayInfo object to
> invalidate.
> +  /// @param Kind    The Kind of the ScopArrayInfo object.
> +  void invalidateScopArrayInfo(Value *BasePtr, ScopArrayInfo::MemoryKind
> Kind) {
> +    ScopArrayInfoMap.erase(std::make_pair(BasePtr, Kind));
>
Can we use a PointerIntPair as the key here instead? the BasePtr should be
already guarded by the AssertingVH inside ScopArrayInfo.


+  }
> +
>    void setContext(isl_set *NewContext);
>
>    /// @brief Align the parameters in the statement to the scop context
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160227/fb4fe95f/attachment.html>


More information about the llvm-commits mailing list