Adjust emitted IR on !llvm.used.conditional to match LLVM expectations (#39715)

This commit is contained in:
Kuba (Brecka) Mracek
2021-10-13 11:37:52 -07:00
committed by GitHub
parent ed6f701832
commit cf5fee0a89
2 changed files with 17 additions and 5 deletions

View File

@@ -3720,7 +3720,10 @@ static void appendLLVMUsedConditionalEntry(IRGenModule &IGM,
llvm::Type::getInt32Ty(IGM.Module.getContext()), 0)),
// (3) the "edge" that holds the target alive, if it's missing the target
// is allowed to be removed
llvm::ConstantAsMetadata::get(dependsOn),
llvm::MDNode::get(IGM.Module.getContext(),
{
llvm::ConstantAsMetadata::get(dependsOn),
}),
};
auto *usedConditional =
IGM.Module.getOrInsertNamedMetadata("llvm.used.conditional");