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

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 23:21:59 PST 2016

On 02/27/2016 08:16 AM, Hongbin Zheng wrote:
>     +  ///
>     +  /// @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.

What would be the benefit of using a PointerIntPair? This is a pure 
performance optimization, right?

In case this is just about performance, I would prefer not to use 
PointerIntPairs. This code is likely not performance sensitive and 
PointerIntPairs are from my point of view harder to read and debug as 
normal pairs.


More information about the llvm-commits mailing list