llvm.org GIT mirror llvm / 7c79872
[PM] Port WholeProgramDevirt to the new pass manager. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272721 91177308-0d34-0410-b5e6-96231b3b80d8 Davide Italiano 3 years ago
5 changed file(s) with 16 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
1414 #ifndef LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H
1515 #define LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H
1616
17 #include "llvm/IR/Module.h"
18 #include "llvm/IR/PassManager.h"
1719 #include
1820 #include
1921 #include
209211 int64_t &OffsetByte, uint64_t &OffsetBit);
210212
211213 } // end namespace wholeprogramdevirt
214
215 struct WholeProgramDevirtPass : public PassInfoMixin {
216 PreservedAnalyses run(Module &M);
217 };
218
212219 } // end namespace llvm
213220
214221 #endif // LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H
6262 #include "llvm/Transforms/IPO/Internalize.h"
6363 #include "llvm/Transforms/IPO/SCCP.h"
6464 #include "llvm/Transforms/IPO/StripDeadPrototypes.h"
65 #include "llvm/Transforms/IPO/WholeProgramDevirt.h"
6566 #include "llvm/Transforms/InstCombine/InstCombine.h"
6667 #include "llvm/Transforms/InstrProfiling.h"
6768 #include "llvm/Transforms/PGOInstrumentation.h"
5959 MODULE_PASS("rpo-functionattrs", ReversePostOrderFunctionAttrsPass())
6060 MODULE_PASS("sample-profile", SampleProfileLoaderPass())
6161 MODULE_PASS("strip-dead-prototypes", StripDeadPrototypesPass())
62 MODULE_PASS("wholeprogramdevirt", WholeProgramDevirtPass())
6263 MODULE_PASS("verify", VerifierPass())
6364 #undef MODULE_PASS
6465
279279 return new WholeProgramDevirt;
280280 }
281281
282 PreservedAnalyses WholeProgramDevirtPass::run(Module &M) {
283 if (!DevirtModule(M).run())
284 return PreservedAnalyses::all();
285 return PreservedAnalyses::none();
286 }
287
282288 void DevirtModule::buildBitSets(
283289 std::vector &Bits,
284290 DenseMap> &BitSets) {
0 ; RUN: opt -S -wholeprogramdevirt %s | FileCheck %s
1 ; RUN: opt -S -passes=wholeprogramdevirt %s | FileCheck %s
12
23 target datalayout = "e-p:64:64"
34 target triple = "x86_64-unknown-linux-gnu"