Check for PRE_INC and POST_INC.
[oota-llvm.git] / lib / Target / ARM / ARMISelDAGToDAG.cpp
index fe4b4ed8a5610d60aa423df93213f80fd60d1eec..8023f45c1e9409ac9c61fa28c7488370f8afa448 100644 (file)
@@ -644,7 +644,7 @@ bool ARMDAGToDAGISel::SelectT2AddrModeImm8Offset(SDValue Op, SDValue N,
   if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N)) {
     int RHSC = (int)RHS->getZExtValue();
     if (RHSC >= 0 && RHSC < 0x100) { // 8 bits.
-      OffImm = (AM == ISD::PRE_INC)
+      OffImm = ((AM == ISD::PRE_INC) || (AM == ISD::POST_INC))
         ? CurDAG->getTargetConstant(RHSC, MVT::i32)
         : CurDAG->getTargetConstant(-RHSC, MVT::i32);
       return true;