Avoid generating a convert_rndsat node when the src and dest type are the same.

llvm-svn: 60869
This commit is contained in:
Mon P Wang 2008-12-11 03:30:13 +00:00
parent 02fe71290a
commit bcdbfa854a
1 changed files with 4 additions and 0 deletions

View File

@ -1140,6 +1140,10 @@ SDValue SelectionDAG::getCondCode(ISD::CondCode Cond) {
SDValue SelectionDAG::getConvertRndSat(MVT VT, SDValue Val, SDValue DTy, SDValue SelectionDAG::getConvertRndSat(MVT VT, SDValue Val, SDValue DTy,
SDValue STy, SDValue Rnd, SDValue Sat, SDValue STy, SDValue Rnd, SDValue Sat,
ISD::CvtCode Code) { ISD::CvtCode Code) {
// If the src and dest types are the same, no conversion is necessary.
if (DTy == STy)
return Val;
FoldingSetNodeID ID; FoldingSetNodeID ID;
void* IP = 0; void* IP = 0;
if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))