[PATCH] D31175: Improve TargetTransformInfo::getCFInstrCost()

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 29 00:53:41 PDT 2017


jonpa updated this revision to Diff 100590.
jonpa added a comment.

> Style: go ahead and do...

Like this?

I am not sure exactly what type of example you have in mind, since SystemZ is not using the LoopVectorizers if conversion that much. If you have such examples that need to be improved here, it's probably a better idea that you and/or Matthew worked on this...


https://reviews.llvm.org/D31175

Files:
  lib/Transforms/Vectorize/LoopVectorize.cpp


Index: lib/Transforms/Vectorize/LoopVectorize.cpp
===================================================================
--- lib/Transforms/Vectorize/LoopVectorize.cpp
+++ lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -7327,14 +7327,10 @@
     // In cases of scalarized and predicated instructions, there will be VF
     // predicated blocks in the vectorized loop. Each branch around these
     // blocks requires also an extract of its vector compare i1 element.
-    bool ScalarPredicatedBB = false;
     BranchInst *BI = cast<BranchInst>(I);
     if (VF > 1 && BI->isConditional() &&
         (PredicatedBBsAfterVectorization.count(BI->getSuccessor(0)) ||
-         PredicatedBBsAfterVectorization.count(BI->getSuccessor(1))))
-      ScalarPredicatedBB = true;
-
-    if (ScalarPredicatedBB) {
+         PredicatedBBsAfterVectorization.count(BI->getSuccessor(1)))) {
       // Return cost for branches around scalarized and predicated blocks.
       Type *Vec_i1Ty =
           VectorType::get(IntegerType::getInt1Ty(RetTy->getContext()), VF);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31175.100590.patch
Type: text/x-patch
Size: 1045 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170529/7d5b7cab/attachment.bin>


More information about the llvm-commits mailing list