make the 'fp return in ST(0)' optimization smart enough to
authorChris Lattner <sabre@nondot.org>
Wed, 16 Jan 2008 05:53:06 +0000 (05:53 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 16 Jan 2008 05:53:06 +0000 (05:53 +0000)
look through token factor

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46053 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index be826533e15de256bccc40a11ca81e30eb17b046..eb8e5e3832063fbaba7c3eae77c1bed665a4472e 100644 (file)
@@ -767,7 +767,7 @@ SDOperand X86TargetLowering::LowerRET(SDOperand Op, SelectionDAG &DAG) {
       // If this is a load into a scalarsse value, don't store the loaded value
       // back to the stack, only to reload it: just replace the scalar-sse load.
       if (ISD::isNON_EXTLoad(Value.Val) &&
-          (Chain == Value.getValue(1) || Chain == Value.getOperand(0))) {
+          Chain.reachesChainWithoutSideEffects(Value.getOperand(0))) {
         Chain  = Value.getOperand(0);
         MemLoc = Value.getOperand(1);
       } else {