Skip to content

Commit

Permalink
Reorganize SILOptimizer directories for better discoverability.
Browse files Browse the repository at this point in the history
(libraries now)

It has been generally agreed that we need to do this reorg, and now
seems like the perfect time. Some major pass reorganization is in the
works.

This does not have to be the final word on the matter. The consensus
among those working on the code is that it's much better than what we
had and a better starting point for future bike shedding.

Note that the previous organization was designed to allow separate
analysis and optimization libraries. It turns out this is an
artificial distinction and not an important goal.
  • Loading branch information
atrick committed Dec 11, 2015
1 parent b797871 commit 739b0e9
Show file tree
Hide file tree
Showing 145 changed files with 121 additions and 119 deletions.
2 changes: 1 addition & 1 deletion CODE_OWNERS.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ D: ClangImporter, Serialization, (Objective-)C printer, Driver

N: Nadav Rotem
E: [email protected]
D: SILAnalysis, SILPasses
D: SILOptimizer

N: Anna Zaks
E: [email protected]
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SIL/SILCloner.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ SILCloner<ImplClass>::cleanUp(SILFunction *F) {
// NOTE: It is unfortunate that it essentially duplicates
// the code from sil-combine, but doing so allows for
// avoiding any cross-layer invocations between SIL and
// SILPasses layers.
// SILOptimizer layers.

for (auto *BB : BlocksWithUnreachables) {
for (auto &I : *BB) {
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SILOptimizer/Analysis/SimplifyInstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
// An analysis that provides utilities for folding instructions. Since it is an
// analysis it does not modify the IR in anyway. This is left to actual
// SILPasses.
// SIL Transforms.
//
//===----------------------------------------------------------------------===//

Expand Down
3 changes: 1 addition & 2 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
add_subdirectory(SwiftDemangle)
endif()
add_subdirectory(SIL)
add_subdirectory(SILAnalysis)
add_subdirectory(SILGen)
add_subdirectory(SILPasses)
add_subdirectory(SILOptimizer)

2 changes: 1 addition & 1 deletion lib/Immediate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ add_swift_library(swiftImmediate
swiftIDE
swiftFrontend
swiftSILGen
swiftSILPasses
swiftSILOptimizer
swiftIRGen
COMPONENT_DEPENDS
linker mcjit)
Expand Down
22 changes: 0 additions & 22 deletions lib/SILAnalysis/CMakeLists.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions lib/SILOptimizer/Analysis/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
set(ANALYSIS_SOURCES
Analysis/ARCAnalysis.cpp
Analysis/AliasAnalysis.cpp
Analysis/Analysis.cpp
Analysis/ArraySemantic.cpp
Analysis/BasicCalleeAnalysis.cpp
Analysis/CFG.cpp
Analysis/ClassHierarchyAnalysis.cpp
Analysis/ColdBlockInfo.cpp
Analysis/DestructorAnalysis.cpp
Analysis/EscapeAnalysis.cpp
Analysis/FunctionOrder.cpp
Analysis/IVAnalysis.cpp
Analysis/LoopAnalysis.cpp
Analysis/LoopRegionAnalysis.cpp
Analysis/MemoryBehavior.cpp
Analysis/RCIdentityAnalysis.cpp
Analysis/SideEffectAnalysis.cpp
Analysis/SimplifyInstruction.cpp
Analysis/TypeExpansionAnalysis.cpp
Analysis/ValueTracking.cpp
PARENT_SCOPE)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions lib/SILOptimizer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
add_subdirectory(ARC)
add_subdirectory(Analysis)
add_subdirectory(IPO)
add_subdirectory(LoopTransforms)
add_subdirectory(Mandatory)
add_subdirectory(PassManager)
add_subdirectory(SILCombiner)
add_subdirectory(Transforms)
add_subdirectory(UtilityPasses)
add_subdirectory(Utils)
add_swift_library(swiftSILOptimizer
${ARC_SOURCES}
${ANALYSIS_SOURCES}
${SILCOMBINER_SOURCES}
${UTILITYPASSES_SOURCES}
${UTILS_SOURCES}
${PASSMANAGER_SOURCES}
${LOOPTRANSFORMS_SOURCES}
${MANDATORY_SOURCES}
${TRANSFORMS_SOURCES}
${IPO_SOURCES}
LINK_LIBRARIES swiftSIL)
13 changes: 13 additions & 0 deletions lib/SILOptimizer/IPO/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
set(IPO_SOURCES
IPO/CapturePromotion.cpp
IPO/DeadFunctionElimination.cpp
IPO/GlobalOpt.cpp
IPO/PerformanceInliner.cpp
IPO/CapturePropagation.cpp
IPO/ExternalDefsToDecls.cpp
IPO/GlobalPropertyOpt.cpp
IPO/UsePrespecialized.cpp
IPO/ClosureSpecializer.cpp
IPO/FunctionSignatureOpts.cpp
IPO/LetPropertiesOpts.cpp
PARENT_SCOPE)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions lib/SILOptimizer/LoopTransforms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set(LOOPTRANSFORMS_SOURCES
LoopTransforms/ArrayBoundsCheckOpts.cpp
LoopTransforms/COWArrayOpt.cpp
LoopTransforms/LoopRotate.cpp
LoopTransforms/LICM.cpp
PARENT_SCOPE)
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions lib/SILOptimizer/Mandatory/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set(MANDATORY_SOURCES
Mandatory/DefiniteInitialization.cpp
Mandatory/MandatoryInlining.cpp
Mandatory/DIMemoryUseCollector.cpp
Mandatory/DataflowDiagnostics.cpp
Mandatory/DiagnoseUnreachable.cpp
Mandatory/PredictableMemOpt.cpp
Mandatory/ConstantPropagation.cpp
Mandatory/InOutDeshadowing.cpp
PARENT_SCOPE)
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(PM_SOURCES
set(PASSMANAGER_SOURCES
PassManager/PassManager.cpp
PassManager/Passes.cpp
PassManager/PrettyStackTrace.cpp
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions lib/SILOptimizer/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
set(TRANSFORMS_SOURCES
Transforms/AllocBoxToStack.cpp
Transforms/ArrayCountPropagation.cpp
Transforms/MergeCondFail.cpp
Transforms/SILSROA.cpp
Transforms/CSE.cpp
Transforms/RedundantOverflowCheckRemoval.cpp
Transforms/SimplifyCFG.cpp
Transforms/CopyForwarding.cpp
Transforms/RemovePin.cpp
Transforms/Sink.cpp
Transforms/DeadCodeElimination.cpp
Transforms/SILCleanup.cpp
Transforms/SpeculativeDevirtualizer.cpp
Transforms/ReleaseDevirtualizer.cpp
Transforms/DeadObjectElimination.cpp
Transforms/SILCodeMotion.cpp
Transforms/StackPromotion.cpp
Transforms/DeadStoreElimination.cpp
Transforms/SILLowerAggregateInstrs.cpp
Transforms/RedundantLoadElimination.cpp
Transforms/SILMem2Reg.cpp
PARENT_SCOPE)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions lib/SILOptimizer/Utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
set(UTILS_SOURCES
Utils/CFG.cpp
Utils/Local.cpp
Utils/SILInliner.cpp
Utils/SILSSAUpdater.cpp
Utils/ConstantFolding.cpp
Utils/GenericCloner.cpp
Utils/Generics.cpp
Utils/Devirtualize.cpp
Utils/CheckedCastBrJumpThreading.cpp
Utils/LoopUtils.cpp
PARENT_SCOPE)

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 0 additions & 19 deletions lib/SILPasses/CMakeLists.txt

This file was deleted.

10 changes: 0 additions & 10 deletions lib/SILPasses/EarlySIL/CMakeLists.txt

This file was deleted.

13 changes: 0 additions & 13 deletions lib/SILPasses/IPO/CMakeLists.txt

This file was deleted.

6 changes: 0 additions & 6 deletions lib/SILPasses/Loop/CMakeLists.txt

This file was deleted.

23 changes: 0 additions & 23 deletions lib/SILPasses/Scalar/CMakeLists.txt

This file was deleted.

13 changes: 0 additions & 13 deletions lib/SILPasses/Utils/CMakeLists.txt

This file was deleted.

6 changes: 3 additions & 3 deletions tools/SourceKit/lib/SwiftLang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ add_sourcekit_library(SourceKitSwiftLang
SwiftLangSupport.cpp
SwiftSourceDocInfo.cpp
DEPENDS SourceKitCore swiftDriver swiftFrontend swiftClangImporter swiftIDE
swiftAST swiftMarkup swiftParse swiftSIL swiftSILGen swiftSILPasses
swiftSILPassesUtils swiftSema swiftBasic swiftSerialization
swiftSILAnalysis swiftOption cmark
swiftAST swiftMarkup swiftParse swiftSIL swiftSILGen swiftSILOptimizer
swiftSema swiftBasic swiftSerialization
swiftOption cmark
# Clang dependencies.
clangFormat
clangToolingCore
Expand Down
2 changes: 1 addition & 1 deletion tools/driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ add_swift_executable(swift
modulewrap_main.cpp
LINK_LIBRARIES
swiftIDE
swiftDriver swiftIRGen swiftSIL swiftSILGen swiftSILPasses
swiftDriver swiftIRGen swiftSIL swiftSILGen swiftSILOptimizer
swiftImmediate
swiftSerialization
swiftPrintAsObjC
Expand Down
2 changes: 1 addition & 1 deletion tools/sil-extract/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ add_swift_executable(sil-extract
LINK_LIBRARIES
swiftFrontend
swiftSILGen
swiftSILPasses
swiftSILOptimizer
swiftSerialization
swiftClangImporter
)
Expand Down
2 changes: 1 addition & 1 deletion tools/sil-opt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ add_swift_executable(sil-opt
swiftFrontend
swiftIRGen
swiftSILGen
swiftSILPasses
swiftSILOptimizer
)

swift_install_in_component(tools
Expand Down

0 comments on commit 739b0e9

Please sign in to comment.