summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Sparc/LeonPasses.h
diff options
context:
space:
mode:
authorChris Dewhurst <chris.dewhurst@lero.ie>2016-05-23 10:56:36 +0000
committerChris Dewhurst <chris.dewhurst@lero.ie>2016-05-23 10:56:36 +0000
commit4f7cac3674d5f06e2acf2694db86e0a37de6f47c (patch)
tree8429654217184fb6e4cc42fa1eb935ceeae3b094 /llvm/lib/Target/Sparc/LeonPasses.h
parent25227fe7b0b78b1377a00c0205c8d66cbfa4c1fa (diff)
downloadbcm5719-llvm-4f7cac3674d5f06e2acf2694db86e0a37de6f47c.tar.gz
bcm5719-llvm-4f7cac3674d5f06e2acf2694db86e0a37de6f47c.zip
[Sparc][LEON] LEON Erratum fix. Insert NOP after LD or LDF instruction.
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 llvm-svn: 270417
Diffstat (limited to 'llvm/lib/Target/Sparc/LeonPasses.h')
-rwxr-xr-xllvm/lib/Target/Sparc/LeonPasses.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/llvm/lib/Target/Sparc/LeonPasses.h b/llvm/lib/Target/Sparc/LeonPasses.h
new file mode 100755
index 00000000000..ea17b55bef3
--- /dev/null
+++ b/llvm/lib/Target/Sparc/LeonPasses.h
@@ -0,0 +1,46 @@
+//===------- 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
OpenPOWER on IntegriCloud