This adds a late Machine Pass to work around a Cortex CPU Erratum
affecting Cortex-A57 and Cortex-A72:
- Cortex-A57 Erratum 1742098
- Cortex-A72 Erratum 1655431
The pass inserts instructions to make the inputs to the fused AES
instruction pairs no longer trigger the erratum. Here the pass errs on
the side of caution, inserting the instructions wherever we cannot prove
that the inputs came from a safe instruction.
As the pass is executed very late in the ARM backend pipeline, it has to
reconstruct the Register Dataflow Graph, for which it uses the RDFGraph
utilities used by other backends.
This initial version will stop at the start of basic block containing
the first AES instruction, but having the full RDF Graph available means
we should be able to be more efficient with AES encryption and
decryption loops in future, if we wish.
The pass is used:
- for Cortex-A57 and Cortex-A72,
- for "generic" cores (which are used when using -march=),
- when the user specifies -mfix-cortex-a57-aes-1742098 or mfix-cortex-a72-aes-1655431 in the command-line arguments to clang.
clang-format suggested style edits found: