[all-commits] [llvm/llvm-project] 3f1c40: [RISCV] Use AdjustInstrPostInstrSelection to inser...

Craig Topper via All-commits all-commits at lists.llvm.org
Tue Dec 14 10:18:38 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3f1c403a2b0a60198aee1c69ee2be7c0aa3a70e8
      https://github.com/llvm/llvm-project/commit/3f1c403a2b0a60198aee1c69ee2be7c0aa3a70e8
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2021-12-14 (Tue, 14 Dec 2021)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/lib/Target/RISCV/RISCVISelLowering.h
    M llvm/lib/Target/RISCV/RISCVInstrFormats.td
    M llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
    M llvm/lib/Target/RISCV/RISCVInstrInfo.h
    M llvm/lib/Target/RISCV/RISCVInstrInfoF.td
    A llvm/test/CodeGen/RISCV/frm-dependency.ll

  Log Message:
  -----------
  [RISCV] Use AdjustInstrPostInstrSelection to insert a FRM dependency for scalar FP instructions with dynamic rounding mode.

In order to support constrained FP intrinsics we need to model FRM
dependency. Whether or not a instruction uses FRM is based on a 3
bit field in the instruction. Because of this we can't add
'Uses = [FRM]' to the tablegen descriptions.

This patch examines the immediate after isel and adds an implicit
use of FRM. This idea came from Roger Ferrer Ibanez.

Other ideas:
We could be overly conservative and just pretend all instructions with
frm field read the FRM register. Or we could have pseudoinstructions
for CodeGen with rounding mode.

Reviewed By: asb, frasercrmck, arcbbb

Differential Revision: https://reviews.llvm.org/D115555




More information about the All-commits mailing list