[ObjCARC] Drop nullary clang.arc.attachedcall bundles in autoupgrade.

In certain use-cases, these can be emitted by old compilers, but the
operand is now always required.  These are only used for optimizations,
so it's safe to drop them if they happen to have the now-invalid format.
The semantically-required call is already a separate instruction.

Differential Revision: https://reviews.llvm.org/D123811
This commit is contained in:
Ahmed Bougacha
2022-05-20 15:26:31 -07:00
parent 59726668f1
commit 362b4066f0
5 changed files with 54 additions and 0 deletions

View File

@@ -5138,6 +5138,10 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
}
}
// Upgrade the bundles if needed.
if (!OperandBundles.empty())
UpgradeOperandBundles(OperandBundles);
I = InvokeInst::Create(FTy, Callee, NormalBB, UnwindBB, Ops,
OperandBundles);
ResTypeID = getContainedTypeID(FTyID);
@@ -5235,6 +5239,10 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
}
}
// Upgrade the bundles if needed.
if (!OperandBundles.empty())
UpgradeOperandBundles(OperandBundles);
I = CallBrInst::Create(FTy, Callee, DefaultDest, IndirectDests, Args,
OperandBundles);
ResTypeID = getContainedTypeID(FTyID);
@@ -5846,6 +5854,10 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
}
}
// Upgrade the bundles if needed.
if (!OperandBundles.empty())
UpgradeOperandBundles(OperandBundles);
I = CallInst::Create(FTy, Callee, Args, OperandBundles);
ResTypeID = getContainedTypeID(FTyID);
OperandBundles.clear();