[InstCombine] Propagate operand bundles

We neglected to transfer operand bundles for some transforms.  These
were found via inspection, I'll try to come up with some test cases.

llvm-svn: 268010
This commit is contained in:
David Majnemer 2016-04-29 08:07:20 +00:00
parent 3ed9f6ebde
commit 231a68cc22
2 changed files with 9 additions and 3 deletions

View File

@ -2793,15 +2793,18 @@ InstCombiner::transformCallThroughTrampoline(CallSite CS,
const AttributeSet &NewPAL =
AttributeSet::get(FTy->getContext(), NewAttrs);
SmallVector<OperandBundleDef, 1> OpBundles;
CS.getOperandBundlesAsDefs(OpBundles);
Instruction *NewCaller;
if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
NewCaller = InvokeInst::Create(NewCallee,
II->getNormalDest(), II->getUnwindDest(),
NewArgs);
NewArgs, OpBundles);
cast<InvokeInst>(NewCaller)->setCallingConv(II->getCallingConv());
cast<InvokeInst>(NewCaller)->setAttributes(NewPAL);
} else {
NewCaller = CallInst::Create(NewCallee, NewArgs);
NewCaller = CallInst::Create(NewCallee, NewArgs, OpBundles);
if (cast<CallInst>(Caller)->isTailCall())
cast<CallInst>(NewCaller)->setTailCall();
cast<CallInst>(NewCaller)->

View File

@ -1401,8 +1401,11 @@ Instruction *InstCombiner::visitFPTrunc(FPTruncInst &CI) {
Function *Overload = Intrinsic::getDeclaration(
CI.getModule(), II->getIntrinsicID(), IntrinsicType);
SmallVector<OperandBundleDef, 1> OpBundles;
II->getOperandBundlesAsDefs(OpBundles);
Value *Args[] = { InnerTrunc };
return CallInst::Create(Overload, Args, II->getName());
return CallInst::Create(Overload, Args, OpBundles, II->getName());
}
}
}