Skip to content

Commit ad7cbb3

Browse files
authored
Merge pull request #16969 from gottesmm/pr-806c5074b4e653fcd640cc00f2c9726d94ad5e3d
2 parents 15c61cb + 9e70b85 commit ad7cbb3

File tree

12 files changed

+207
-195
lines changed

12 files changed

+207
-195
lines changed

lib/SILOptimizer/ARC/CMakeLists.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
set(ARC_SOURCES
2-
ARC/ARCBBState.cpp
3-
ARC/ARCLoopOpts.cpp
4-
ARC/ARCMatchingSet.cpp
5-
ARC/ARCRegionState.cpp
6-
ARC/ARCSequenceOpts.cpp
7-
ARC/GlobalARCSequenceDataflow.cpp
8-
ARC/GlobalLoopARCSequenceDataflow.cpp
9-
ARC/RCStateTransition.cpp
10-
ARC/RCStateTransitionVisitors.cpp
11-
ARC/RefCountState.cpp
12-
PARENT_SCOPE)
1+
silopt_register_sources(
2+
ARCBBState.cpp
3+
ARCLoopOpts.cpp
4+
ARCMatchingSet.cpp
5+
ARCRegionState.cpp
6+
ARCSequenceOpts.cpp
7+
GlobalARCSequenceDataflow.cpp
8+
GlobalLoopARCSequenceDataflow.cpp
9+
RCStateTransition.cpp
10+
RCStateTransitionVisitors.cpp
11+
RefCountState.cpp
12+
)
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
set(ANALYSIS_SOURCES
2-
Analysis/ARCAnalysis.cpp
3-
Analysis/AccessSummaryAnalysis.cpp
4-
Analysis/AccessedStorageAnalysis.cpp
5-
Analysis/AliasAnalysis.cpp
6-
Analysis/Analysis.cpp
7-
Analysis/ArraySemantic.cpp
8-
Analysis/BasicCalleeAnalysis.cpp
9-
Analysis/CallerAnalysis.cpp
10-
Analysis/CFG.cpp
11-
Analysis/ClassHierarchyAnalysis.cpp
12-
Analysis/ClosureScope.cpp
13-
Analysis/ColdBlockInfo.cpp
14-
Analysis/DestructorAnalysis.cpp
15-
Analysis/EscapeAnalysis.cpp
16-
Analysis/EpilogueARCAnalysis.cpp
17-
Analysis/FunctionOrder.cpp
18-
Analysis/IVAnalysis.cpp
19-
Analysis/LoopAnalysis.cpp
20-
Analysis/LoopRegionAnalysis.cpp
21-
Analysis/MemoryBehavior.cpp
22-
Analysis/ProtocolConformanceAnalysis.cpp
23-
Analysis/RCIdentityAnalysis.cpp
24-
Analysis/SideEffectAnalysis.cpp
25-
Analysis/SimplifyInstruction.cpp
26-
Analysis/TypeExpansionAnalysis.cpp
27-
Analysis/ValueTracking.cpp
28-
PARENT_SCOPE)
1+
silopt_register_sources(
2+
ARCAnalysis.cpp
3+
AccessSummaryAnalysis.cpp
4+
AccessedStorageAnalysis.cpp
5+
AliasAnalysis.cpp
6+
Analysis.cpp
7+
ArraySemantic.cpp
8+
BasicCalleeAnalysis.cpp
9+
CallerAnalysis.cpp
10+
CFG.cpp
11+
ClassHierarchyAnalysis.cpp
12+
ClosureScope.cpp
13+
ColdBlockInfo.cpp
14+
DestructorAnalysis.cpp
15+
EscapeAnalysis.cpp
16+
EpilogueARCAnalysis.cpp
17+
FunctionOrder.cpp
18+
IVAnalysis.cpp
19+
LoopAnalysis.cpp
20+
LoopRegionAnalysis.cpp
21+
MemoryBehavior.cpp
22+
ProtocolConformanceAnalysis.cpp
23+
RCIdentityAnalysis.cpp
24+
SideEffectAnalysis.cpp
25+
SimplifyInstruction.cpp
26+
TypeExpansionAnalysis.cpp
27+
ValueTracking.cpp
28+
)

