[llvm] r252645 - [IR] Make {Call, Invoke}::cloneImpl aware of operand bundles

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 10 12:13:21 PST 2015


Author: sanjoy
Date: Tue Nov 10 14:13:21 2015
New Revision: 252645

URL: http://llvm.org/viewvc/llvm-project?rev=252645&view=rev
Log:
[IR] Make {Call,Invoke}::cloneImpl aware of operand bundles

This was an omission in the patch that landed initial support for
operand bundles.  So far we haven't hit this, but we will once the
inliner is able to inline calls to functions that contain calls with
operand bundles.

Modified:
    llvm/trunk/lib/IR/Instructions.cpp

Modified: llvm/trunk/lib/IR/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Instructions.cpp?rev=252645&r1=252644&r2=252645&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Instructions.cpp (original)
+++ llvm/trunk/lib/IR/Instructions.cpp Tue Nov 10 14:13:21 2015
@@ -3989,6 +3989,10 @@ AddrSpaceCastInst *AddrSpaceCastInst::cl
 }
 
 CallInst *CallInst::cloneImpl() const {
+  if (hasOperandBundles()) {
+    unsigned DescriptorBytes = getNumOperandBundles() * sizeof(BundleOpInfo);
+    return new(getNumOperands(), DescriptorBytes) CallInst(*this);
+  }
   return  new(getNumOperands()) CallInst(*this);
 }
 
@@ -4033,6 +4037,10 @@ IndirectBrInst *IndirectBrInst::cloneImp
 }
 
 InvokeInst *InvokeInst::cloneImpl() const {
+  if (hasOperandBundles()) {
+    unsigned DescriptorBytes = getNumOperandBundles() * sizeof(BundleOpInfo);
+    return new(getNumOperands(), DescriptorBytes) InvokeInst(*this);
+  }
   return new(getNumOperands()) InvokeInst(*this);
 }
 




More information about the llvm-commits mailing list