This is an archive of the discontinued LLVM Phabricator instance.

[X86] Cleanup type conversion of 64-bit load-store pairs.
ClosedPublic

Authored by niravd on Dec 6 2017, 1:01 PM.

Details

Summary

Simplify and generalize chain handling and search for 64-bit load-store pairs.
Nontemporal test now converts 64-bit integer load-store into f64 which it realizes directly instead of splitting into two i32 pairs.

Diff Detail

Repository
rL LLVM

Event Timeline

niravd created this revision.Dec 6 2017, 1:01 PM
niravd planned changes to this revision.Dec 6 2017, 1:04 PM

This is missing a fix in the store generation. Fixing now.

niravd updated this revision to Diff 125793.Dec 6 2017, 1:10 PM

Fix chain computation in 64-bit to 2x32-bit path.

craig.topper added inline comments.Dec 7 2017, 12:11 AM
llvm/lib/Target/X86/X86ISelLowering.cpp
34373 ↗(On Diff #125793)

Is NewChain an unused variable now?

craig.topper edited edge metadata.Dec 7 2017, 12:18 AM

Are we supposed to be losing the non temporal property during this transformation?

niravd updated this revision to Diff 125949.Dec 7 2017, 7:14 AM

Remove unused NewStore definitions.

niravd added a comment.Dec 7 2017, 7:16 AM

Are we supposed to be losing the non temporal property during this transformation

It's still listed as a 8 byte nontermporal store in the DAG post transformation. IIUC this should be MOVNTQ.

What about the i32 and i64 stores from the original IR? It looks like we emited a movl and a movsd?

niravd added a comment.Dec 7 2017, 8:47 AM

Previously this transformation missed the the i64 load/non-temporal store pair and as a result they get split into a i32 operations. Because this aligns with the nontemporal store of the doubleword value in 12(%ebp) another transformation elides that pair (which given what this test look at is probably indicative that this test needs some sort of fencing added).

I was wondering why we weren't using movntsd, but I forgot that's an AMD SSE4A instruction.

niravd updated this revision to Diff 126369.Dec 11 2017, 8:10 AM
niravd edited the summary of this revision. (Show Details)

Rebase past nontemporal store update.

craig.topper accepted this revision.Dec 12 2017, 10:10 AM

LGTM, but I wonder if we should be avoiding nontemporal stores if we can't preserve that property in the generated instructions. I assume that issue exists for other cases even without this patch though.

This revision is now accepted and ready to land.Dec 12 2017, 10:10 AM
This revision was automatically updated to reflect the committed changes.