This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Don't remove swap if there is only a single one between the load and store
ClosedPublic

Authored by nemanjai on Jul 28 2020, 11:49 AM.

Details

Summary

The swap removal pass looks to remove swaps when a loaded value is swapped, some number of lane-insensitive operations are performed and then the value is swapped again and stored.
However, in a situation where we load the value, swap it and then store it without swapping again, the pass erroneously removes the single swap. The reason is that both checks in the same equivalence class:

  • load feeds a swap
  • swap feeds a store

pass. However, there is no check that the two swaps are actually a single swap. This patch just fixes that.

Diff Detail

Event Timeline

nemanjai created this revision.Jul 28 2020, 11:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2020, 11:49 AM
nemanjai requested review of this revision.Jul 28 2020, 11:49 AM

@wschmidt Sorry to ask you to go back to looking at LLVM code, but figured I'd add you for two reasons:

  1. If gcc has the same issue
  2. If the proposed fix is completely out to lunch :)
rzurob added a subscriber: rzurob.Jul 28 2020, 12:51 PM

@wschmidt Sorry to ask you to go back to looking at LLVM code, but figured I'd add you for two reasons:

  1. If gcc has the same issue
  2. If the proposed fix is completely out to lunch :)

I heard back from Bill in a separate email since his Phabricator credentials are no longer active and he approves.

kbarton accepted this revision as: kbarton.Jul 29 2020, 8:33 AM

LGTM

This revision is now accepted and ready to land.Jul 29 2020, 8:33 AM