|
| 1 | +//===--- Simplifications.def ------------------------------------*- C++ -*-===// |
| 2 | +// |
| 3 | +// This source file is part of the Swift.org open source project |
| 4 | +// |
| 5 | +// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors |
| 6 | +// Licensed under Apache License v2.0 with Runtime Library Exception |
| 7 | +// |
| 8 | +// See https://swift.org/LICENSE.txt for license information |
| 9 | +// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors |
| 10 | +// |
| 11 | +//===----------------------------------------------------------------------===// |
| 12 | +// |
| 13 | +// This file contains macro-metaprogramming for instruction simplifications |
| 14 | +// running in SILCombine. |
| 15 | +// |
| 16 | +//===----------------------------------------------------------------------===// |
| 17 | + |
| 18 | +/// INSTRUCTION_SIMPLIFICATION(Inst) |
| 19 | +/// Defines an instruction simplification which is implemented in swift and is |
| 20 | +/// run by the SILCombiner. |
| 21 | +/// The \p Inst argument specifies the instruction class. |
| 22 | +/// |
| 23 | +/// No further code is need on the C++ side. On the swift side an instruction |
| 24 | +/// simplification must be registered for the instruction class with |
| 25 | +/// `registerForSILCombine`. |
| 26 | +/// |
| 27 | + |
| 28 | +/// INSTRUCTION_SIMPLIFICATION_WITH_LEGACY(Inst) |
| 29 | +/// Like INSTRUCTION_SIMPLIFICATION, but also runs the legacy `visitInst` |
| 30 | +/// implementation in SILCombine. |
| 31 | + |
| 32 | +INSTRUCTION_SIMPLIFICATION(BeginBorrowInst) |
| 33 | +INSTRUCTION_SIMPLIFICATION(BeginCOWMutationInst) |
| 34 | +INSTRUCTION_SIMPLIFICATION(ClassifyBridgeObjectInst) |
| 35 | +INSTRUCTION_SIMPLIFICATION(FixLifetimeInst) |
| 36 | +INSTRUCTION_SIMPLIFICATION(GlobalValueInst) |
| 37 | +INSTRUCTION_SIMPLIFICATION(StrongRetainInst) |
| 38 | +INSTRUCTION_SIMPLIFICATION(StrongReleaseInst) |
| 39 | +INSTRUCTION_SIMPLIFICATION(RetainValueInst) |
| 40 | +INSTRUCTION_SIMPLIFICATION(ReleaseValueInst) |
| 41 | +INSTRUCTION_SIMPLIFICATION(LoadInst) |
| 42 | +INSTRUCTION_SIMPLIFICATION(LoadBorrowInst) |
| 43 | +INSTRUCTION_SIMPLIFICATION(CopyValueInst) |
| 44 | +INSTRUCTION_SIMPLIFICATION(DestroyValueInst) |
| 45 | +INSTRUCTION_SIMPLIFICATION(DestructureStructInst) |
| 46 | +INSTRUCTION_SIMPLIFICATION(DestructureTupleInst) |
| 47 | +INSTRUCTION_SIMPLIFICATION(PointerToAddressInst) |
| 48 | +INSTRUCTION_SIMPLIFICATION(TypeValueInst) |
| 49 | +INSTRUCTION_SIMPLIFICATION(UncheckedEnumDataInst) |
| 50 | +INSTRUCTION_SIMPLIFICATION(WitnessMethodInst) |
| 51 | +INSTRUCTION_SIMPLIFICATION_WITH_LEGACY(AllocStackInst) |
| 52 | +INSTRUCTION_SIMPLIFICATION_WITH_LEGACY(UnconditionalCheckedCastInst) |
| 53 | +INSTRUCTION_SIMPLIFICATION_WITH_LEGACY(ApplyInst) |
| 54 | +INSTRUCTION_SIMPLIFICATION_WITH_LEGACY(TryApplyInst) |
| 55 | + |
| 56 | +#undef INSTRUCTION_SIMPLIFICATION |
| 57 | +#undef INSTRUCTION_SIMPLIFICATION_WITH_LEGACY |
0 commit comments