[PATCH] D153120: [LoongArch] Fix handling of the chain of CSRWR and CSRXCHG nodes

Lu Weining via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 16 03:03:16 PDT 2023


SixWeining created this revision.
SixWeining added reviewers: hev, xen0n, xry111, wangleiat.
Herald added a subscriber: hiraditya.
Herald added a project: All.
SixWeining requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

`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. `LoongArchISD::CSRXCHG` has the same
issue.

This path addresses this issue.

Depends on D153119 <https://reviews.llvm.org/D153119>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153120

Files:
  llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
  llvm/lib/Target/LoongArch/LoongArchISelLowering.h
  llvm/test/CodeGen/LoongArch/intrinsic-la64.ll
  llvm/test/CodeGen/LoongArch/intrinsic.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153120.532068.patch
Type: text/x-patch
Size: 6669 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230616/332065e0/attachment.bin>


More information about the llvm-commits mailing list