[PATCH] D77973: [VPlan] Move widening check for non-memory/non-calls to function (NFC).
    Ayal Zaks via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Apr 13 03:12:22 PDT 2020
    
    
  
Ayal accepted this revision.
Ayal added a comment.
This revision is now accepted and ready to land.
Thanks for cleaning this up! Final couple of nits.
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:6940
+bool VPRecipeBuilder::shouldWiden(Instruction *I, VFRange &Range) const {
+  assert(!isa<PHINode>(I) && "PHIs should have been handled earlier");
+  // Instruction should be widened, unless it is scalar after vectorization,
----------------
Retain the !isa<Call, Load, Store> alongside !isa<PHI>?
To avoid using this method for such opcodes, as their widening decision is more complex.
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:6946
+           !CM.isProfitableToScalarize(I, VF) &&
+           !CM.isScalarWithPredication(I, VF);
   };
----------------
More natural to reverse the conditions and rename willWiden to willScalarize, returning !getDecisionAndClampRange(willScalarize, Range)?
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:6969
     case Instruction::BitCast:
     case Instruction::Br:
     case Instruction::FAdd:
----------------
Branches should also find their way out of IsVectorizableOpcode and into an assert; no recipes are created for them.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77973/new/
https://reviews.llvm.org/D77973
    
    
More information about the llvm-commits
mailing list