Skip to content

Commit 2a4cbf8

Browse files
authored
[Loads] Const correct the Size argument to isSafeToLoadUnconditionally. NFC (#96993)
The APInt is not modified so we should pass by const reference.
1 parent 6b4a13a commit 2a4cbf8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/include/llvm/Analysis/Loads.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ bool isDereferenceableAndAlignedPointer(const Value *V, Align Alignment,
6868
/// If it is not obviously safe to load from the specified pointer, we do a
6969
/// quick local scan of the basic block containing ScanFrom, to determine if
7070
/// the address is already accessed.
71-
bool isSafeToLoadUnconditionally(Value *V, Align Alignment, APInt &Size,
71+
bool isSafeToLoadUnconditionally(Value *V, Align Alignment, const APInt &Size,
7272
const DataLayout &DL,
7373
Instruction *ScanFrom = nullptr,
7474
AssumptionCache *AC = nullptr,

llvm/lib/Analysis/Loads.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ bool llvm::isDereferenceableAndAlignedInLoop(LoadInst *LI, Loop *L,
349349
///
350350
/// This uses the pointee type to determine how many bytes need to be safe to
351351
/// load from the pointer.
352-
bool llvm::isSafeToLoadUnconditionally(Value *V, Align Alignment, APInt &Size,
352+
bool llvm::isSafeToLoadUnconditionally(Value *V, Align Alignment, const APInt &Size,
353353
const DataLayout &DL,
354354
Instruction *ScanFrom,
355355
AssumptionCache *AC,

0 commit comments

Comments
 (0)