[llvm] b750862 - [LV] Use early exit for stores storing the ptr operand. (NFC)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Tue May 30 04:14:33 PDT 2023
Author: Florian Hahn
Date: 2023-05-30T12:14:12+01:00
New Revision: b75086210774a05181b8f313ba441ccc920d5d9e
URL: https://github.com/llvm/llvm-project/commit/b75086210774a05181b8f313ba441ccc920d5d9e
DIFF: https://github.com/llvm/llvm-project/commit/b75086210774a05181b8f313ba441ccc920d5d9e.diff
LOG: [LV] Use early exit for stores storing the ptr operand. (NFC)
Cleanup suggested in D150991.
Added:
Modified:
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 0bf3b97161f9..0a99ccb5df37 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -4701,13 +4701,9 @@ void LoopVectorizationCostModel::collectLoopUniforms(ElementCount VF) {
// I, I is known to not require scalarization, and the pointer is not also
// stored.
auto isVectorizedMemAccessUse = [&](Instruction *I, Value *Ptr) -> bool {
- auto GetStoredValue = [I]() -> Value * {
- if (!isa<StoreInst>(I))
- return nullptr;
- return I->getOperand(0);
- };
- return getLoadStorePointerOperand(I) == Ptr && isUniformDecision(I, VF) &&
- GetStoredValue() != Ptr;
+ if (isa<StoreInst>(I) && I->getOperand(0) == Ptr)
+ return false;
+ return getLoadStorePointerOperand(I) == Ptr && isUniformDecision(I, VF);
};
// Holds a list of values which are known to have at least one uniform use.
More information about the llvm-commits
mailing list