[PATCH] D51085: [Sparc] Add errata workaround pass for GR712RC
Daniel Cederman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 22 00:02:19 PDT 2018
dcederman created this revision.
dcederman added reviewers: jyknight, venkatra.
Herald added subscribers: llvm-commits, jfb, jrtc27, fedor.sergeev.
This patch adds a pass that provides workarounds for the errata described in the technical notes GRLIB-TN-0009, GRLIB-TN-0011, GRLIB-TN-0012, and GRLIB-TN-0013, that are applicable to the GR712RC. The documents are available for download from here:
https://www.gaisler.com/index.php/information/app-tech-notes
The pass will detect certain sensitive instruction sequences and prevent them from occurring by inserting NOP instructions. Below is an overview of each of the workarounds. A similar implementation is available in GCC.
GRLIB-TN-0009:
- Insert NOPs to prevent the sequence (stb/sth/st/stf) -> (single non-store/load instruction) -> (any store)
- Insert NOPs to prevent the sequence (std/stdf) -> (any store)
GRLIB-TN-0011:
- Insert .p2align 4 before atomic instructions (swap and casa).
GRLIB-TN-0012:
- Place a NOP at the branch target of an integer branch if it is a floating-point operation or a floating-point branch.
GRLIB-TN-0013:
- Prevent (div/sqrt) instructions in the delay slot.
- Insert NOPs to prevent the sequence (div/sqrt) -> (two or three floating point operations or loads) -> (div/sqrt).
- Do not insert NOPs if any of the floating point operations have a dependency on the destination register of the first (div/sqrt).
- Do not insert NOPs if one of the floating point operations is a (div/sqrt).
- Insert NOPs to prevent (div/sqrt) followed by a branch.
Repository:
rL LLVM
https://reviews.llvm.org/D51085
Files:
lib/Target/Sparc/DelaySlotFiller.cpp
lib/Target/Sparc/LeonFeatures.td
lib/Target/Sparc/LeonPasses.cpp
lib/Target/Sparc/Sparc.h
lib/Target/Sparc/Sparc.td
lib/Target/Sparc/SparcAsmPrinter.cpp
lib/Target/Sparc/SparcSubtarget.cpp
lib/Target/Sparc/SparcSubtarget.h
lib/Target/Sparc/SparcTargetMachine.cpp
test/CodeGen/SPARC/tn0009.mir
test/CodeGen/SPARC/tn0011.ll
test/CodeGen/SPARC/tn0012.mir
test/CodeGen/SPARC/tn0013.mir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51085.161886.patch
Type: text/x-patch
Size: 17910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180822/6cf7e8c8/attachment.bin>
More information about the llvm-commits
mailing list