This is an archive of the discontinued LLVM Phabricator instance.

[AArch64LoadStoreOptimizer] Skip debug insts during pattern matching
ClosedPublic

Authored by vsk on Apr 17 2020, 5:47 PM.

Details

Summary

Do not count the presence of debug insts against the limit set by
LdStLimit, and allow the optimizer to find matching insts by skipping
over debug insts.

Diff Detail

Event Timeline

vsk created this revision.Apr 17 2020, 5:47 PM
vsk planned changes to this revision.Apr 17 2020, 5:51 PM

Apologies, this was uploaded too early. This patch still needs cleanup before it's ready to be reviewed.

vsk updated this revision to Diff 258464.Apr 17 2020, 6:12 PM

Backed out some unrelated changes.

fhahn added inline comments.Apr 18 2020, 2:30 AM
llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
750–751

could use range based iterator?

1012

nit: Not sure if it is worth to introduce a variable for a single use, as it also increases the number of variables to keep track in the function.

llvm/test/CodeGen/AArch64/ldst-opt-mte.mir
1

I think it would be slightly better to have the version with DBG_VALUE as separate test, as it unnecessarily clutters the test with respect to the core functionality.

fhahn accepted this revision.Apr 18 2020, 6:32 AM

LGTM with the nits addressed, thanks!

This revision is now accepted and ready to land.Apr 18 2020, 6:32 AM
vsk updated this revision to Diff 259342.Apr 22 2020, 11:20 AM
vsk marked 3 inline comments as done.

Address review feedback:

  • Use range based iterator, split out a second test with debug info, drop extra variable
llvm/test/CodeGen/AArch64/ldst-opt-mte.mir
1

I see; let's add a -mir-debugify run line to the original test so that extensions to the pass get tested with debug info, and then copy the test to have coverage for the case where there are multiple DBG_VALUEs between instruction pairs?

This revision was automatically updated to reflect the committed changes.