mirror of
https://github.com/RPCS3/llvm.git
synced 2025-05-15 18:06:08 +00:00

Introduce a new RISCVExpandPseudoInsts pass to expand atomic pseudo-instructions after register allocation. This is necessary in order to ensure that register spills aren't introduced between LL and SC, thus breaking the forward progress guarantee for the operation. AArch64 does something similar for CmpXchg (though only at O0), and Mips is moving towards this approach (see D31287). See also [this mailing list post](http://lists.llvm.org/pipermail/llvm-dev/2016-May/099490.html) from James Knight, which summarises the issues with lowering to ll/sc in IR or pre-RA. See the [accompanying RFC thread](http://lists.llvm.org/pipermail/llvm-dev/2018-June/123993.html) for an overview of the lowering strategy. Differential Revision: https://reviews.llvm.org/D47882 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342534 91177308-0d34-0410-b5e6-96231b3b80d8
46 lines
1.4 KiB
C++
46 lines
1.4 KiB
C++
//===-- RISCV.h - Top-level interface for RISCV -----------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// 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
|
|
|
|
#include "MCTargetDesc/RISCVBaseInfo.h"
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
namespace llvm {
|
|
class RISCVTargetMachine;
|
|
class AsmPrinter;
|
|
class FunctionPass;
|
|
class MCInst;
|
|
class MCOperand;
|
|
class MachineInstr;
|
|
class MachineOperand;
|
|
class PassRegistry;
|
|
|
|
void LowerRISCVMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
|
|
const AsmPrinter &AP);
|
|
bool LowerRISCVMachineOperandToMCOperand(const MachineOperand &MO,
|
|
MCOperand &MCOp, const AsmPrinter &AP);
|
|
|
|
FunctionPass *createRISCVISelDag(RISCVTargetMachine &TM);
|
|
|
|
FunctionPass *createRISCVMergeBaseOffsetOptPass();
|
|
void initializeRISCVMergeBaseOffsetOptPass(PassRegistry &);
|
|
|
|
FunctionPass *createRISCVExpandPseudoPass();
|
|
void initializeRISCVExpandPseudoPass(PassRegistry &);
|
|
}
|
|
|
|
#endif
|