2017-10-19 23:37:38 +02:00
|
|
|
//===-- RISCV.h - Top-level interface for RISCV -----------------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 09:50:56 +01:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2017-10-19 23:37:38 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains the entry points for global functions defined in the LLVM
|
|
|
|
// RISC-V back-end.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_LIB_TARGET_RISCV_RISCV_H
|
|
|
|
#define LLVM_LIB_TARGET_RISCV_RISCV_H
|
|
|
|
|
[RISCV] Support named operands for CSR instructions.
Reviewers: asb, mgrang
Reviewed By: asb
Subscribers: jocewei, mgorny, jfb, PkmX, MartinMosbeck, brucehoult, the_o, rkruppe, rogfer01, rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones
Differential Revision: https://reviews.llvm.org/D46759
llvm-svn: 343822
2018-10-04 23:50:54 +02:00
|
|
|
#include "Utils/RISCVBaseInfo.h"
|
2018-09-19 12:54:22 +02:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2017-10-19 23:37:38 +02:00
|
|
|
|
|
|
|
namespace llvm {
|
[RISCV GlobalISel] Adding initial GlobalISel infrastructure
Summary:
Add an initial GlobalISel skeleton for RISCV. It can only run ir translator for `ret void`.
Patch by Andrew Wei
Reviewers: asb, sabuasal, apazos, lenary, simoncook, lewis-revill, edward-jones, rogfer01, xiangzhai, rovka, Petar.Avramovic, mgorny, dsanders
Reviewed By: dsanders
Subscribers: pzheng, s.egerton, dsanders, hiraditya, rbar, johnrusso, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, psnobl, benna, Jim, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65219
llvm-svn: 369467
2019-08-21 00:53:24 +02:00
|
|
|
class RISCVRegisterBankInfo;
|
|
|
|
class RISCVSubtarget;
|
2017-10-19 23:37:38 +02:00
|
|
|
class RISCVTargetMachine;
|
2017-11-08 14:24:21 +01:00
|
|
|
class AsmPrinter;
|
|
|
|
class FunctionPass;
|
[RISCV GlobalISel] Adding initial GlobalISel infrastructure
Summary:
Add an initial GlobalISel skeleton for RISCV. It can only run ir translator for `ret void`.
Patch by Andrew Wei
Reviewers: asb, sabuasal, apazos, lenary, simoncook, lewis-revill, edward-jones, rogfer01, xiangzhai, rovka, Petar.Avramovic, mgorny, dsanders
Reviewed By: dsanders
Subscribers: pzheng, s.egerton, dsanders, hiraditya, rbar, johnrusso, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, psnobl, benna, Jim, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65219
llvm-svn: 369467
2019-08-21 00:53:24 +02:00
|
|
|
class InstructionSelector;
|
2017-10-19 23:37:38 +02:00
|
|
|
class MCInst;
|
2017-11-08 14:24:21 +01:00
|
|
|
class MCOperand;
|
2017-10-19 23:37:38 +02:00
|
|
|
class MachineInstr;
|
2017-11-08 14:24:21 +01:00
|
|
|
class MachineOperand;
|
[RISCV] Add machine function pass to merge base + offset
Summary:
In r333455 we added a peephole to fix the corner cases that result
from separating base + offset lowering of global address.The
peephole didn't handle some of the cases because it only has a basic
block view instead of a function level view.
This patch replaces that logic with a machine function pass. In
addition to handling the original cases it handles uses of the global
address across blocks in function and folding an offset from LW\SW
instruction. This pass won't run for OptNone compilation, so there
will be a negative impact overall vs the old approach at O0.
Reviewers: asb, apazos, mgrang
Reviewed By: asb
Subscribers: MartinMosbeck, brucehoult, the_o, rogfer01, mgorny, rbar, johnrusso, simoncook, niosHD, kito-cheng, shiva0217, zzheng, llvm-commits, edward-jones
Differential Revision: https://reviews.llvm.org/D47857
llvm-svn: 335786
2018-06-27 22:51:42 +02:00
|
|
|
class PassRegistry;
|
2017-10-19 23:37:38 +02:00
|
|
|
|
2017-11-08 14:24:21 +01:00
|
|
|
void LowerRISCVMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
|
|
|
|
const AsmPrinter &AP);
|
|
|
|
bool LowerRISCVMachineOperandToMCOperand(const MachineOperand &MO,
|
|
|
|
MCOperand &MCOp, const AsmPrinter &AP);
|
2017-10-19 23:37:38 +02:00
|
|
|
|
|
|
|
FunctionPass *createRISCVISelDag(RISCVTargetMachine &TM);
|
[RISCV] Add machine function pass to merge base + offset
Summary:
In r333455 we added a peephole to fix the corner cases that result
from separating base + offset lowering of global address.The
peephole didn't handle some of the cases because it only has a basic
block view instead of a function level view.
This patch replaces that logic with a machine function pass. In
addition to handling the original cases it handles uses of the global
address across blocks in function and folding an offset from LW\SW
instruction. This pass won't run for OptNone compilation, so there
will be a negative impact overall vs the old approach at O0.
Reviewers: asb, apazos, mgrang
Reviewed By: asb
Subscribers: MartinMosbeck, brucehoult, the_o, rogfer01, mgorny, rbar, johnrusso, simoncook, niosHD, kito-cheng, shiva0217, zzheng, llvm-commits, edward-jones
Differential Revision: https://reviews.llvm.org/D47857
llvm-svn: 335786
2018-06-27 22:51:42 +02:00
|
|
|
|
|
|
|
FunctionPass *createRISCVMergeBaseOffsetOptPass();
|
|
|
|
void initializeRISCVMergeBaseOffsetOptPass(PassRegistry &);
|
2018-09-19 12:54:22 +02:00
|
|
|
|
|
|
|
FunctionPass *createRISCVExpandPseudoPass();
|
|
|
|
void initializeRISCVExpandPseudoPass(PassRegistry &);
|
[RISCV GlobalISel] Adding initial GlobalISel infrastructure
Summary:
Add an initial GlobalISel skeleton for RISCV. It can only run ir translator for `ret void`.
Patch by Andrew Wei
Reviewers: asb, sabuasal, apazos, lenary, simoncook, lewis-revill, edward-jones, rogfer01, xiangzhai, rovka, Petar.Avramovic, mgorny, dsanders
Reviewed By: dsanders
Subscribers: pzheng, s.egerton, dsanders, hiraditya, rbar, johnrusso, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, psnobl, benna, Jim, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65219
llvm-svn: 369467
2019-08-21 00:53:24 +02:00
|
|
|
|
2020-06-29 12:03:26 +02:00
|
|
|
FunctionPass *createRISCVExpandAtomicPseudoPass();
|
|
|
|
void initializeRISCVExpandAtomicPseudoPass(PassRegistry &);
|
|
|
|
|
[RISCV GlobalISel] Adding initial GlobalISel infrastructure
Summary:
Add an initial GlobalISel skeleton for RISCV. It can only run ir translator for `ret void`.
Patch by Andrew Wei
Reviewers: asb, sabuasal, apazos, lenary, simoncook, lewis-revill, edward-jones, rogfer01, xiangzhai, rovka, Petar.Avramovic, mgorny, dsanders
Reviewed By: dsanders
Subscribers: pzheng, s.egerton, dsanders, hiraditya, rbar, johnrusso, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, psnobl, benna, Jim, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65219
llvm-svn: 369467
2019-08-21 00:53:24 +02:00
|
|
|
InstructionSelector *createRISCVInstructionSelector(const RISCVTargetMachine &,
|
|
|
|
RISCVSubtarget &,
|
|
|
|
RISCVRegisterBankInfo &);
|
2017-10-19 23:37:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|