mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Change the command line option to sil-opt for the definite initialization
pass to be -definite-init instead of -memory-promotion, rename the entrypoint for the pass to match, and tidy various and sundry comments. Swift SVN r8927
This commit is contained in:
@@ -126,9 +126,10 @@ namespace swift {
|
||||
SILModule *performSILGeneration(TranslationUnit *TU,
|
||||
unsigned StartElem = 0);
|
||||
|
||||
/// performSILMemoryPromotion - Promote alloc_box uses into SSA registers and
|
||||
/// perform definitive initialization analysis.
|
||||
void performSILMemoryPromotion(SILModule *M);
|
||||
/// performSILDefiniteInitialization - Perform definitive initialization
|
||||
/// analysis and promote alloc_box uses into SSA registers for later SSA-based
|
||||
/// dataflow passes.
|
||||
void performSILDefiniteInitialization(SILModule *M);
|
||||
|
||||
/// performSILAllocBoxToStackPromotion - Promote alloc_box into stack
|
||||
/// allocations.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//===--- MemoryPromotion.cpp - Promote memory to SSA registers ------------===//
|
||||
//===--- DefiniteInitialization.cpp - Perform definite init analysis ------===//
|
||||
//
|
||||
// This source file is part of the Swift.org open source project
|
||||
//
|
||||
@@ -1259,9 +1259,10 @@ static void lowerRawSILOperations(SILFunction &Fn) {
|
||||
}
|
||||
|
||||
|
||||
/// performSILMemoryPromotion - Promote alloc_box uses into SSA registers and
|
||||
/// perform definitive initialization analysis.
|
||||
void swift::performSILMemoryPromotion(SILModule *M) {
|
||||
/// performSILDefiniteInitialization - Perform definitive initialization
|
||||
/// analysis and promote alloc_box uses into SSA registers for later SSA-based
|
||||
/// dataflow passes.
|
||||
void swift::performSILDefiniteInitialization(SILModule *M) {
|
||||
for (auto &Fn : *M) {
|
||||
// Walk through an promote all of the alloc_box's that we can.
|
||||
checkDefiniteInitialization(Fn);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %sil-opt %s -memory-promotion -verify | FileCheck %s
|
||||
// RUN: %sil-opt %s -definite-init -verify | FileCheck %s
|
||||
|
||||
import Builtin
|
||||
import swift
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %sil-opt %s -memory-promotion -verify | FileCheck %s
|
||||
// RUN: %sil-opt %s -definite-init -verify | FileCheck %s
|
||||
|
||||
// These are all regression tests to ensure that the memory promotion pass
|
||||
// doesn't crash.
|
||||
|
||||
@@ -27,7 +27,7 @@ using namespace swift;
|
||||
enum class PassKind {
|
||||
AllocBoxToStack,
|
||||
StackToSSA,
|
||||
MemoryPromotion,
|
||||
DefiniteInit,
|
||||
CCP,
|
||||
DCE,
|
||||
DataflowDiagnostics,
|
||||
@@ -50,8 +50,8 @@ Passes(llvm::cl::desc("Passes:"),
|
||||
"allocbox-to-stack", "Promote memory"),
|
||||
clEnumValN(PassKind::StackToSSA,
|
||||
"stack-to-ssa", "alloc_stack to SSA"),
|
||||
clEnumValN(PassKind::MemoryPromotion,
|
||||
"memory-promotion", "Promote memory"),
|
||||
clEnumValN(PassKind::DefiniteInit,
|
||||
"definite-init","definitive initialization"),
|
||||
clEnumValN(PassKind::CCP,
|
||||
"constant-propagation",
|
||||
"Propagate constants"),
|
||||
@@ -134,8 +134,8 @@ int main(int argc, char **argv) {
|
||||
case PassKind::StackToSSA:
|
||||
performSILStackToSSAPromotion(CI.getSILModule());
|
||||
break;
|
||||
case PassKind::MemoryPromotion:
|
||||
performSILMemoryPromotion(CI.getSILModule());
|
||||
case PassKind::DefiniteInit:
|
||||
performSILDefiniteInitialization(CI.getSILModule());
|
||||
break;
|
||||
case PassKind::CCP:
|
||||
performSILConstantPropagation(CI.getSILModule());
|
||||
|
||||
@@ -48,7 +48,7 @@ bool swift::runSILDiagnosticPasses(SILModule &Module) {
|
||||
auto &Ctx = Module.getASTContext();
|
||||
performSILMandatoryInlining(&Module);
|
||||
|
||||
performSILMemoryPromotion(&Module);
|
||||
performSILDefiniteInitialization(&Module);
|
||||
performSILAllocBoxToStackPromotion(&Module);
|
||||
performSILStackToSSAPromotion(&Module);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user