mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
DeadObjectElimination: handle the builtin "prepareInitialization"
which allows e.g. eliminating dead `Atomic` values
This commit is contained in:
@@ -318,7 +318,8 @@ static bool canZapInstruction(SILInstruction *Inst, bool acceptRefCountInsts,
|
||||
// The value form of zero init is not a user of any operand. The address
|
||||
// form however is easily zappable because it's always a trivial store.
|
||||
if (auto bi = dyn_cast<BuiltinInst>(Inst)) {
|
||||
if (bi->getBuiltinKind() == BuiltinValueKind::ZeroInitializer) {
|
||||
if (bi->getBuiltinKind() == BuiltinValueKind::ZeroInitializer ||
|
||||
bi->getBuiltinKind() == BuiltinValueKind::PrepareInitialization) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user