forked from OSchip/llvm-project
[LAA] Comment couldPreventStoreLoadForward. NFC
Also s/Cycles/Iters/ in NumCyclesForStoreLoadThroughMemory to make it clear that this is not about clock cycles but loop cycles/iterations. llvm-svn: 269667
This commit is contained in:
parent
9b5852aeb2
commit
884d313b7f
|
@ -321,6 +321,9 @@ private:
|
|||
|
||||
/// \brief Check whether the data dependence could prevent store-load
|
||||
/// forwarding.
|
||||
///
|
||||
/// \return false if we shouldn't vectorize at all or avoid larger
|
||||
/// vectorization factors by limiting MaxSafeDepDistBytes.
|
||||
bool couldPreventStoreLoadForward(unsigned Distance, unsigned TypeByteSize);
|
||||
};
|
||||
|
||||
|
|
|
@ -1081,14 +1081,20 @@ bool MemoryDepChecker::couldPreventStoreLoadForward(unsigned Distance,
|
|||
// hence on your typical architecture store-load forwarding does not take
|
||||
// place. Vectorizing in such cases does not make sense.
|
||||
// Store-load forwarding distance.
|
||||
const unsigned NumCyclesForStoreLoadThroughMemory = 8 * TypeByteSize;
|
||||
|
||||
// After this many iterations store-to-load forwarding conflicts should not
|
||||
// cause any slowdowns.
|
||||
const unsigned NumItersForStoreLoadThroughMemory = 8 * TypeByteSize;
|
||||
// Maximum vector factor.
|
||||
unsigned MaxVFWithoutSLForwardIssues = std::min(
|
||||
VectorizerParams::MaxVectorWidth * TypeByteSize, MaxSafeDepDistBytes);
|
||||
|
||||
// Compute the smallest VF at which the store and load would be misaligned.
|
||||
for (unsigned VF = 2 * TypeByteSize; VF <= MaxVFWithoutSLForwardIssues;
|
||||
VF *= 2) {
|
||||
if (Distance % VF && Distance / VF < NumCyclesForStoreLoadThroughMemory) {
|
||||
// If the number of vector iteration between the store and the load are
|
||||
// small we could incur conflicts.
|
||||
if (Distance % VF && Distance / VF < NumItersForStoreLoadThroughMemory) {
|
||||
MaxVFWithoutSLForwardIssues = (VF >>= 1);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue