diff options
author | Mon P Wang <wangmp@apple.com> | 2009-02-05 04:47:42 +0000 |
---|---|---|
committer | Mon P Wang <wangmp@apple.com> | 2009-02-05 04:47:42 +0000 |
commit | b0e341bca13cc4c729ba577cfcc6257bb1da0b33 (patch) | |
tree | 4346b267bae73ed2cc2317cee7b86614195c8199 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | c1da8864a9a47329af6255567097f01d352eb311 (diff) |
Fix a bug where we were not emitting a cvt rnd sat node for converting
between a unsigned integer and signed integer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63831 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index dd00e97b9e..524f5fffb5 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1170,8 +1170,10 @@ SDValue SelectionDAG::getConvertRndSat(MVT VT, DebugLoc dl, 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; |