[llvm-commits] [llvm] r60869 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Mon P Wang
wangmp at apple.com
Wed Dec 10 19:30:15 PST 2008
Author: wangmp
Date: Wed Dec 10 21:30:13 2008
New Revision: 60869
URL: http://llvm.org/viewvc/llvm-project?rev=60869&view=rev
Log:
Avoid generating a convert_rndsat node when the src and dest type are the same.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=60869&r1=60868&r2=60869&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Dec 10 21:30:13 2008
@@ -1140,6 +1140,10 @@
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))
More information about the llvm-commits
mailing list