Skip to content

Commit 1436ada

Browse files
committed
[LV-L] Add const and move method body out of line [nfc]
1 parent 1db43b7 commit 1436ada

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -352,20 +352,11 @@ class LoopVectorizationLegality {
352352
int isConsecutivePtr(Type *AccessTy, Value *Ptr) const;
353353

354354
/// Returns true if the value V is uniform within the loop.
355-
bool isUniform(Value *V);
355+
bool isUniform(Value *V) const;
356356

357357
/// A uniform memory op is a load or store which accesses the same memory
358358
/// location on all lanes.
359-
bool isUniformMemOp(Instruction &I) {
360-
Value *Ptr = getLoadStorePointerOperand(&I);
361-
if (!Ptr)
362-
return false;
363-
// Note: There's nothing inherent which prevents predicated loads and
364-
// stores from being uniform. The current lowering simply doesn't handle
365-
// it; in particular, the cost model distinguishes scatter/gather from
366-
// scalar w/predication, and we currently rely on the scalar path.
367-
return isUniform(Ptr) && !blockNeedsPredication(I.getParent());
368-
}
359+
bool isUniformMemOp(Instruction &I) const;
369360

370361
/// Returns the information that we collected about runtime memory check.
371362
const RuntimePointerChecking *getRuntimePointerChecking() const {

llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,21 @@ int LoopVectorizationLegality::isConsecutivePtr(Type *AccessTy,
462462
return 0;
463463
}
464464

465-
bool LoopVectorizationLegality::isUniform(Value *V) {
465+
bool LoopVectorizationLegality::isUniform(Value *V) const {
466466
return LAI->isUniform(V);
467467
}
468468

469+
bool LoopVectorizationLegality::isUniformMemOp(Instruction &I) const {
470+
Value *Ptr = getLoadStorePointerOperand(&I);
471+
if (!Ptr)
472+
return false;
473+
// Note: There's nothing inherent which prevents predicated loads and
474+
// stores from being uniform. The current lowering simply doesn't handle
475+
// it; in particular, the cost model distinguishes scatter/gather from
476+
// scalar w/predication, and we currently rely on the scalar path.
477+
return isUniform(Ptr) && !blockNeedsPredication(I.getParent());
478+
}
479+
469480
bool LoopVectorizationLegality::canVectorizeOuterLoop() {
470481
assert(!TheLoop->isInnermost() && "We are not vectorizing an outer loop.");
471482
// Store the result and return it at the end instead of exiting early, in case

0 commit comments

Comments
 (0)