This is an archive of the discontinued LLVM Phabricator instance.

[mips] Fix atomic compare and swap at O0.
ClosedPublic

Authored by sdardis on Feb 22 2017, 8:38 AM.

Details

Summary

Similar to PR/25526, fast-regalloc introduces spills at the end of basic
blocks. When this occurs in between an ll and sc, the store can cause the
atomic sequence to fail.

This patch fixes the issue by introducing more pseudos to represent atomic
operations and moving their lowering to after the expansion of postRA
pseudos.

This resolves PR/32020.

Thanks to James Cowgill for reporting the issue!

Diff Detail

Repository
rL LLVM

Event Timeline

sdardis created this revision.Feb 22 2017, 8:38 AM
slthakur accepted this revision.Feb 23 2017, 4:13 AM

LGTM with minor nits.

lib/Target/Mips/MipsExpandPseudo.cpp
1 ↗(On Diff #89367)

Nit: "MipsExpandPseudoInsts.cpp"

lib/Target/Mips/MipsISelLowering.cpp
1410 ↗(On Diff #89367)

Should we remove this function completely since there are no calls to this function?

This revision is now accepted and ready to land.Feb 23 2017, 4:13 AM
This revision was automatically updated to reflect the committed changes.