This is an archive of the discontinued LLVM Phabricator instance.

[Local][SimplifyCFG][GVN] Handle !nontemporal in combineMetadata
ClosedPublic

Authored by dwoodwor-intel on Feb 17 2023, 1:44 PM.

Details

Summary

SimplifyCFG currently drops !nontemporal metadata when sinking common instructions. With this change, SimplifyCFG and similar transforms will preserve !nontemporal metadata as long as it is set on both original instructions.

Diff Detail

Event Timeline

dwoodwor-intel created this revision.Feb 17 2023, 1:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2023, 1:44 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
dwoodwor-intel requested review of this revision.Feb 17 2023, 1:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2023, 1:44 PM

It seems the change in patchReplacementInstruction is not tested. I think it's better to make it tested.

dwoodwor-intel retitled this revision from [Local][SimplifyCFG] Handle !nontemporal in combineMetadata to [Local][SimplifyCFG][GVN] Handle !nontemporal in combineMetadata.

I've added a new GVN test to exercise the patchReplacementInstruction change, and I also added a GVNSink test to make sure this change works properly in that pass too even though it uses the same code path as SimplifyCFG. Are there other passes I should add tests for/update to better combine !nontemporal metadata?

nikic accepted this revision.Feb 21 2023, 11:45 AM

LGTM

This revision is now accepted and ready to land.Feb 21 2023, 11:45 AM

I don't have commit access; can you commit this for me? You can credit my name/email as Daniel Woodworth <daniel.woodworth@intel.com>.

This revision was landed with ongoing or failed builds.Feb 22 2023, 5:47 AM
This revision was automatically updated to reflect the committed changes.