[X86] Use ArrayRef. NFC
authorCraig Topper <craig.topper@gmail.com>
Mon, 30 Nov 2015 02:08:05 +0000 (02:08 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 30 Nov 2015 02:08:05 +0000 (02:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254279 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrInfo.cpp

index aaeef465bf505c3181858abe4d1163340ed1e103..c90e84926e36c334a4be744716bb66847cf6119e 100644 (file)
@@ -3517,14 +3517,11 @@ unsigned X86InstrInfo::getFMA3OpcodeToCommuteOperands(MachineInstr *MI,
   bool IsIntrinOpcode;
   isFMA3(Opc, &IsIntrinOpcode);
 
-  unsigned GroupsNum;
-  const unsigned (*OpcodeGroups)[3];
+  ArrayRef<unsigned[3]> 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];