[llvm-branch-commits] [llvm-branch] r89697 - in /llvm/branches/Apple/Zoidberg: lib/Analysis/IVUsers.cpp lib/Target/ARM/ARMInstrInfo.td lib/Target/ARM/ARMInstrThumb2.td test/CodeGen/Thumb2/thumb2-select_xform.ll utils/buildit/build_llvm

Jim Grosbach grosbach at apple.com
Mon Nov 23 12:41:26 PST 2009


Author: grosbach
Date: Mon Nov 23 14:41:26 2009
New Revision: 89697

URL: http://llvm.org/viewvc/llvm-project?rev=89697&view=rev
Log:
merge 89694 89695

Modified:
    llvm/branches/Apple/Zoidberg/lib/Analysis/IVUsers.cpp
    llvm/branches/Apple/Zoidberg/lib/Target/ARM/ARMInstrInfo.td
    llvm/branches/Apple/Zoidberg/lib/Target/ARM/ARMInstrThumb2.td
    llvm/branches/Apple/Zoidberg/test/CodeGen/Thumb2/thumb2-select_xform.ll
    llvm/branches/Apple/Zoidberg/utils/buildit/build_llvm

Modified: llvm/branches/Apple/Zoidberg/lib/Analysis/IVUsers.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/Analysis/IVUsers.cpp?rev=89697&r1=89696&r2=89697&view=diff

==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/Analysis/IVUsers.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/Analysis/IVUsers.cpp Mon Nov 23 14:41:26 2009
@@ -33,7 +33,7 @@
 X("iv-users", "Induction Variable Users", false, true);
 
 static cl::opt<bool>
-SimplifyIVUsers("simplify-iv-users", cl::Hidden, cl::init(false),
+SimplifyIVUsers("simplify-iv-users", cl::Hidden, cl::init(true),
           cl::desc("Restrict IV Users to loop-invariant strides"));
 
 Pass *llvm::createIVUsersPass() {

Modified: llvm/branches/Apple/Zoidberg/lib/Target/ARM/ARMInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/Target/ARM/ARMInstrInfo.td?rev=89697&r1=89696&r2=89697&view=diff

==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/Target/ARM/ARMInstrInfo.td (original)
+++ llvm/branches/Apple/Zoidberg/lib/Target/ARM/ARMInstrInfo.td Mon Nov 23 14:41:26 2009
@@ -284,6 +284,22 @@
   return CurDAG->getTargetConstant(V, MVT::i32);
 }]>;
 
+def so_neg_imm2part : Operand<i32>, PatLeaf<(imm), [{
+      return ARM_AM::isSOImmTwoPartVal(-(int)N->getZExtValue());
+    }]> {
+  let PrintMethod = "printSOImm2PartOperand";
+}
+
+def so_neg_imm2part_1 : SDNodeXForm<imm, [{
+  unsigned V = ARM_AM::getSOImmTwoPartFirst(-(int)N->getZExtValue());
+  return CurDAG->getTargetConstant(V, MVT::i32);
+}]>;
+
+def so_neg_imm2part_2 : SDNodeXForm<imm, [{
+  unsigned V = ARM_AM::getSOImmTwoPartSecond(-(int)N->getZExtValue());
+  return CurDAG->getTargetConstant(V, MVT::i32);
+}]>;
+
 /// imm0_31 predicate - True if the 32-bit immediate is in the range [0,31].
 def imm0_31 : Operand<i32>, PatLeaf<(imm), [{
   return (int32_t)N->getZExtValue() < 32;
@@ -1618,9 +1634,9 @@
 def : ARMPat<(add GPR:$LHS, so_imm2part:$RHS),
              (ADDri (ADDri GPR:$LHS, (so_imm2part_1 imm:$RHS)),
                     (so_imm2part_2 imm:$RHS))>;
-def : ARMPat<(sub GPR:$LHS, so_imm2part:$RHS),
-             (SUBri (SUBri GPR:$LHS, (so_imm2part_1 imm:$RHS)),
-                    (so_imm2part_2 imm:$RHS))>;
+def : ARMPat<(add GPR:$LHS, so_neg_imm2part:$RHS),
+             (SUBri (SUBri GPR:$LHS, (so_neg_imm2part_1 imm:$RHS)),
+                    (so_neg_imm2part_2 imm:$RHS))>;
 
 // 32-bit immediate using movw + movt.
 // This is a single pseudo instruction, the benefit is that it can be remat'd

Modified: llvm/branches/Apple/Zoidberg/lib/Target/ARM/ARMInstrThumb2.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/Target/ARM/ARMInstrThumb2.td?rev=89697&r1=89696&r2=89697&view=diff

==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/Target/ARM/ARMInstrThumb2.td (original)
+++ llvm/branches/Apple/Zoidberg/lib/Target/ARM/ARMInstrThumb2.td Mon Nov 23 14:41:26 2009
@@ -88,6 +88,21 @@
   return CurDAG->getTargetConstant(V, MVT::i32);
 }]>;
 
