mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
[WholeProgramDevirt][NewPM] Add NPM testing path to match legacy pass
The legacy pass's default constructor sets UseCommandLine = true and goes down a separate testing route. Match that in the NPM pass. This fixes all tests in llvm/test/Transforms/WholeProgramDevirt under NPM. Reviewed By: ychen Differential Revision: https://reviews.llvm.org/D88588
This commit is contained in:
parent
2f3a33fbc1
commit
e702df7d7f
@ -223,6 +223,9 @@ void setAfterReturnValues(MutableArrayRef<VirtualCallTarget> Targets,
|
||||
struct WholeProgramDevirtPass : public PassInfoMixin<WholeProgramDevirtPass> {
|
||||
ModuleSummaryIndex *ExportSummary;
|
||||
const ModuleSummaryIndex *ImportSummary;
|
||||
bool UseCommandLine = false;
|
||||
WholeProgramDevirtPass()
|
||||
: ExportSummary(nullptr), ImportSummary(nullptr), UseCommandLine(true) {}
|
||||
WholeProgramDevirtPass(ModuleSummaryIndex *ExportSummary,
|
||||
const ModuleSummaryIndex *ImportSummary)
|
||||
: ExportSummary(ExportSummary), ImportSummary(ImportSummary) {
|
||||
|
@ -97,7 +97,7 @@ MODULE_PASS("strip-dead-prototypes", StripDeadPrototypesPass())
|
||||
MODULE_PASS("strip-debug-declare", StripDebugDeclarePass())
|
||||
MODULE_PASS("strip-nondebug", StripNonDebugSymbolsPass())
|
||||
MODULE_PASS("synthetic-counts-propagation", SyntheticCountsPropagation())
|
||||
MODULE_PASS("wholeprogramdevirt", WholeProgramDevirtPass(nullptr, nullptr))
|
||||
MODULE_PASS("wholeprogramdevirt", WholeProgramDevirtPass())
|
||||
MODULE_PASS("verify", VerifierPass())
|
||||
MODULE_PASS("dfsan", DataFlowSanitizerPass())
|
||||
MODULE_PASS("asan-module", ModuleAddressSanitizerPass(/*CompileKernel=*/false, false, true, false))
|
||||
|
@ -753,6 +753,11 @@ PreservedAnalyses WholeProgramDevirtPass::run(Module &M,
|
||||
auto LookupDomTree = [&FAM](Function &F) -> DominatorTree & {
|
||||
return FAM.getResult<DominatorTreeAnalysis>(F);
|
||||
};
|
||||
if (UseCommandLine) {
|
||||
if (DevirtModule::runForTesting(M, AARGetter, OREGetter, LookupDomTree))
|
||||
return PreservedAnalyses::all();
|
||||
return PreservedAnalyses::none();
|
||||
}
|
||||
if (!DevirtModule(M, AARGetter, OREGetter, LookupDomTree, ExportSummary,
|
||||
ImportSummary)
|
||||
.run())
|
||||
|
@ -1,3 +1,4 @@
|
||||
; RUN: opt -S -passes=wholeprogramdevirt -wholeprogramdevirt-summary-action=import -wholeprogramdevirt-read-summary=%S/Inputs/import-single-impl.yaml < %s | FileCheck --check-prefixes=CHECK,SINGLE-IMPL %s
|
||||
; RUN: opt -S -wholeprogramdevirt -wholeprogramdevirt-summary-action=import -wholeprogramdevirt-read-summary=%S/Inputs/import-single-impl.yaml < %s | FileCheck --check-prefixes=CHECK,SINGLE-IMPL %s
|
||||
; RUN: opt -S -wholeprogramdevirt -wholeprogramdevirt-summary-action=import -wholeprogramdevirt-read-summary=%S/Inputs/import-uniform-ret-val.yaml < %s | FileCheck --check-prefixes=CHECK,INDIR,UNIFORM-RET-VAL %s
|
||||
; RUN: opt -S -wholeprogramdevirt -wholeprogramdevirt-summary-action=import -wholeprogramdevirt-read-summary=%S/Inputs/import-unique-ret-val0.yaml < %s | FileCheck --check-prefixes=CHECK,INDIR,UNIQUE-RET-VAL0 %s
|
||||
|
Loading…
x
Reference in New Issue
Block a user