diff options
| author | Geoff Berry <gberry@codeaurora.org> | 2017-08-16 20:50:01 +0000 |
|---|---|---|
| committer | Geoff Berry <gberry@codeaurora.org> | 2017-08-16 20:50:01 +0000 |
| commit | 87f8d25150facee0e5ae1884871db420c925877c (patch) | |
| tree | b770d78ed491fed130a9d01d63675f48a3638a43 /llvm/lib/CodeGen/TargetPassConfig.cpp | |
| parent | 0fb5b788920b6039b13197fd11212c3cf8d9d714 (diff) | |
| download | bcm5719-llvm-87f8d25150facee0e5ae1884871db420c925877c.tar.gz bcm5719-llvm-87f8d25150facee0e5ae1884871db420c925877c.zip | |
[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
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/TargetPassConfig.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp index 481baea2dff..7860a932c2b 100644 --- a/llvm/lib/CodeGen/TargetPassConfig.cpp +++ b/llvm/lib/CodeGen/TargetPassConfig.cpp @@ -88,6 +88,8 @@ static cl::opt<bool> DisableCGP("disable-cgp", cl::Hidden, cl::desc("Disable Codegen Prepare")); static cl::opt<bool> DisableCopyProp("disable-copyprop", cl::Hidden, cl::desc("Disable Copy Propagation pass")); +static cl::opt<bool> DisableCopyPropPreRegRewrite("disable-copyprop-prerewrite", cl::Hidden, + cl::desc("Disable Copy Propagation Pre-Register Re-write pass")); static cl::opt<bool> DisablePartialLibcallInlining("disable-partial-libcall-inlining", cl::Hidden, cl::desc("Disable Partial Libcall Inlining")); static cl::opt<bool> EnableImplicitNullChecks( @@ -248,6 +250,9 @@ static IdentifyingPassPtr overridePass(AnalysisID StandardID, if (StandardID == &MachineCopyPropagationID) return applyDisable(TargetID, DisableCopyProp); + if (StandardID == &MachineCopyPropagationPreRegRewriteID) + return applyDisable(TargetID, DisableCopyPropPreRegRewrite); + return TargetID; } @@ -1059,6 +1064,10 @@ void TargetPassConfig::addOptimizedRegAlloc(FunctionPass *RegAllocPass) { // Allow targets to change the register assignments before rewriting. addPreRewrite(); + // Copy propagate to forward register uses and try to eliminate COPYs that + // were not coalesced. + addPass(&MachineCopyPropagationPreRegRewriteID); + // Finally rewrite virtual registers. addPass(&VirtRegRewriterID); |

