[llvm-branch-commits] [llvm-branch] r235874 - Merging r230742:

Daniel Sanders daniel.sanders at imgtec.com
Mon Apr 27 05:56:05 PDT 2015


Author: dsanders
Date: Mon Apr 27 07:56:05 2015
New Revision: 235874

URL: http://llvm.org/viewvc/llvm-project?rev=235874&view=rev
Log:
Merging r230742:
------------------------------------------------------------------------
r230742 | vkalintiris | 2015-02-27 09:01:39 +0000 (Fri, 27 Feb 2015) | 12 lines

[mips] Account for constant-zero operands in ADDE nodes.

Summary:
We identify the cases where the operand to an ADDE node is a constant
zero. In such cases, we can avoid generating an extra ADDu instruction
disguised as an identity move alias (ie. addu $r, $r, 0 --> move $r, $r).

Reviewers: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D7906
------------------------------------------------------------------------

Added:
    llvm/branches/release_36/test/CodeGen/Mips/check-adde-redundant-moves.ll
      - copied, changed from r230742, llvm/trunk/test/CodeGen/Mips/check-adde-redundant-moves.ll
Modified:
    llvm/branches/release_36/   (props changed)
    llvm/branches/release_36/lib/Target/Mips/MipsSEISelDAGToDAG.cpp

Propchange: llvm/branches/release_36/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 27 07:56:05 2015
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,226023,226029,226044,226046,226048,226058,226075,226151,226164-226166,226170-226171,226182,226407-226409,226473,226588,226616,226652,226664,226708,226711,226755,226791,226808-226809,226905,227005,227084-227085,227087,227089,227250,227260-227261,227269,227290,227294,227299,227319,227339,227430,227491,227584,227603,227628,227670,227809,227815,227903,227934,227972,227983,228049,228129,228168,228331,228411,228444,228490,228500,228507,228518,228525,228565,228656,228760-228761,228793,228842,228899,228957,228969,228979,229029,229343,229351-229352,229421,229495,229529,229675,229731,229911,230058,230235,230657,231219,231227,231563,231601,232046,232085,232189
+/llvm/trunk:155241,226023,226029,226044,226046,226048,226058,226075,226151,226164-226166,226170-226171,226182,226407-226409,226473,226588,226616,226652,226664,226708,226711,226755,226791,226808-226809,226905,227005,227084-227085,227087,227089,227250,227260-227261,227269,227290,227294,227299,227319,227339,227430,227491,227584,227603,227628,227670,227809,227815,227903,227934,227972,227983,228049,228129,228168,228331,228411,228444,228490,228500,228507,228518,228525,228565,228656,228760-228761,228793,228842,228899,228957,228969,228979,229029,229343,229351-229352,229421,229495,229529,229675,229731,229911,230058,230235,230657,230742,231219,231227,231563,231601,232046,232085,232189

Modified: llvm/branches/release_36/lib/Target/Mips/MipsSEISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_36/lib/Target/Mips/MipsSEISelDAGToDAG.cpp?rev=235874&r1=235873&r2=235874&view=diff
==============================================================================
--- llvm/branches/release_36/lib/Target/Mips/MipsSEISelDAGToDAG.cpp (original)
+++ llvm/branches/release_36/lib/Target/Mips/MipsSEISelDAGToDAG.cpp Mon Apr 27 07:56:05 2015
@@ -258,8 +258,12 @@ SDNode *MipsSEDAGToDAGISel::selectAddESu
                                    CurDAG->getTargetConstant(Mips::sub_32, VT));
   }
 
-  SDNode *AddCarry = CurDAG->getMachineNode(ADDuOp, DL, VT,
-                                            SDValue(Carry, 0), RHS);
+  // Generate a second addition only if we know that RHS is not a
+  // constant-zero node.
+  SDNode *AddCarry = Carry;
+  ConstantSDNode *C = dyn_cast<ConstantSDNode>(RHS);
+  if (!C || C->getZExtValue())
+    AddCarry = CurDAG->getMachineNode(ADDuOp, DL, VT, SDValue(Carry, 0), RHS);
 
   return CurDAG->SelectNodeTo(Node, MOp, VT, MVT::Glue, LHS,
                               SDValue(AddCarry, 0));

Copied: llvm/branches/release_36/test/CodeGen/Mips/check-adde-redundant-moves.ll (from r230742, llvm/trunk/test/CodeGen/Mips/check-adde-redundant-moves.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_36/test/CodeGen/Mips/check-adde-redundant-moves.ll?p2=llvm/branches/release_36/test/CodeGen/Mips/check-adde-redundant-moves.ll&p1=llvm/trunk/test/CodeGen/Mips/check-adde-redundant-moves.ll&r1=230742&r2=235874&rev=235874&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/check-adde-redundant-moves.ll (original)
+++ llvm/branches/release_36/test/CodeGen/Mips/check-adde-redundant-moves.ll Mon Apr 27 07:56:05 2015
@@ -4,18 +4,12 @@
 ; RUN:    -check-prefix=ALL -check-prefix=GP32
 ; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
 ; RUN:    -check-prefix=ALL -check-prefix=GP32
-; RUN: llc < %s -march=mips -mcpu=mips32r3 | FileCheck %s \
-; RUN:    -check-prefix=ALL -check-prefix=GP32
-; RUN: llc < %s -march=mips -mcpu=mips32r5 | FileCheck %s \
-; RUN:    -check-prefix=ALL -check-prefix=GP32
 ; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
 ; RUN:    -check-prefix=ALL -check-prefix=GP32
 ; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s -check-prefix=ALL
 ; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s -check-prefix=ALL
 ; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s -check-prefix=ALL
 ; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s -check-prefix=ALL
-; RUN: llc < %s -march=mips64 -mcpu=mips64r3 | FileCheck %s -check-prefix=ALL
-; RUN: llc < %s -march=mips64 -mcpu=mips64r5 | FileCheck %s -check-prefix=ALL
 ; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s -check-prefix=ALL
 
 define i64 @add_i64(i64 %a) {





More information about the llvm-branch-commits mailing list