This is an archive of the discontinued LLVM Phabricator instance.

Canonical Copy Propagation
ClosedPublic

Authored by plotfi on Apr 6 2018, 3:53 PM.

Details

Reviewers
bogner
plotfi
Summary

This is a new technique I thought of today, idea is to fold copies of vregs to vregs. Probably will support some cases where there are physregs too.

Diff Detail

Repository
rL LLVM

Event Timeline

plotfi created this revision.Apr 6 2018, 3:53 PM
  1. Please always upload all patches with full context
  2. Test?
plotfi updated this revision to Diff 141518.Apr 7 2018, 8:41 PM
plotfi added a subscriber: bogner.Apr 7 2018, 8:45 PM

Ah yes, thanks. Test and full context included now.

PL

​Sent with ProtonMail Secure Email.​

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

bogner added inline comments.Apr 10 2018, 11:19 AM
lib/CodeGen/MIRCanonicalizerPass.cpp
318

Capitalize variables and clang-format, please.

319

for (MachineInstr &MI : MBB->instrs()), maybe?

320–321

Do we need to be careful about register classes here to preserve semantics?

324

Better to write "MachineInstr *" rather than auto here, it's not much longer and the clarity is worth it

339–347

Is the RenameMOs vector necessary? Why not just setReg in the loop over uses? Also I believe we can use range-for with MRI.uses() here to simplify.

test/CodeGen/MIR/AArch64/mirCanonCopyCopyProp.mir
109–111

I feel like this test can be made much shorter. Can't we do this with just two or three instructions?

plotfi marked 6 inline comments as done.Apr 16 2018, 1:57 AM
plotfi accepted this revision.Apr 16 2018, 2:06 AM
This revision is now accepted and ready to land.Apr 16 2018, 2:06 AM

Justin gave me a LGTM in Person.

plotfi closed this revision.May 29 2019, 5:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 29 2019, 5:01 PM