From ebbca899acaf2fbe37b1ea7d8941fa495ef85d83 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 30 Nov 2015 02:08:05 +0000 Subject: [PATCH] [X86] Use ArrayRef. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254279 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86InstrInfo.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp index aaeef465bf5..c90e84926e3 100644 --- a/lib/Target/X86/X86InstrInfo.cpp +++ b/lib/Target/X86/X86InstrInfo.cpp @@ -3517,14 +3517,11 @@ unsigned X86InstrInfo::getFMA3OpcodeToCommuteOperands(MachineInstr *MI, bool IsIntrinOpcode; isFMA3(Opc, &IsIntrinOpcode); - unsigned GroupsNum; - const unsigned (*OpcodeGroups)[3]; + ArrayRef OpcodeGroups; if (IsIntrinOpcode) { - GroupsNum = sizeof(IntrinOpcodeGroups) / sizeof(IntrinOpcodeGroups[0]); - OpcodeGroups = IntrinOpcodeGroups; + OpcodeGroups = makeArrayRef(IntrinOpcodeGroups); } else { - GroupsNum = sizeof(RegularOpcodeGroups) / sizeof(RegularOpcodeGroups[0]); - OpcodeGroups = RegularOpcodeGroups; + OpcodeGroups = makeArrayRef(RegularOpcodeGroups); } const unsigned *FoundOpcodesGroup = nullptr; @@ -3532,7 +3529,7 @@ unsigned X86InstrInfo::getFMA3OpcodeToCommuteOperands(MachineInstr *MI, // Look for the input opcode in the corresponding opcodes table. unsigned GroupIndex = 0; - for (; GroupIndex < GroupsNum && !FoundOpcodesGroup; GroupIndex++) { + for (; GroupIndex < OpcodeGroups.size() && !FoundOpcodesGroup; GroupIndex++) { for (FormIndex = 0; FormIndex < FormsNum; FormIndex++) { if (OpcodeGroups[GroupIndex][FormIndex] == Opc) { FoundOpcodesGroup = OpcodeGroups[GroupIndex]; -- 2.34.1