Skip to content

Commit 259d56d

Browse files
[LoopAccessAnalysis] Add a const qualifier to getMaxSafeDepDistBytes()
Add a const qualifier to this API call, since this is a member of MemoryDepChecker and LoopAccessInfo returns an object of this class as a const, as follows: const MemoryDepChecker &getDepChecker() const { return *DepChecker; } If one tries to use function as follows: LAI->getDepChecker().getMaxSafeDepDistBytes() results in the following error: passing ‘const llvm::MemoryDepChecker’ as ‘this’ argument discards qualifiers Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D156304
1 parent 076bee1 commit 259d56d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/Analysis/LoopAccessAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class MemoryDepChecker {
200200

201201
/// The maximum number of bytes of a vector register we can vectorize
202202
/// the accesses safely with.
203-
uint64_t getMaxSafeDepDistBytes() { return MaxSafeDepDistBytes; }
203+
uint64_t getMaxSafeDepDistBytes() const { return MaxSafeDepDistBytes; }
204204

205205
/// Return the number of elements that are safe to operate on
206206
/// simultaneously, multiplied by the size of the element in bits.

0 commit comments

Comments
 (0)