Lines Matching +full:work +full:- +full:around

1 //===-- AArch64A53Fix835769.cpp -------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
8 // This pass changes code to work around Cortex-A53 erratum 835769.
9 // It works around it by inserting a nop instruction in code sequences that
13 // instr 1: mem-instr (including loads, stores and prefetches).
14 // instr 2: non-SIMD integer multiply-accumulate writing 64-bit X registers.
15 //===----------------------------------------------------------------------===//
31 #define DEBUG_TYPE "aarch64-fix-cortex-a53-835769"
33 STATISTIC(NumNopsAdded, "Number of Nops added to work around erratum 835769");
35 //===----------------------------------------------------------------------===//
42 switch (MI->getOpcode()) { in isFirstInstructionInSequence()
50 return MI->mayLoadOrStore(); in isFirstInstructionInSequence()
57 // Must return true for non-SIMD integer multiply-accumulates, writing in isSecondInstructionInSequence()
58 // to a 64-bit register. in isSecondInstructionInSequence()
59 switch (MI->getOpcode()) { in isSecondInstructionInSequence()
68 // Erratum can only be triggered by multiply-adds, not by regular in isSecondInstructionInSequence()
69 // non-accumulating multiplies, i.e. when Ra=XZR='11111' in isSecondInstructionInSequence()
70 return MI->getOperand(3).getReg() != AArch64::XZR; in isSecondInstructionInSequence()
77 //===----------------------------------------------------------------------===//
112 INITIALIZE_PASS(AArch64A53Fix835769, "aarch64-fix-cortex-a53-835769-pass",
115 //===----------------------------------------------------------------------===//
142 if (MBBI == MBB->getParent()->begin()) in getBBFallenThrough()
149 for (MachineBasicBlock *S : MBB->predecessors()) in getBBFallenThrough()
150 if (S == PrevBB && !TII->analyzeBranch(*PrevBB, TBB, FBB, Cond) && !TBB && in getBBFallenThrough()
157 // Iterate through fallen through blocks trying to find a previous non-pseudo if
165 // If there is no non-pseudo in the current block, loop back around and try in getLastNonPseudo()
173 // There was no previous non-pseudo in the fallen through blocks in getLastNonPseudo()
184 DebugLoc DL = I->getDebugLoc(); in insertNopBeforeInstruction()
185 BuildMI(I->getParent(), DL, TII->get(AArch64::HINT)).addImm(0); in insertNopBeforeInstruction()
188 DebugLoc DL = MI->getDebugLoc(); in insertNopBeforeInstruction()
189 BuildMI(MBB, MI, DL, TII->get(AArch64::HINT)).addImm(0); in insertNopBeforeInstruction()
199 << " - scanning instructions...\n"); in runOnBasicBlock()
209 // Try and find the last non-pseudo instruction in any fallen through blocks, in runOnBasicBlock()
230 if (!CurrInstr->isPseudo()) in runOnBasicBlock()