summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-11-25 00:42:19 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-11-25 00:42:19 +0000
commit7629346193d366ab420f45947fe45cc5a79515d5 (patch)
tree6422aff393bc6775eeebf2dfec085973b59e40f9 /llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
parent4945b16708808e057b749bea1a7856a0e38363fe (diff)
downloadbcm5719-llvm-7629346193d366ab420f45947fe45cc5a79515d5.tar.gz
bcm5719-llvm-7629346193d366ab420f45947fe45cc5a79515d5.zip
[InstCombine] Don't drop operand bundles
Reviewers: majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14857 llvm-svn: 254046
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index cde26cc24c2..c3fbaf2adfc 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -2267,16 +2267,23 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
const AttributeSet &NewCallerPAL = AttributeSet::get(Callee->getContext(),
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));
+
Instruction *NC;
if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
- NC = Builder->CreateInvoke(Callee, II->getNormalDest(),
- II->getUnwindDest(), Args);
+ NC = Builder->CreateInvoke(Callee, II->getNormalDest(), II->getUnwindDest(),
+ Args, OpBundles);
NC->takeName(II);
cast<InvokeInst>(NC)->setCallingConv(II->getCallingConv());
cast<InvokeInst>(NC)->setAttributes(NewCallerPAL);
} else {
CallInst *CI = cast<CallInst>(Caller);
- NC = Builder->CreateCall(Callee, Args);
+ NC = Builder->CreateCall(Callee, Args, OpBundles);
NC->takeName(CI);
if (CI->isTailCall())
cast<CallInst>(NC)->setTailCall();
OpenPOWER on IntegriCloud