This is an archive of the discontinued LLVM Phabricator instance.

[LoongArch] Fix handling of the chain of CSRWR and CSRXCHG nodes
ClosedPublic

Authored by SixWeining on Jun 16 2023, 3:03 AM.

Details

Summary

LoongArchISD::CSRWR has two results. The first is the result of
loongarch.csrwr.[wd] intrinsic and the second is the chain. But
currently the chain is not processed correctly when creating this
node, resulting in the csrwr instruction being optimized out when
the result is not used by anyone [1]. LoongArchISD::CSRXCHG has
the same issue.

This patch addresses this issue.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/loongarch/include/asm/loongarch.h?h=v6.4-rc6#n219

Diff Detail

Event Timeline

SixWeining created this revision.Jun 16 2023, 3:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2023, 3:03 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
SixWeining requested review of this revision.Jun 16 2023, 3:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2023, 3:03 AM
xry111 edited the summary of this revision. (Show Details)Jun 16 2023, 3:07 AM
hev accepted this revision.Jun 16 2023, 7:27 PM

Thanks.

This revision is now accepted and ready to land.Jun 16 2023, 7:27 PM
SixWeining edited the summary of this revision. (Show Details)

rebase and update commit message (add a link to linux source code)