This is an archive of the discontinued LLVM Phabricator instance.

[NFC][DAGCombine] Extract post-inc logic
ClosedPublic

Authored by samparker on Mar 12 2020, 5:38 AM.

Details

Summary

Extract the decision to combine into a post-inc address into a function to make the logic more clear and re-usable. This is a prep step for D75847.

Diff Detail

Event Timeline

samparker created this revision.Mar 12 2020, 5:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2020, 5:38 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
samparker updated this revision to Diff 249926.Mar 12 2020, 7:26 AM
samparker edited the summary of this revision. (Show Details)

We now have two helper functions:

  • getPostIndexedLoadStoreOp
  • shouldCombineToPostInc
dmgreen accepted this revision.Mar 22 2020, 2:47 PM

LGTM

This revision is now accepted and ready to land.Mar 22 2020, 2:47 PM
This revision was automatically updated to reflect the committed changes.
DavidSpickett added a subscriber: DavidSpickett.EditedApr 7 2020, 8:21 AM

Hi @samparker , this change caused a regression in Spec2k6 which we run in Linaro's CI. The root cause seems to be that loads with a post increment became load plus an add in one specific function. Certainly unexpected for an NFC change.

E.g.

- ldr	x1, [x20], #48
+ ldr	x1, [x1]
+ add	x2, x19, #48

To reproduce build the attached source file with:
clang -O2 --target=aarch64-linux-gnu -c ~/io_lat4.i -S -o -

You should see a difference in the "write_checksum" function.

Ah... something's gone wrong then. I'll look into it, cheers.