[llvm-branch-commits] [llvm-branch] r165750 - /llvm/branches/R600/lib/Target/AMDGPU/AMDGPUISelLowering.cpp

Tom Stellard thomas.stellard at amd.com
Thu Oct 11 14:28:23 PDT 2012


Author: tstellar
Date: Thu Oct 11 16:28:23 2012
New Revision: 165750

URL: http://llvm.org/viewvc/llvm-project?rev=165750&view=rev
Log:
AMDGPU: Fix lowering of UREM

We now use ISD::MergeValues for creating a UDIVREM Node with 2 results,
rather than SelectionDAG::ReplaceAllUsesWith(), which was not working
for the second result.

Fixes piglit test:
Program/Execute/Scalar arithmetic uint

Modified:
    llvm/branches/R600/lib/Target/AMDGPU/AMDGPUISelLowering.cpp

Modified: llvm/branches/R600/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/R600/lib/Target/AMDGPU/AMDGPUISelLowering.cpp?rev=165750&r1=165749&r2=165750&view=diff
==============================================================================
--- llvm/branches/R600/lib/Target/AMDGPU/AMDGPUISelLowering.cpp (original)
+++ llvm/branches/R600/lib/Target/AMDGPU/AMDGPUISelLowering.cpp Thu Oct 11 16:28:23 2012
@@ -275,11 +275,10 @@
   // Rem = (Remainder_GE_Zero == 0 ? Remainder_A_Den : Rem)
   Rem = DAG.getSelectCC(DL, Remainder_GE_Zero, DAG.getConstant(0, VT),
                             Remainder_A_Den, Rem, ISD::SETEQ);
-
-  DAG.ReplaceAllUsesWith(Op.getValue(0).getNode(), &Div);
-  DAG.ReplaceAllUsesWith(Op.getValue(1).getNode(), &Rem);
-
-  return Op;
+  SDValue Ops[2];
+  Ops[0] = Div;
+  Ops[1] = Rem;
+  return DAG.getMergeValues(Ops, 2, DL);
 }
 
 //===----------------------------------------------------------------------===//





More information about the llvm-branch-commits mailing list