[llvm-commits] [llvm] r63831 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Mon P Wang wangmp at apple.com
Wed Feb 4 20:47:43 PST 2009


Author: wangmp
Date: Wed Feb  4 22:47:42 2009
New Revision: 63831

URL: http://llvm.org/viewvc/llvm-project?rev=63831&view=rev
Log:
Fix a bug where we were not emitting a cvt rnd sat node for converting
between a unsigned integer and signed integer.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=63831&r1=63830&r2=63831&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Feb  4 22:47:42 2009
@@ -1170,8 +1170,10 @@
                                        SDValue Val, SDValue DTy,
                                        SDValue STy, SDValue Rnd, SDValue Sat,
                                        ISD::CvtCode Code) {
-  // If the src and dest types are the same, no conversion is necessary.
-  if (DTy == STy)
+  // If the src and dest types are the same and the conversion is between
+  // integer types of the same sign or two floats, no conversion is necessary.
+  if (DTy == STy &&
+      (Code == ISD::CVT_UU || Code == ISD::CVT_SS || Code == ISD::CVT_FF))
     return Val;
 
   FoldingSetNodeID ID;





More information about the llvm-commits mailing list