From: Sanjoy Das Date: Tue, 10 Nov 2015 20:13:21 +0000 (+0000) Subject: [IR] Make {Call,Invoke}::cloneImpl aware of operand bundles X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4afa7f1d5714a58ab1e79f749652872d666177a8;p=oota-llvm.git [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252645 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/Instructions.cpp b/lib/IR/Instructions.cpp index dfd711f5c23..9b6dfc2bf6a 100644 --- a/lib/IR/Instructions.cpp +++ b/lib/IR/Instructions.cpp @@ -3989,6 +3989,10 @@ AddrSpaceCastInst *AddrSpaceCastInst::cloneImpl() const { } 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::cloneImpl() const { } InvokeInst *InvokeInst::cloneImpl() const { + if (hasOperandBundles()) { + unsigned DescriptorBytes = getNumOperandBundles() * sizeof(BundleOpInfo); + return new(getNumOperands(), DescriptorBytes) InvokeInst(*this); + } return new(getNumOperands()) InvokeInst(*this); }