There is one more patch to finish large frames. Make sure we assert
authorReed Kotler <rkotler@mips.com>
Thu, 20 Dec 2012 06:57:00 +0000 (06:57 +0000)
committerReed Kotler <rkotler@mips.com>
Thu, 20 Dec 2012 06:57:00 +0000 (06:57 +0000)
on code that has large frames which will not yet compile correctly.

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

lib/Target/Mips/Mips16RegisterInfo.cpp
lib/Target/Mips/MipsInstrInfo.td

index ff0f5a0dfbc2c83e635e927d56f34b06c97b362c..3af62a17da2750b9769bd17706878cf7295e0db1 100644 (file)
@@ -146,6 +146,10 @@ void Mips16RegisterInfo::eliminateFI(MachineBasicBlock::iterator II,
 
   DEBUG(errs() << "Offset     : " << Offset << "\n" << "<--------->\n");
 
+  if (!MI.isDebugValue() && ( ((FrameReg != Mips::SP) && !isInt<16>(Offset)) ||
+      ((FrameReg == Mips::SP) && !isInt<15>(Offset)) )) {
+    assert(false && "frame offset does not fit in instruction");
+  }
   MI.getOperand(OpNo).ChangeToRegister(FrameReg, false);
   MI.getOperand(OpNo + 1).ChangeToImmediate(Offset);
 
index af9df4ba658dca298696bc6110b7d358b9d7c218..43a6b82a5715fce5849a088ba7c67419d7da6a1c 100644 (file)
@@ -298,6 +298,10 @@ def HI16 : SDNodeXForm<imm, [{
 // e.g. addi, andi
 def immSExt16  : PatLeaf<(imm), [{ return isInt<16>(N->getSExtValue()); }]>;
 
+// Node immediate fits as 15-bit sign extended on target immediate.
+// e.g. addi, andi
+def immSExt15  : PatLeaf<(imm), [{ return isInt<15>(N->getSExtValue()); }]>;
+
 // Node immediate fits as 16-bit zero extended on target immediate.
 // The LO16 param means that only the lower 16 bits of the node
 // immediate are caught.