This is an archive of the discontinued LLVM Phabricator instance.

[X86] Correct load-op-store cycle detection Analysis.
ClosedPublic

Authored by niravd on Feb 9 2018, 7:35 PM.

Details

Summary

Add missing cycle dependency checks in load-op-store fusion.

Fixes PR36274.

Diff Detail

Repository
rL LLVM

Event Timeline

niravd created this revision.Feb 9 2018, 7:35 PM
niravd updated this revision to Diff 133883.Feb 12 2018, 9:33 AM

Add a missing check between ST and Zn nodes.

jgorbe added a subscriber: jgorbe.Feb 13 2018, 11:28 AM

Comments are very confusing, but logic seems reasonable.

llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
2109 ↗(On Diff #133883)

"Visualization of load-store-fuse transformation"

2137 ↗(On Diff #133883)

backwards, if Zn is a chain predecessor to St, but a value successor to Op.

2139 ↗(On Diff #133883)

Too confusing, rewrite.

llvm/test/CodeGen/X86/pr36274.ll
41 ↗(On Diff #133883)

I think a single load i64, add i64, then volatile store of the low half, volatile store of the high half might show the same issue with less cruft in the test.

niravd updated this revision to Diff 135131.Feb 20 2018, 1:25 PM

Address James' comment and test case requests.

niravd marked 4 inline comments as done.Feb 20 2018, 1:25 PM
niravd updated this revision to Diff 135504.Feb 22 2018, 12:41 PM
jyknight accepted this revision.Feb 27 2018, 8:41 AM

Seems to make sense. :)

This revision is now accepted and ready to land.Feb 27 2018, 8:41 AM
This revision was automatically updated to reflect the committed changes.