This is an archive of the discontinued LLVM Phabricator instance.

[X86] Remove RELEASE_ and ACQUIRE_ pseudo instructions. Use isel patterns and the normal instructions instead
ClosedPublic

Authored by craig.topper on Aug 2 2018, 7:01 PM.

Details

Summary

At one point in time acquire implied mayLoad and mayStore as did release. Thus we needed separate pseudos that also carried that property. This appears to no longer be the case. I believe it was changed in 2012 with a comment saying that atomic memory accesses are marked volatile which preserves the ordering.

So from what I can tell we shouldn't need additional pseudos since they aren't carry any flags that are different from the normal instructions. The only thing I can think of is that we may consider them for load folding candidates in the peephole pass now where we didn't before. If that's important hopefully there's something in the memory operand we can check to prevent the folding without relying on pseudo instructions.

I've also remove the code that implemented atomic_load+fadd+atomic_store. We didn't support any other fp ops. It didn't support AVX encoding. And it used a CustomInserter. I think it can be done with isel patterns instead, but I'm not sure how important it really is. It doesn't look like icc, gcc, or MSVC try this hard to fold any operations with atomic load/store so its not clear we should.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Aug 2 2018, 7:01 PM
jfb requested changes to this revision.Aug 3 2018, 8:36 AM
jfb added inline comments.
test/CodeGen/X86/atomic_mi.ll
1725 ↗(On Diff #158884)

This seems undesirable to remove. I don't understand the justification you have for getting rid of it. Ditto all the other FP changes. Please separate FP changes from the cleanup you're trying to achieve.

This revision now requires changes to proceed.Aug 3 2018, 8:36 AM

Put the floating point stuff back

jfb accepted this revision.Aug 3 2018, 2:09 PM
This revision is now accepted and ready to land.Aug 3 2018, 2:09 PM
This revision was automatically updated to reflect the committed changes.