[llvm] r254279 - [X86] Use ArrayRef. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 29 18:08:05 PST 2015


Author: ctopper
Date: Sun Nov 29 20:08:05 2015
New Revision: 254279

URL: http://llvm.org/viewvc/llvm-project?rev=254279&view=rev
Log:
[X86] Use ArrayRef. NFC

Modified:
    llvm/trunk/lib/Target/X86/X86InstrInfo.cpp

Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=254279&r1=254278&r2=254279&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Sun Nov 29 20:08:05 2015
@@ -3517,14 +3517,11 @@ unsigned X86InstrInfo::getFMA3OpcodeToCo
   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::getFMA3OpcodeToCo
 
   // 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];




More information about the llvm-commits mailing list