mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
LoopVectorize: Do not vectorize loops with tiny constant trip counts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167101 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1145,6 +1145,14 @@ bool LoopVectorizationLegality::canVectorize() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Do not loop-vectorize loops with a tiny trip count.
|
||||
unsigned TC = SE->getSmallConstantTripCount(TheLoop, BB);
|
||||
if (TC > 0 && TC < 16) {
|
||||
DEBUG(dbgs() << "LV: Found a loop with a very small trip count. " <<
|
||||
"This loop is not worth vectorizing.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG(dbgs() << "LV: We can vectorize this loop!\n");
|
||||
|
||||
// Okay! We can vectorize. At this point we don't have any other mem analysis
|
||||
|
Reference in New Issue
Block a user