Skip to content

Commit

Permalink
[MachineCopyPropagation] Extend pass to do COPY source forwarding
Browse files Browse the repository at this point in the history
This change extends MachineCopyPropagation to do COPY source forwarding.

This change also extends the MachineCopyPropagation pass to be able to
be run during register allocation, after physical registers have been
assigned, but before the virtual registers have been re-written, which
allows it to remove virtual register COPY LiveIntervals that become dead
through the forwarding of all of their uses.

Reviewers: qcolombet, javed.absar, MatzeB, jonpa

Subscribers: jyknight, nemanjai, llvm-commits, nhaehnle, mcrosier, mgorny

Differential Revision: https://reviews.llvm.org/D30751

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311038 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
geoffberry committed Aug 16, 2017
1 parent f7b0497 commit 31db6f3
Show file tree
Hide file tree
Showing 89 changed files with 997 additions and 488 deletions.
5 changes: 5 additions & 0 deletions include/llvm/CodeGen/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ namespace llvm {
/// MachineSinking - This pass performs sinking on machine instructions.
extern char &MachineSinkingID;

/// MachineCopyPropagationPreRegRewrite - This pass performs copy propagation
/// on machine instructions after register allocation but before virtual
/// register re-writing..
extern char &MachineCopyPropagationPreRegRewriteID;

/// MachineCopyPropagation - This pass performs copy propagation on
/// machine instructions.
extern char &MachineCopyPropagationID;
Expand Down
1 change: 1 addition & 0 deletions include/llvm/InitializePasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ void initializeMachineBranchProbabilityInfoPass(PassRegistry&);
void initializeMachineCSEPass(PassRegistry&);
void initializeMachineCombinerPass(PassRegistry&);
void initializeMachineCopyPropagationPass(PassRegistry&);
void initializeMachineCopyPropagationPreRegRewritePass(PassRegistry&);
void initializeMachineDominanceFrontierPass(PassRegistry&);
void initializeMachineDominatorTreePass(PassRegistry&);
void initializeMachineFunctionPrinterPassPass(PassRegistry&);
Expand Down
1 change: 1 addition & 0 deletions lib/CodeGen/CodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ void llvm::initializeCodeGen(PassRegistry &Registry) {
initializeMachineCSEPass(Registry);
initializeMachineCombinerPass(Registry);
initializeMachineCopyPropagationPass(Registry);
initializeMachineCopyPropagationPreRegRewritePass(Registry);
initializeMachineDominatorTreePass(Registry);
initializeMachineFunctionPrinterPassPass(Registry);
initializeMachineLICMPass(Registry);
Expand Down
Loading

0 comments on commit 31db6f3

Please sign in to comment.