Revert r254279 "[X86] Use ArrayRef. NFC". It seems to have upset an MSVC build bot.
[oota-llvm.git] / lib / Target / X86 / X86InstrInfo.cpp
index c90e84926e36c334a4be744716bb66847cf6119e..aaeef465bf505c3181858abe4d1163340ed1e103 100644 (file)
@@ -3517,11 +3517,14 @@ unsigned X86InstrInfo::getFMA3OpcodeToCommuteOperands(MachineInstr *MI,
   bool IsIntrinOpcode;
   isFMA3(Opc, &IsIntrinOpcode);
 
   bool IsIntrinOpcode;
   isFMA3(Opc, &IsIntrinOpcode);
 
-  ArrayRef<unsigned[3]> OpcodeGroups;
+  unsigned GroupsNum;
+  const unsigned (*OpcodeGroups)[3];
   if (IsIntrinOpcode) {
   if (IsIntrinOpcode) {
-    OpcodeGroups = makeArrayRef(IntrinOpcodeGroups);
+    GroupsNum = sizeof(IntrinOpcodeGroups) / sizeof(IntrinOpcodeGroups[0]);
+    OpcodeGroups = IntrinOpcodeGroups;
   } else {
   } else {
-    OpcodeGroups = makeArrayRef(RegularOpcodeGroups);
+    GroupsNum = sizeof(RegularOpcodeGroups) / sizeof(RegularOpcodeGroups[0]);
+    OpcodeGroups = RegularOpcodeGroups;
   }
 
   const unsigned *FoundOpcodesGroup = nullptr;
   }
 
   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;
 
   // 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];
     for (FormIndex = 0; FormIndex < FormsNum; FormIndex++) {
       if (OpcodeGroups[GroupIndex][FormIndex] == Opc) {
         FoundOpcodesGroup = OpcodeGroups[GroupIndex];