Provide a legal pointer register class when targeting thumb1.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 31 Mar 2011 23:02:15 +0000 (23:02 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 31 Mar 2011 23:02:15 +0000 (23:02 +0000)
The LocalStackSlotAllocation pass was creating illegal registers.

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

lib/Target/ARM/Thumb1RegisterInfo.cpp
lib/Target/ARM/Thumb1RegisterInfo.h
test/CodeGen/Thumb/2009-08-20-ISelBug.ll

index d1d7ec49e351e69442d2362a50b61de04ba7245b..0cdca113c264d76e6b99f8e35607046da0632729 100644 (file)
@@ -48,6 +48,11 @@ Thumb1RegisterInfo::Thumb1RegisterInfo(const ARMBaseInstrInfo &tii,
   : ARMBaseRegisterInfo(tii, sti) {
 }
 
+const TargetRegisterClass *
+Thumb1RegisterInfo::getPointerRegClass(unsigned Kind) const {
+  return ARM::tGPRRegisterClass;
+}
+
 /// emitLoadConstPool - Emits a load from constpool to materialize the
 /// specified immediate.
 void
index 96412bd0cb153a1429d9f1bac25b56abccdd03c0..b4fdd67b7fc94ec7250642212c5ed490f9866ff6 100644 (file)
@@ -28,6 +28,8 @@ struct Thumb1RegisterInfo : public ARMBaseRegisterInfo {
 public:
   Thumb1RegisterInfo(const ARMBaseInstrInfo &tii, const ARMSubtarget &STI);
 
+  const TargetRegisterClass *getPointerRegClass(unsigned Kind = 0) const;
+
   /// emitLoadConstPool - Emits a load from constpool to materialize the
   /// specified immediate.
  void emitLoadConstPool(MachineBasicBlock &MBB,
index 39612c00e4f6134e1565ffb01f69c0a64ff17e91..d6ca0d7933516e7fbd429a1ab384fee247391c1b 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=thumbv6-apple-darwin -relocation-model=pic -disable-fp-elim -mattr=+v6 | FileCheck %s
+; RUN: llc < %s -mtriple=thumbv6-apple-darwin -relocation-model=pic -disable-fp-elim -mattr=+v6 -verify-machineinstrs | FileCheck %s
 ; rdar://7157006
 
 %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }