diff options
author | Ahmed Bougacha <ahmed@bougacha.org> | 2022-05-20 15:26:31 -0700 |
---|---|---|
committer | Ahmed Bougacha <ahmed@bougacha.org> | 2022-05-20 15:27:29 -0700 |
commit | 362b4066f0c6178d639db41517549e13b3610036 (patch) | |
tree | abb178ce1ad1f55a335201067a9d9a0ea03ae6e6 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 59726668f1dcb32883de4cf027fe3585ca384cf5 (diff) | |
download | llvm-362b4066f0c6178d639db41517549e13b3610036.zip llvm-362b4066f0c6178d639db41517549e13b3610036.tar.gz llvm-362b4066f0c6178d639db41517549e13b3610036.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 9d49a96..cc58929 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -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(); |