[PATCH] D129715: [LoongArch] Optimize the loading of floating-point immediates

Gong LingQin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 18:32:34 PDT 2022


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

For example, when loading 1.0, use

  lu52i.d $a0, $zero, 0x3ff
  movgr2fr.d $fa0, $a0

instead of

  addi.d $a0, $zero, 1
  movgr2fr.d $fa0, $a0
  ffint.d.l $fa0, $fa0

Thanks to @xry111 for the suggestion: https://reviews.llvm.org/D128898#3632140


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129715

Files:
  llvm/lib/Target/LoongArch/LoongArchFloat32InstrInfo.td
  llvm/lib/Target/LoongArch/LoongArchFloat64InstrInfo.td
  llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.cpp
  llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.h
  llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
  llvm/lib/Target/LoongArch/LoongArchISelLowering.h
  llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
  llvm/test/CodeGen/LoongArch/double-imm.ll
  llvm/test/CodeGen/LoongArch/float-imm.ll
  llvm/test/CodeGen/LoongArch/ir-instruction/double-convert.ll
  llvm/test/CodeGen/LoongArch/ir-instruction/float-convert.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129715.444483.patch
Type: text/x-patch
Size: 22683 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220714/5cd9f41f/attachment.bin>


More information about the llvm-commits mailing list