[PATCH] D137004: [LoongArch] Added spill/reload/copy support for CFRs

wanglei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 20:32:08 PDT 2022


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

1, spill/reload
When a function call is made immediately after a floating point
comparison, the result of the comparison needs to be spilled before
function call and reloaded after the function returns.

2, copy
Support `GPR` to `CFR` and `CFR` to `GRP` copys. Therefore, the correct
register class can be used in the pattern template, and the hard-coding
of mutual coping of `CFR` and `GRP` is eliminated, reducing redundant
comparison instructions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137004

Files:
  llvm/lib/Target/LoongArch/LoongArchFloat32InstrInfo.td
  llvm/lib/Target/LoongArch/LoongArchFloat64InstrInfo.td
  llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp
  llvm/lib/Target/LoongArch/LoongArchRegisterInfo.cpp
  llvm/test/CodeGen/LoongArch/ir-instruction/fcmp-dbl.ll
  llvm/test/CodeGen/LoongArch/ir-instruction/fcmp-flt.ll
  llvm/test/CodeGen/LoongArch/ir-instruction/float-convert.ll
  llvm/test/CodeGen/LoongArch/spill-reload-cfr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137004.471707.patch
Type: text/x-patch
Size: 13879 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221029/df20aa21/attachment.bin>


More information about the llvm-commits mailing list