Skip to content

Commit 87f8d25

Browse files
committed
[MachineCopyPropagation] Extend pass to do COPY source forwarding
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 llvm-svn: 311038
1 parent 0fb5b78 commit 87f8d25

File tree

89 files changed

+997
-488
lines changed

Some content is hidden

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

89 files changed

+997
-488
lines changed

llvm/include/llvm/CodeGen/Passes.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ namespace llvm {
278278
/// MachineSinking - This pass performs sinking on machine instructions.
279279
extern char &MachineSinkingID;
280280

281+
/// MachineCopyPropagationPreRegRewrite - This pass performs copy propagation
282+
/// on machine instructions after register allocation but before virtual
283+
/// register re-writing..
284+
extern char &MachineCopyPropagationPreRegRewriteID;
285+
281286
/// MachineCopyPropagation - This pass performs copy propagation on
282287
/// machine instructions.
283288
extern char &MachineCopyPropagationID;

llvm/include/llvm/InitializePasses.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ void initializeMachineBranchProbabilityInfoPass(PassRegistry&);
233233
void initializeMachineCSEPass(PassRegistry&);
234234
void initializeMachineCombinerPass(PassRegistry&);
235235
void initializeMachineCopyPropagationPass(PassRegistry&);
236+
void initializeMachineCopyPropagationPreRegRewritePass(PassRegistry&);
236237
void initializeMachineDominanceFrontierPass(PassRegistry&);
237238
void initializeMachineDominatorTreePass(PassRegistry&);
238239
void initializeMachineFunctionPrinterPassPass(PassRegistry&);

llvm/lib/CodeGen/CodeGen.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void llvm::initializeCodeGen(PassRegistry &Registry) {
5454
initializeMachineCSEPass(Registry);
5555
initializeMachineCombinerPass(Registry);
5656
initializeMachineCopyPropagationPass(Registry);
57+
initializeMachineCopyPropagationPreRegRewritePass(Registry);
5758
initializeMachineDominatorTreePass(Registry);
5859
initializeMachineFunctionPrinterPassPass(Registry);
5960
initializeMachineLICMPass(Registry);

0 commit comments

Comments
 (0)