Use the correct register class for load instructions - fixes
authorEric Christopher <echristo@apple.com>
Thu, 7 Oct 2010 05:50:44 +0000 (05:50 +0000)
committerEric Christopher <echristo@apple.com>
Thu, 7 Oct 2010 05:50:44 +0000 (05:50 +0000)
compilation of MultiSource/Benchmarks/Bullet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115907 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMFastISel.cpp

index 9e8e1df0f156508a24a144c588b9f66dfead30a2..497259c40719133a48f650ba671c0e9b466eab0e 100644 (file)
@@ -652,33 +652,40 @@ bool ARMFastISel::ARMEmitLoad(EVT VT, unsigned &ResultReg,
 
   assert(VT.isSimple() && "Non-simple types are invalid here!");
   unsigned Opc;
+  TargetRegisterClass *RC;
   bool isFloat = false;
   switch (VT.getSimpleVT().SimpleTy) {
     default:
       // This is mostly going to be Neon/vector support.
       return false;
+    // Using thumb1 instructions for now, use the appropriate RC.
     case MVT::i16:
       Opc = isThumb ? ARM::tLDRH : ARM::LDRH;
+      RC = isThumb ? ARM::tGPRRegisterClass : ARM::GPRRegisterClass;
       VT = MVT::i32;
       break;
     case MVT::i8:
       Opc = isThumb ? ARM::tLDRB : ARM::LDRB;
+      RC = isThumb ? ARM::tGPRRegisterClass : ARM::GPRRegisterClass;
       VT = MVT::i32;
       break;
     case MVT::i32:
       Opc = isThumb ? ARM::tLDR : ARM::LDR;
+      RC = isThumb ? ARM::tGPRRegisterClass : ARM::GPRRegisterClass;
       break;
     case MVT::f32:
       Opc = ARM::VLDRS;
+      RC = TLI.getRegClassFor(VT);
       isFloat = true;
       break;
     case MVT::f64:
       Opc = ARM::VLDRD;
+      RC = TLI.getRegClassFor(VT);
       isFloat = true;
       break;
   }
 
-  ResultReg = createResultReg(TLI.getRegClassFor(VT));
+  ResultReg = createResultReg(RC);
 
   // TODO: Fix the Addressing modes so that these can share some code.
   // Since this is a Thumb1 load this will work in Thumb1 or 2 mode.