[OperandBundles] Extract duplicated code into a helper function, NFC

llvm-svn: 254047
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index c3fbaf2..26088bb 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -2268,11 +2268,7 @@
                                                        attrVec);
 
   SmallVector<OperandBundleDef, 1> OpBundles;
-
-  // Convert the operand bundle uses to operand bundle defs.  See InstrTypes.h
-  // for details on how these differ.
-  for (unsigned i = 0, e = CS.getNumOperandBundles(); i != e; ++i)
-    OpBundles.emplace_back(CS.getOperandBundleAt(i));
+  CS.getOperandBundlesAsDefs(OpBundles);
 
   Instruction *NC;
   if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {