[PATCH] D50480: [LV] Vectorizing loops of arbitrary trip count without remainder under opt for size
Hideki Saito via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 15 11:20:45 PDT 2018
hsaito added inline comments.
================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:4948
- // If we don't know the precise trip count, don't try to vectorize.
- if (TC < 2) {
- ORE->emit(
- createMissedAnalysis("UnknownLoopCountComplexCFG")
- << "unable to calculate the loop count due to complex control flow");
- LLVM_DEBUG(
- dbgs() << "LV: Aborting. A tail loop is required with -Os/-Oz.\n");
+ if (TC == 1) {
+ LLVM_DEBUG(dbgs() << "LV: Aborting, single iteration (non) loop.\n");
----------------
reames wrote:
> There's a mix of seemingly unrelated changes here. This is one example. It would be good to land these separately.
This change is relevant in the sense that TC < 2 is split into two parts: TC==1 and TC==0. TC==0 case will then have a chance of hitting Legal->canFoldTailByMasking() later. As a result, TC==1 case can return early here, with a very crisp messaging.
Having said that, if you'd like to see the same ORE->emit(...) LLVM_DEBUG() stuff here, I won't go against that. Messaging change can be a separate commit.
Ayal, we need ORE->emit() here, in addition to LLVM_DEBUG(), right, regardless of whether we change the actual message?
Repository:
rL LLVM
https://reviews.llvm.org/D50480
More information about the llvm-commits
mailing list