[AArch64] Add workaround for Cortex-A53 erratum (835769)
authorBradley Smith <bradley.smith@arm.com>
Mon, 13 Oct 2014 10:12:35 +0000 (10:12 +0000)
committerBradley Smith <bradley.smith@arm.com>
Mon, 13 Oct 2014 10:12:35 +0000 (10:12 +0000)
commit7e67a4b0cb4e871af34826717091de57f1299de9
treefde68f41393979734a6edc4202380cd952543beb
parenteba0a96f8e4bc9fcdda408634914e86970f1cc1c
[AArch64] Add workaround for Cortex-A53 erratum (835769)

Some early revisions of the Cortex-A53 have an erratum (835769) whereby it is
possible for a 64-bit multiply-accumulate instruction in AArch64 state to
generate an incorrect result.  The details are quite complex and hard to
determine statically, since branches in the code may exist in some
 circumstances, but all cases end with a memory (load, store, or prefetch)
instruction followed immediately by the multiply-accumulate operation.

The safest work-around for this issue is to make the compiler avoid emitting
multiply-accumulate instructions immediately after memory instructions and the
simplest way to do this is to insert a NOP.

This patch implements such work-around in the backend, enabled via the option
-aarch64-fix-cortex-a53-835769.

The work-around code generation is not enabled by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219603 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64.h
lib/Target/AArch64/AArch64A53Fix835769.cpp [new file with mode: 0644]
lib/Target/AArch64/AArch64TargetMachine.cpp
lib/Target/AArch64/CMakeLists.txt
test/CodeGen/AArch64/aarch64-fix-cortex-a53-835769.ll [new file with mode: 0644]