This is an archive of the discontinued LLVM Phabricator instance.

[VE] Support atomic exchange instructions
ClosedPublic

Authored by kaz7 on Dec 12 2020, 5:29 AM.

Details

Summary

Support atomic exchange and atomic compare and exchange instructions.
Change CAS and TS1AM instructions for ISel patterns. Add selectADDRzi
pattern for them. Add TS1AM pseudo instruction also for better ISel.
Add shouldExpandAtomicRMWInIR() function to expand all atomicrmw
instructions except atomicrmw xchg. Add custom lower for i8/i16
atomicrmw xchg. Modify replaceFI to support CAS/TS1AM instructions
which use "reg+disp" operands instead of "reg+imm+disp" operands.
And, add several regression tests to check the correctness.

Diff Detail

Event Timeline

kaz7 created this revision.Dec 12 2020, 5:29 AM
kaz7 requested review of this revision.Dec 12 2020, 5:29 AM

LGTM with nits.

llvm/lib/Target/VE/VEISelLowering.h
33–41

Re-formatting this list is an unrelated change. We should do this in a separate commit.

llvm/lib/Target/VE/VERegisterInfo.cpp
28–29

Also an unrelated change.

kaz7 added inline comments.Dec 14 2020, 7:04 AM
llvm/lib/Target/VE/VEISelLowering.h
33–41

Ok. I'll revert it.

llvm/lib/Target/VE/VERegisterInfo.cpp
28–29

It is required to add L. 141. But, I can remove L. 141.

kaz7 updated this revision to Diff 311578.Dec 14 2020, 7:11 AM

Update following suggestsions.

kaz7 updated this revision to Diff 311630.Dec 14 2020, 9:26 AM

Clean prepareTS1AM function by simplifying i32/i64 types.

simoll accepted this revision.Dec 15 2020, 12:39 AM
This revision is now accepted and ready to land.Dec 15 2020, 12:39 AM
This revision was landed with ongoing or failed builds.Dec 15 2020, 12:45 AM
This revision was automatically updated to reflect the committed changes.