summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-04-29 04:56:12 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-04-29 04:56:12 +0000
commitcd24bb1d3a1957854418f9d14e274304553fa9d1 (patch)
treec83a16b5f977c57522e2bbc390aba90867d1706f /llvm/lib/Transforms
parentb805723294627cd7a292a0166563188571f4d48d (diff)
downloadbcm5719-llvm-cd24bb1d3a1957854418f9d14e274304553fa9d1.tar.gz
bcm5719-llvm-cd24bb1d3a1957854418f9d14e274304553fa9d1.zip
[ArgumentPromotion] Propagate operand bundles to promoted call sites
We neglected to transfer operand bundles when performing argument promotion. This fixes PR27568. llvm-svn: 267986
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/ArgumentPromotion.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
index 8823b811748..a808df2af76 100644
--- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -857,15 +857,18 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
AttributesVec.push_back(AttributeSet::get(Call->getContext(),
CallPAL.getFnAttributes()));
+ SmallVector<OperandBundleDef, 1> OpBundles;
+ CS.getOperandBundlesAsDefs(OpBundles);
+
Instruction *New;
if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(),
- Args, "", Call);
+ Args, OpBundles, "", Call);
cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
cast<InvokeInst>(New)->setAttributes(AttributeSet::get(II->getContext(),
AttributesVec));
} else {
- New = CallInst::Create(NF, Args, "", Call);
+ New = CallInst::Create(NF, Args, OpBundles, "", Call);
cast<CallInst>(New)->setCallingConv(CS.getCallingConv());
cast<CallInst>(New)->setAttributes(AttributeSet::get(New->getContext(),
AttributesVec));
OpenPOWER on IntegriCloud