llvm.org GIT mirror llvm / ae40630
[NFC][ARM] Refactor macro fusion Simplify code for wildcards. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344625 91177308-0d34-0410-b5e6-96231b3b80d8 Evandro Menezes 2 years ago
1 changed file(s) with 5 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
2222 static bool isAESPair(const MachineInstr *FirstMI,
2323 const MachineInstr &SecondMI) {
2424 // Assume the 1st instr to be a wildcard if it is unspecified.
25 unsigned FirstOpcode =
26 FirstMI ? FirstMI->getOpcode()
27 : static_cast(ARM::INSTRUCTION_LIST_END);
28 unsigned SecondOpcode = SecondMI.getOpcode();
29
30 switch(SecondOpcode) {
25 switch(SecondMI.getOpcode()) {
3126 // AES encode.
3227 case ARM::AESMC :
33 return FirstOpcode == ARM::AESE ||
34 FirstOpcode == ARM::INSTRUCTION_LIST_END;
28 return FirstMI == nullptr || FirstMI->getOpcode() == ARM::AESE;
3529 // AES decode.
3630 case ARM::AESIMC:
37 return FirstOpcode == ARM::AESD ||
38 FirstOpcode == ARM::INSTRUCTION_LIST_END;
31 return FirstMI == nullptr || FirstMI->getOpcode() == ARM::AESD;
3932 }
4033
4134 return false;
4538 static bool isLiteralsPair(const MachineInstr *FirstMI,
4639 const MachineInstr &SecondMI) {
4740 // Assume the 1st instr to be a wildcard if it is unspecified.
48 unsigned FirstOpcode =
49 FirstMI ? FirstMI->getOpcode()
50 : static_cast(ARM::INSTRUCTION_LIST_END);
51 unsigned SecondOpcode = SecondMI.getOpcode();
52
53 // 32 bit immediate.
54 if ((FirstOpcode == ARM::INSTRUCTION_LIST_END ||
55 FirstOpcode == ARM::MOVi16) &&
56 SecondOpcode == ARM::MOVTi16)
41 if ((FirstMI == nullptr || FirstMI->getOpcode() == ARM::MOVi16) &&
42 SecondMI.getOpcode() == ARM::MOVTi16)
5743 return true;
5844
5945 return false;