[PATCH] D14552: Teach the inliner to track deoptimization state

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 15:17:02 PST 2015


reames added inline comments.

================
Comment at: include/llvm/IR/Instructions.h:1469
@@ +1468,3 @@
+  /// to the operand bundles in \p Bundles.
+  CallInst *cloneWithOperandBundles(ArrayRef<OperandBundleDef> Bundles);
+
----------------
Offline, we decided a Create(InvokeInst, OperandBundles, InsertPt) would be a cleaner interface here.

================
Comment at: lib/Transforms/Utils/InlineFunction.cpp:211-217
@@ -210,4 +210,9 @@
     SmallVector<Value*, 8> InvokeArgs(CS.arg_begin(), CS.arg_end());
-    InvokeInst *II = InvokeInst::Create(CI->getCalledValue(), Split, UnwindEdge,
-                                        InvokeArgs, CI->getName(), BB);
+    SmallVector<OperandBundleDef, 1> OpBundles;
+    for (unsigned i = 0, e = CS.getNumOperandBundles(); i != e; ++i)
+      OpBundles.emplace_back(CS.getOperandBundleAt(i));
+
+    InvokeInst *II =
+        InvokeInst::Create(CI->getCalledValue(), Split, UnwindEdge, InvokeArgs,
+                           OpBundles, CI->getName(), BB);
     II->setDebugLoc(CI->getDebugLoc());
----------------
Offline we realized the confusion here.  This loop is converting uses to defs, and is not simply a copy.  


http://reviews.llvm.org/D14552





More information about the llvm-commits mailing list