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 | 3f0e0a6dea033fac0ab47a27342a30e20e62fa49 (patch) | |
tree | 36ca05d32a92a6b9b881628551b42b46532d35d8 /llvm | |
parent | 8691c47e9e684697e3ad238b3a8704c748cf7a7d (diff) | |
download | bcm5719-llvm-3f0e0a6dea033fac0ab47a27342a30e20e62fa49.tar.gz bcm5719-llvm-3f0e0a6dea033fac0ab47a27342a30e20e62fa49.zip |
Fix a bug where we were not emitting a cvt rnd sat node for converting
between a unsigned integer and signed integer.
llvm-svn: 63831
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index dd00e97b9ef..524f5fffb5e 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/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; |