Revert r254279 "[X86] Use ArrayRef. NFC". It seems to have upset an MSVC build bot.
authorCraig Topper <craig.topper@gmail.com>
Mon, 30 Nov 2015 02:28:19 +0000 (02:28 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 30 Nov 2015 02:28:19 +0000 (02:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254280 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrInfo.cpp

index c90e849..aaeef46 100644 (file)
@@ -3517,11 +3517,14 @@ unsigned X86InstrInfo::getFMA3OpcodeToCommuteOperands(MachineInstr *MI,
   bool IsIntrinOpcode;
   isFMA3(Opc, &IsIntrinOpcode);
 
-  ArrayRef<unsigned[3]> OpcodeGroups;
+  unsigned GroupsNum;
+  const unsigned (*OpcodeGroups)[3];
   if (IsIntrinOpcode) {
-    OpcodeGroups = makeArrayRef(IntrinOpcodeGroups);
+    GroupsNum = sizeof(IntrinOpcodeGroups) / sizeof(IntrinOpcodeGroups[0]);
+    OpcodeGroups = IntrinOpcodeGroups;
   } else {
-    OpcodeGroups = makeArrayRef(RegularOpcodeGroups);
+    GroupsNum = sizeof(RegularOpcodeGroups) / sizeof(RegularOpcodeGroups[0]);
+    OpcodeGroups = RegularOpcodeGroups;
   }
 
   const unsigned *FoundOpcodesGroup = nullptr;
@@ -3529,7 +3532,7 @@ unsigned X86InstrInfo::getFMA3OpcodeToCommuteOperands(MachineInstr *MI,
 
   // Look for the input opcode in the corresponding opcodes table.
   unsigned GroupIndex = 0;
-  for (; GroupIndex < OpcodeGroups.size() && !FoundOpcodesGroup; GroupIndex++) {
+  for (; GroupIndex < GroupsNum && !FoundOpcodesGroup; GroupIndex++) {
     for (FormIndex = 0; FormIndex < FormsNum; FormIndex++) {
       if (OpcodeGroups[GroupIndex][FormIndex] == Opc) {
         FoundOpcodesGroup = OpcodeGroups[GroupIndex];