[llvm-branch-commits] [llvm] 533f857 - [VPlan] Use interleaveComma in printOperands() (NFC).

Florian Hahn via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Dec 13 08:36:21 PST 2020


Author: Florian Hahn
Date: 2020-12-13T16:29:16Z
New Revision: 533f85767c62d03cf72a67f826ed4c3b8023d79d

URL: https://github.com/llvm/llvm-project/commit/533f85767c62d03cf72a67f826ed4c3b8023d79d
DIFF: https://github.com/llvm/llvm-project/commit/533f85767c62d03cf72a67f826ed4c3b8023d79d.diff

LOG: [VPlan] Use interleaveComma in printOperands() (NFC).

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/VPlan.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index 7cc5291a35f9..516c149bd280 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -20,6 +20,7 @@
 #include "VPlanDominatorTree.h"
 #include "llvm/ADT/DepthFirstIterator.h"
 #include "llvm/ADT/PostOrderIterator.h"
+#include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Analysis/IVDescriptors.h"
@@ -1065,13 +1066,9 @@ void VPValue::printAsOperand(raw_ostream &OS, VPSlotTracker &Tracker) const {
 }
 
 void VPUser::printOperands(raw_ostream &O, VPSlotTracker &SlotTracker) const {
-  bool First = true;
-  for (VPValue *Op : operands()) {
-    if (!First)
-      O << ", ";
+  interleaveComma(operands(), O, [&O, &SlotTracker](VPValue *Op) {
     Op->printAsOperand(O, SlotTracker);
-    First = false;
-  }
+  });
 }
 
 void VPInterleavedAccessInfo::visitRegion(VPRegionBlock *Region,


        


More information about the llvm-branch-commits mailing list