lib/SILOptimizer/CMakeLists.txt

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
2+
set(SILOPTIMIZER_SOURCES)
3+
4+
function(_list_transform newvar)
5+
set(sources ${ARGN})
6+
set(dir ${CMAKE_CURRENT_SOURCE_DIR})
7+
set(tmp)
8+
foreach (s ${sources})
9+
list(APPEND tmp "${dir}/${s}")
10+
endforeach()
11+
set(${newvar} "${tmp}" PARENT_SCOPE)
12+
endfunction()
13+
14+
macro(silopt_register_sources)
15+
precondition(new_transformed_sources
16+
NEGATE
17+
MESSAGE "Expected this to be empty since we clear after each run")
18+
_list_transform(new_transformed_sources ${ARGN})
19+
list_union("${SILOPTIMIZER_SOURCES}" "${new_transformed_sources}" out)
20+
set(SILOPTIMIZER_SOURCES "${out}" PARENT_SCOPE)
21+
set(new_transformed_sources)
22+
endmacro()
23+
124
add_subdirectory(ARC)
225
add_subdirectory(Analysis)
326
add_subdirectory(FunctionSignatureTransforms)
@@ -9,16 +32,7 @@ add_subdirectory(SILCombiner)
932
add_subdirectory(Transforms)
1033
add_subdirectory(UtilityPasses)
1134
add_subdirectory(Utils)
35+
1236
add_swift_library(swiftSILOptimizer STATIC
13-
${ARC_SOURCES}
14-
${ANALYSIS_SOURCES}
15-
${SILCOMBINER_SOURCES}
16-
${UTILITYPASSES_SOURCES}
17-
${UTILS_SOURCES}
18-
${PASSMANAGER_SOURCES}
19-
${LOOPTRANSFORMS_SOURCES}
20-
${MANDATORY_SOURCES}
21-
${TRANSFORMS_SOURCES}
22-
${IPO_SOURCES}
23-
${FUNCTIONSIGNATURETRANSFORMS_SOURCES}
37+
${SILOPTIMIZER_SOURCES}
2438
LINK_LIBRARIES swiftSIL)
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
set(FUNCTIONSIGNATURETRANSFORMS_SOURCES
2-
FunctionSignatureTransforms/FunctionSignatureOpts.cpp
3-
FunctionSignatureTransforms/DeadArgumentTransform.cpp
4-
FunctionSignatureTransforms/ArgumentExplosionTransform.cpp
5-
FunctionSignatureTransforms/OwnedToGuaranteedTransform.cpp
6-
PARENT_SCOPE)
1+
silopt_register_sources(
2+
FunctionSignatureOpts.cpp
3+
DeadArgumentTransform.cpp
4+
ArgumentExplosionTransform.cpp
5+
OwnedToGuaranteedTransform.cpp
6+
)

