mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 14:46:53 +00:00
69e68a5966
Due to an erratum in some versions of LEON, we must insert a NOP after any LD or LDF instruction to ensure the processor has time to load the value correctly before using it. This pass will implement that erratum fix. The code will have no effect for other Sparc, but non-LEON processors. Differential Review: http://reviews.llvm.org/D20353 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270417 91177308-0d34-0410-b5e6-96231b3b80d8
47 lines
1.3 KiB
C++
Executable File
47 lines
1.3 KiB
C++
Executable File
//===------- LeonPasses.h - Define passes specific to LEON ----------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_LIB_TARGET_SPARC_LEON_PASSES_H
|
|
#define LLVM_LIB_TARGET_SPARC_LEON_PASSES_H
|
|
|
|
#include "llvm/CodeGen/Passes.h"
|
|
#include "llvm/CodeGen/MachineFunctionPass.h"
|
|
#include "llvm/CodeGen/MachineBasicBlock.h"
|
|
|
|
#include "Sparc.h"
|
|
#include "SparcSubtarget.h"
|
|
|
|
using namespace llvm;
|
|
|
|
class LEONMachineFunctionPass : public MachineFunctionPass {
|
|
protected:
|
|
const SparcSubtarget *Subtarget;
|
|
|
|
protected:
|
|
LEONMachineFunctionPass(TargetMachine &tm, char& ID);
|
|
LEONMachineFunctionPass(char& ID);
|
|
};
|
|
|
|
class InsertNOPLoad : public LEONMachineFunctionPass {
|
|
public:
|
|
static char ID;
|
|
|
|
InsertNOPLoad(TargetMachine &tm);
|
|
bool runOnMachineFunction(MachineFunction& MF) override;
|
|
|
|
const char *getPassName() const override {
|
|
return "InsertNOPLoad: Erratum Fix LBR35: insert a NOP instruction after every single-cycle load instruction when the next instruction is another load/store instruction";
|
|
}
|
|
};
|
|
|
|
#endif
|