This is an archive of the discontinued LLVM Phabricator instance.

[LoongArch] Add codegen support for atomicrmw umin/umax operation on LA64
ClosedPublic

Authored by gonglingqin on Oct 8 2022, 7:07 PM.

Details

Summary

Furthermore, use beqz $rd, .BB instead of beq $rd, $zero, .BB.

Diff Detail

Event Timeline

gonglingqin created this revision.Oct 8 2022, 7:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 8 2022, 7:07 PM
gonglingqin requested review of this revision.Oct 8 2022, 7:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 8 2022, 7:07 PM
gonglingqin retitled this revision from Add codegen support for atomicrmw umin/umax operation on LA64 to [LoongArch] Add codegen support for atomicrmw umin/umax operation on LA64.Oct 8 2022, 7:09 PM

Do we need dbar instructions around the ll/sc loop?

llvm/lib/Target/LoongArch/LoongArchExpandAtomicPseudoInsts.cpp
415

I think it's better to use BEQZ here.

Do we need dbar instructions around the ll/sc loop?

Yes. Thanks for the checking, I will fix this.

llvm/lib/Target/LoongArch/LoongArchExpandAtomicPseudoInsts.cpp
415

Good suggestion! I will modify it. Thanks.

Address @xry111's comments.

Some inline comments. Thanks.

llvm/test/CodeGen/LoongArch/ir-instruction/atomicrmw-minmax.ll
77

rd == rj ? Maybe we miss earlyclobber?

86

Ditto.

162

Ditto.

171

Ditto.

llvm/test/CodeGen/LoongArch/ir-instruction/atomicrmw.ll
23

Had better mention this change in summary.

gonglingqin added inline comments.Oct 12 2022, 7:58 PM
llvm/test/CodeGen/LoongArch/ir-instruction/atomicrmw-minmax.ll
77

Thanks, I will rebase this patch.

86

Thanks, I will rebase this patch.

162

Thanks, I will rebase this patch.

171

Thanks, I will rebase this patch.

llvm/test/CodeGen/LoongArch/ir-instruction/atomicrmw.ll
23

Thanks, I will update the summary.

gonglingqin edited the summary of this revision. (Show Details)Oct 12 2022, 8:01 PM
This revision is now accepted and ready to land.Oct 12 2022, 8:07 PM
This revision was landed with ongoing or failed builds.Oct 14 2022, 12:41 AM
This revision was automatically updated to reflect the committed changes.