mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Inliner] Add per-inlining verification.
Previously, there was an -Xllvm option to verify after all inlining to a particlar caller. That makes it a chore to track down which apply's inlining resulted in invalid code. Here, a new option is added that verifies after each run of the inliner.
This commit is contained in:
@@ -50,6 +50,8 @@ extern llvm::cl::opt<bool> SILPrintInliningCallerBefore;
|
||||
|
||||
extern llvm::cl::opt<bool> SILPrintInliningCallerAfter;
|
||||
|
||||
extern llvm::cl::opt<bool> EnableVerifyAfterEachInlining;
|
||||
|
||||
extern void printInliningDetailsCallee(StringRef passName, SILFunction *caller,
|
||||
SILFunction *callee);
|
||||
|
||||
@@ -972,6 +974,16 @@ runOnFunctionRecursively(SILOptFunctionBuilder &FuncBuilder, SILFunction *F,
|
||||
// later.
|
||||
changedFunctions.insert(F);
|
||||
|
||||
if (EnableVerifyAfterEachInlining) {
|
||||
if (invalidatedStackNesting) {
|
||||
StackNesting::fixNesting(F);
|
||||
changedFunctions.insert(F);
|
||||
invalidatedStackNesting = false;
|
||||
}
|
||||
|
||||
F->verify();
|
||||
}
|
||||
|
||||
// Resume inlining within nextBB, which contains only the inlined
|
||||
// instructions and possibly instructions in the original call block that
|
||||
// have not yet been visited.
|
||||
|
||||
Reference in New Issue
Block a user