lib/SILOptimizer/IPO/CMakeLists.txt

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
set(IPO_SOURCES
2-
IPO/CapturePromotion.cpp
3-
IPO/CapturePropagation.cpp
4-
IPO/ClosureSpecializer.cpp
5-
IPO/DeadFunctionElimination.cpp
6-
IPO/EagerSpecializer.cpp
7-
IPO/GlobalOpt.cpp
8-
IPO/GlobalPropertyOpt.cpp
9-
IPO/LetPropertiesOpts.cpp
10-
IPO/UsePrespecialized.cpp
11-
PARENT_SCOPE)
1+
silopt_register_sources(
2+
CapturePromotion.cpp
3+
CapturePropagation.cpp
4+
ClosureSpecializer.cpp
5+
DeadFunctionElimination.cpp
6+
EagerSpecializer.cpp
7+
GlobalOpt.cpp
8+
GlobalPropertyOpt.cpp
9+
LetPropertiesOpts.cpp
10+
UsePrespecialized.cpp)
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
set(LOOPTRANSFORMS_SOURCES
2-
LoopTransforms/ArrayBoundsCheckOpts.cpp
3-
LoopTransforms/COWArrayOpt.cpp
4-
LoopTransforms/LoopRotate.cpp
5-
LoopTransforms/LoopUnroll.cpp
6-
LoopTransforms/LICM.cpp
7-
PARENT_SCOPE)
1+
silopt_register_sources(
2+
ArrayBoundsCheckOpts.cpp
3+
COWArrayOpt.cpp
4+
LoopRotate.cpp
5+
LoopUnroll.cpp
6+
LICM.cpp
7+
)
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
set(MANDATORY_SOURCES
2-
Mandatory/AccessEnforcementSelection.cpp
3-
Mandatory/AccessMarkerElimination.cpp
4-
Mandatory/AddressLowering.cpp
5-
Mandatory/ConstantPropagation.cpp
6-
Mandatory/DefiniteInitialization.cpp
7-
Mandatory/DIMemoryUseCollectorOwnership.cpp
8-
Mandatory/DataflowDiagnostics.cpp
9-
Mandatory/DiagnoseInfiniteRecursion.cpp
10-
Mandatory/DiagnoseStaticExclusivity.cpp
11-
Mandatory/DiagnoseUnreachable.cpp
12-
Mandatory/GuaranteedARCOpts.cpp
13-
Mandatory/IRGenPrepare.cpp
14-
Mandatory/MandatoryInlining.cpp
15-
Mandatory/PredictableMemOpt.cpp
16-
Mandatory/PMOMemoryUseCollector.cpp
17-
Mandatory/SemanticARCOpts.cpp
18-
Mandatory/ClosureLifetimeFixup.cpp
19-
Mandatory/RawSILInstLowering.cpp
20-
Mandatory/MandatoryOptUtils.cpp
21-
PARENT_SCOPE)
1+
silopt_register_sources(
2+
AccessEnforcementSelection.cpp
3+
AccessMarkerElimination.cpp
4+
AddressLowering.cpp
5+
ConstantPropagation.cpp
6+
DefiniteInitialization.cpp
7+
DIMemoryUseCollectorOwnership.cpp
8+
DataflowDiagnostics.cpp
9+
DiagnoseInfiniteRecursion.cpp
10+
DiagnoseStaticExclusivity.cpp
11+
DiagnoseUnreachable.cpp
12+
GuaranteedARCOpts.cpp
13+
IRGenPrepare.cpp
14+
MandatoryInlining.cpp
15+
PredictableMemOpt.cpp
16+
PMOMemoryUseCollector.cpp
17+
SemanticARCOpts.cpp
18+
ClosureLifetimeFixup.cpp
19+
RawSILInstLowering.cpp
20+
MandatoryOptUtils.cpp
21+
)
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
set(PASSMANAGER_SOURCES
2-
PassManager/PassManager.cpp
3-
PassManager/Passes.cpp
4-
PassManager/PassPipeline.cpp
5-
PassManager/PrettyStackTrace.cpp
6-
PARENT_SCOPE)
1+
silopt_register_sources(
2+
PassManager.cpp
3+
Passes.cpp
4+
PassPipeline.cpp
5+
PrettyStackTrace.cpp
6+
)
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
set(SILCOMBINER_SOURCES
2-
SILCombiner/SILCombine.cpp
3-
SILCombiner/SILCombinerApplyVisitors.cpp
4-
SILCombiner/SILCombinerBuiltinVisitors.cpp
5-
SILCombiner/SILCombinerCastVisitors.cpp
6-
SILCombiner/SILCombinerMiscVisitors.cpp
7-
PARENT_SCOPE)
1+
silopt_register_sources(
2+
SILCombine.cpp
3+
SILCombinerApplyVisitors.cpp
4+
SILCombinerBuiltinVisitors.cpp
5+
SILCombinerCastVisitors.cpp
6+
SILCombinerMiscVisitors.cpp
7+
)
Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
set(TRANSFORMS_SOURCES
2-
Transforms/ARCCodeMotion.cpp
3-
Transforms/AccessEnforcementOpts.cpp
4-
Transforms/AllocBoxToStack.cpp
5-
Transforms/ArrayCountPropagation.cpp
6-
Transforms/ArrayElementValuePropagation.cpp
7-
Transforms/AssumeSingleThreaded.cpp
8-
Transforms/CSE.cpp
9-
Transforms/ConditionForwarding.cpp
10-
Transforms/CopyForwarding.cpp
11-
Transforms/DeadCodeElimination.cpp
12-
Transforms/DeadObjectElimination.cpp
13-
Transforms/DeadStoreElimination.cpp
14-
Transforms/Devirtualizer.cpp
15-
Transforms/GenericSpecializer.cpp
16-
Transforms/MergeCondFail.cpp
17-
Transforms/MarkUninitializedFixup.cpp
18-
Transforms/Outliner.cpp
19-
Transforms/ObjectOutliner.cpp
20-
Transforms/OwnershipModelEliminator.cpp
21-
Transforms/PerformanceInliner.cpp
22-
Transforms/RedundantLoadElimination.cpp
23-
Transforms/RedundantOverflowCheckRemoval.cpp
24-
Transforms/ReleaseDevirtualizer.cpp
25-
Transforms/RemovePin.cpp
26-
Transforms/SILCodeMotion.cpp
27-
Transforms/SILLowerAggregateInstrs.cpp
28-
Transforms/SILMem2Reg.cpp
29-
Transforms/SILSROA.cpp
30-
Transforms/SimplifyCFG.cpp
31-
Transforms/Sink.cpp
32-
Transforms/SpeculativeDevirtualizer.cpp
33-
Transforms/StackPromotion.cpp
34-
Transforms/UnsafeGuaranteedPeephole.cpp
35-
PARENT_SCOPE)
1+
silopt_register_sources(
2+
ARCCodeMotion.cpp
3+
AccessEnforcementOpts.cpp
4+
AllocBoxToStack.cpp
5+
ArrayCountPropagation.cpp
6+
ArrayElementValuePropagation.cpp
7+
AssumeSingleThreaded.cpp
8+
CSE.cpp
9+
ConditionForwarding.cpp
10+
CopyForwarding.cpp
11+
DeadCodeElimination.cpp
12+
DeadObjectElimination.cpp
13+
DeadStoreElimination.cpp
14+
Devirtualizer.cpp
15+
GenericSpecializer.cpp
16+
MergeCondFail.cpp
17+
MarkUninitializedFixup.cpp
18+
Outliner.cpp
19+
ObjectOutliner.cpp
20+
OwnershipModelEliminator.cpp
21+
PerformanceInliner.cpp
22+
RedundantLoadElimination.cpp
23+
RedundantOverflowCheckRemoval.cpp
24+
ReleaseDevirtualizer.cpp
25+
RemovePin.cpp
26+
SILCodeMotion.cpp
27+
SILLowerAggregateInstrs.cpp
28+
SILMem2Reg.cpp
29+
SILSROA.cpp
30+
SimplifyCFG.cpp
31+
Sink.cpp
32+
SpeculativeDevirtualizer.cpp
33+
StackPromotion.cpp
34+
UnsafeGuaranteedPeephole.cpp
35+
)
Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
set(UTILITYPASSES_SOURCES
2-
UtilityPasses/AADumper.cpp
3-
UtilityPasses/AccessSummaryDumper.cpp
4-
UtilityPasses/AccessedStorageDumper.cpp
5-
UtilityPasses/BasicCalleePrinter.cpp
6-
UtilityPasses/BasicInstructionPropertyDumper.cpp
7-
UtilityPasses/BugReducerTester.cpp
8-
UtilityPasses/CFGPrinter.cpp
9-
UtilityPasses/CallerAnalysisPrinter.cpp
10-
UtilityPasses/ComputeDominanceInfo.cpp
11-
UtilityPasses/ComputeLoopInfo.cpp
12-
UtilityPasses/EpilogueARCMatcherDumper.cpp
13-
UtilityPasses/EpilogueRetainReleaseMatcherDumper.cpp
14-
UtilityPasses/EscapeAnalysisDumper.cpp
15-
UtilityPasses/FunctionOrderPrinter.cpp
16-
UtilityPasses/IVInfoPrinter.cpp
17-
UtilityPasses/InstCount.cpp
18-
UtilityPasses/LSLocationPrinter.cpp
19-
UtilityPasses/Link.cpp
20-
UtilityPasses/LoopCanonicalizer.cpp
21-
UtilityPasses/LoopInfoPrinter.cpp
22-
UtilityPasses/LoopRegionPrinter.cpp
23-
UtilityPasses/MemBehaviorDumper.cpp
24-
UtilityPasses/RCIdentityDumper.cpp
25-
UtilityPasses/SerializeSILPass.cpp
26-
UtilityPasses/SILDebugInfoGenerator.cpp
27-
UtilityPasses/SideEffectsDumper.cpp
28-
UtilityPasses/SimplifyUnreachableContainingBlocks.cpp
29-
UtilityPasses/StripDebugInfo.cpp
30-
UtilityPasses/ValueOwnershipKindDumper.cpp
31-
PARENT_SCOPE)
1+
silopt_register_sources(
2+
AADumper.cpp
3+
AccessSummaryDumper.cpp
4+
AccessedStorageDumper.cpp
5+
BasicCalleePrinter.cpp
6+
BasicInstructionPropertyDumper.cpp
7+
BugReducerTester.cpp
8+
CFGPrinter.cpp
9+
CallerAnalysisPrinter.cpp
10+
ComputeDominanceInfo.cpp
11+
ComputeLoopInfo.cpp
12+
EpilogueARCMatcherDumper.cpp
13+
EpilogueRetainReleaseMatcherDumper.cpp
14+
EscapeAnalysisDumper.cpp
15+
FunctionOrderPrinter.cpp
16+
IVInfoPrinter.cpp
17+
InstCount.cpp
18+
LSLocationPrinter.cpp
19+
Link.cpp
20+
LoopCanonicalizer.cpp
21+
LoopInfoPrinter.cpp
22+
LoopRegionPrinter.cpp
23+
MemBehaviorDumper.cpp
24+
RCIdentityDumper.cpp
25+
SerializeSILPass.cpp
26+
SILDebugInfoGenerator.cpp
27+
SideEffectsDumper.cpp
28+
SimplifyUnreachableContainingBlocks.cpp
29+
StripDebugInfo.cpp
30+
ValueOwnershipKindDumper.cpp
31+
)

0 commit comments

Comments
 (0)