diff options
| author | Mon P Wang <wangmp@apple.com> | 2008-12-11 03:30:13 +0000 |
|---|---|---|
| committer | Mon P Wang <wangmp@apple.com> | 2008-12-11 03:30:13 +0000 |
| commit | bcdbfa854a91797f5b43ac8955aaeb44ba196aa4 (patch) | |
| tree | 5ad80e10750f5f775070cec9e317c8e4adaa6ded /llvm/lib | |
| parent | 02fe71290a197e751006c14fa9532bb22a1bd4cb (diff) | |
| download | bcm5719-llvm-bcdbfa854a91797f5b43ac8955aaeb44ba196aa4.tar.gz bcm5719-llvm-bcdbfa854a91797f5b43ac8955aaeb44ba196aa4.zip | |
Avoid generating a convert_rndsat node when the src and dest type are the same.
llvm-svn: 60869
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index bb3b42c383f..33eddae7f90 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1140,6 +1140,10 @@ SDValue SelectionDAG::getCondCode(ISD::CondCode Cond) { SDValue SelectionDAG::getConvertRndSat(MVT VT, 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) + return Val; + FoldingSetNodeID ID; void* IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) |