+def t2_so_neg_imm2part : Operand<i32>, PatLeaf<(imm), [{
+      return ARM_AM::isT2SOImmTwoPartVal(-(int)N->getZExtValue());
+    }]> {
+}
+
+def t2_so_neg_imm2part_1 : SDNodeXForm<imm, [{
+  unsigned V = ARM_AM::getT2SOImmTwoPartFirst(-(int)N->getZExtValue());
+  return CurDAG->getTargetConstant(V, MVT::i32);
+}]>;
+
+def t2_so_neg_imm2part_2 : SDNodeXForm<imm, [{
+  unsigned V = ARM_AM::getT2SOImmTwoPartSecond(-(int)N->getZExtValue());
+  return CurDAG->getTargetConstant(V, MVT::i32);
+}]>;
+
 /// imm1_31 predicate - True if the 32-bit immediate is in the range [1,31].
 def imm1_31 : PatLeaf<(i32 imm), [{
   return (int32_t)N->getZExtValue() >= 1 && (int32_t)N->getZExtValue() < 32;
@@ -1162,9 +1177,9 @@
 def : T2Pat<(add GPR:$LHS, t2_so_imm2part:$RHS),
              (t2ADDri (t2ADDri GPR:$LHS, (t2_so_imm2part_1 imm:$RHS)),
                     (t2_so_imm2part_2 imm:$RHS))>;
-def : T2Pat<(sub GPR:$LHS, t2_so_imm2part:$RHS),
-             (t2SUBri (t2SUBri GPR:$LHS, (t2_so_imm2part_1 imm:$RHS)),
-                    (t2_so_imm2part_2 imm:$RHS))>;
+def : T2Pat<(add GPR:$LHS, t2_so_neg_imm2part:$RHS),
+             (t2SUBri (t2SUBri GPR:$LHS, (t2_so_neg_imm2part_1 imm:$RHS)),
+                    (t2_so_neg_imm2part_2 imm:$RHS))>;
 
 // ConstantPool, GlobalAddress, and JumpTable
 def : T2Pat<(ARMWrapper  tglobaladdr :$dst), (t2LEApcrel tglobaladdr :$dst)>;

Modified: llvm/branches/Apple/Zoidberg/test/CodeGen/Thumb2/thumb2-select_xform.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/test/CodeGen/Thumb2/thumb2-select_xform.ll?rev=89697&r1=89696&r2=89697&view=diff

==============================================================================
--- llvm/branches/Apple/Zoidberg/test/CodeGen/Thumb2/thumb2-select_xform.ll (original)
+++ llvm/branches/Apple/Zoidberg/test/CodeGen/Thumb2/thumb2-select_xform.ll Mon Nov 23 14:41:26 2009
@@ -2,9 +2,9 @@
 
 define i32 @t1(i32 %a, i32 %b, i32 %c) nounwind {
 ; CHECK: t1
-; CHECK: mvn  r0, #-2147483648
+; CHECK: sub.w r0, r1, #-2147483648
 ; CHECK: cmp r2, #10
-; CHECK: add.w r0, r1, r0
+; CHECK: sub.w r0, r0, #1
 ; CHECK: it  gt
 ; CHECK: movgt r0, r1
         %tmp1 = icmp sgt i32 %c, 10

Modified: llvm/branches/Apple/Zoidberg/utils/buildit/build_llvm
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/utils/buildit/build_llvm?rev=89697&r1=89696&r2=89697&view=diff

==============================================================================
--- llvm/branches/Apple/Zoidberg/utils/buildit/build_llvm (original)
+++ llvm/branches/Apple/Zoidberg/utils/buildit/build_llvm Mon Nov 23 14:41:26 2009
@@ -203,7 +203,7 @@
         SYSCTL=2
     fi
 
-    JOBS_FLAG="-j $SYSCTL"
+    JOBS_FLAG="-j 2"
 fi
 
 make $JOBS_FLAG $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$TARGETS" \





More information about the llvm-branch-commits mailing list