summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorMon P Wang <wangmp@apple.com>2009-02-05 04:47:42 +0000
committerMon P Wang <wangmp@apple.com>2009-02-05 04:47:42 +0000
commit3f0e0a6dea033fac0ab47a27342a30e20e62fa49 (patch)
tree36ca05d32a92a6b9b881628551b42b46532d35d8 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent8691c47e9e684697e3ad238b3a8704c748cf7a7d (diff)
downloadbcm5719-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/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp6
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;
OpenPOWER on IntegriCloud