[all-commits] [llvm/llvm-project] 4fe0d3: [RISCV][GISel] Refactor most of selectConstant int...

Craig Topper via All-commits all-commits at lists.llvm.org
Sat Nov 4 11:45:38 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4fe0d35f7c4cc03fc8a27533384e7fd834721173
      https://github.com/llvm/llvm-project/commit/4fe0d35f7c4cc03fc8a27533384e7fd834721173
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-11-04 (Sat, 04 Nov 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp

  Log Message:
  -----------
  [RISCV][GISel] Refactor most of selectConstant into a general constant materialization function.

Move the G_CONSTANT specific parts up to the switch that calls it.

The materialization function will be used by G_FCONSTANT too.

The only functional change is we now create COPY from X0 for the 0
case instead of changing the G_CONSTANT in place.


  Commit: 422ffc525a064c2397a57bbfa90c5446bd0f0aee
      https://github.com/llvm/llvm-project/commit/422ffc525a064c2397a57bbfa90c5446bd0f0aee
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-11-04 (Sat, 04 Nov 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
    M llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
    M llvm/lib/Target/RISCV/GISel/RISCVRegisterBankInfo.cpp
    A llvm/test/CodeGen/RISCV/GlobalISel/instruction-select/fp-constant.mir

  Log Message:
  -----------
  [RISCV][GISel] Add instruction selection for G_FCONSTANT using integer materialization.

This supports any G_FCONSTANT for F and D extensions.

This builds the constant in the integer domain and moves it to FP
using either FMV or the stack.

Eventually we should use the constant pool for some constants that
require many instructions, but this is a good starting point to
get something working.


Compare: https://github.com/llvm/llvm-project/compare/1bb48c440b92...422ffc525a06


More information about the All-commits mailing list