Skip to content

Commit 65696f4

Browse files
committed
[GVN] Initial check-in of a new global value numbering algorithm.
The code have been developed by Daniel Berlin over the years, and the new implementation goal is that of addressing shortcomings of the current GVN infrastructure, i.e. long compile time for large testcases, lack of phi predication, no load/store value numbering etc... The current code just implements the "core" GVN algorithm, although other pieces (load coercion, phi handling, predicate system) are already implemented in a branch out of tree. Once the core is stable, we'll start adding pieces on top of the base framework. The test currently living in test/Transform/NewGVN are a copy of the ones in GVN, with proper `XFAIL` (missing features in NewGVN). A flag will be added in a future commit to enable NewGVN, so that interested parties can exercise this code easily. Differential Revision: https://reviews.llvm.org/D26224 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290346 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 4742817 commit 65696f4

File tree

97 files changed

+8160
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+8160
-0
lines changed

include/llvm-c/Transforms/Scalar.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ void LLVMAddMergedLoadStoreMotionPass(LLVMPassManagerRef PM);
5656
/** See llvm::createGVNPass function. */
5757
void LLVMAddGVNPass(LLVMPassManagerRef PM);
5858

59+
/** See llvm::createGVNPass function. */
60+
void LLVMAddNewGVNPass(LLVMPassManagerRef PM);
61+
5962
/** See llvm::createIndVarSimplifyPass function. */
6063
void LLVMAddIndVarSimplifyPass(LLVMPassManagerRef PM);
6164

include/llvm/InitializePasses.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ void initializeModuleDebugInfoPrinterPass(PassRegistry&);
252252
void initializeModuleSummaryIndexWrapperPassPass(PassRegistry &);
253253
void initializeNameAnonGlobalLegacyPassPass(PassRegistry &);
254254
void initializeNaryReassociateLegacyPassPass(PassRegistry &);
255+
void initializeNewGVNPass(PassRegistry&);
255256
void initializeNoAAPass(PassRegistry&);
256257
void initializeObjCARCAAWrapperPassPass(PassRegistry&);
257258
void initializeObjCARCAPElimPass(PassRegistry&);

include/llvm/LinkAllPasses.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ namespace {
167167
(void) llvm::createGVNHoistPass();
168168
(void) llvm::createMergedLoadStoreMotionPass();
169169
(void) llvm::createGVNPass();
170+
(void) llvm::createNewGVNPass();
170171
(void) llvm::createMemCpyOptPass();
171172
(void) llvm::createLoopDeletionPass();
172173
(void) llvm::createPostDomTree();

include/llvm/Transforms/Scalar.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,13 @@ FunctionPass *createGVNHoistPass();
346346
//
347347
FunctionPass *createMergedLoadStoreMotionPass();
348348

349+
//===----------------------------------------------------------------------===//
350+
//
351+
// GVN - This pass performs global value numbering and redundant load
352+
// elimination cotemporaneously.
353+
//
354+
FunctionPass *createNewGVNPass();
355+
349356
//===----------------------------------------------------------------------===//
350357
//
351358
// MemCpyOpt - This pass performs optimizations related to eliminating memcpy

0 commit comments

Comments
 (0)