Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 791e927

Browse files
Cameron Zwarichalexcrichton
Cameron Zwarich
authored andcommitted
Add the NullCheckElimination pass to the default pass list
Since the NullCheckElimination pass has a similar intent to the CorrelatedValuePropagation pass, I decided to run it right after the both places that the latter runs.
1 parent d6c4763 commit 791e927

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Transforms/IPO/PassManagerBuilder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ void PassManagerBuilder::populateModulePassManager(
233233
MPM.add(createEarlyCSEPass()); // Catch trivial redundancies
234234
MPM.add(createJumpThreadingPass()); // Thread jumps.
235235
MPM.add(createCorrelatedValuePropagationPass()); // Propagate conditionals
236+
// Specific to the rust-lang llvm branch:
237+
MPM.add(createNullCheckEliminationPass()); // Eliminate null checks
236238
MPM.add(createCFGSimplificationPass()); // Merge & remove BBs
237239
MPM.add(createInstructionCombiningPass()); // Combine silly seq's
238240
addExtensionsToPM(EP_Peephole, MPM);
@@ -275,6 +277,8 @@ void PassManagerBuilder::populateModulePassManager(
275277
addExtensionsToPM(EP_Peephole, MPM);
276278
MPM.add(createJumpThreadingPass()); // Thread jumps
277279
MPM.add(createCorrelatedValuePropagationPass());
280+
// Specific to the rust-lang llvm branch:
281+
MPM.add(createNullCheckEliminationPass()); // Eliminate null checks
278282
MPM.add(createDeadStoreEliminationPass()); // Delete dead stores
279283
MPM.add(createLICMPass());
280284

0 commit comments

Comments
 (0)