[SCCP] Only track returns of functions with non-void ret ty (NFC).
authorFlorian Hahn <flo@fhahn.com>
Thu, 16 Jul 2020 11:08:54 +0000 (12:08 +0100)
committerFlorian Hahn <flo@fhahn.com>
Thu, 16 Jul 2020 14:15:19 +0000 (15:15 +0100)
There is no need to add functions with void return types to the set of
tracked return values. This does not change functionality, because we
such functions do not have return values and we never update or access
them.

llvm/lib/Transforms/Scalar/SCCP.cpp

index 5ebd3b7..2a5fcfc 100644 (file)
@@ -233,7 +233,7 @@ public:
       for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i)
         TrackedMultipleRetVals.insert(
             std::make_pair(std::make_pair(F, i), ValueLatticeElement()));
-    } else
+    } else if (!F->getReturnType()->isVoidTy())
       TrackedRetVals.insert(std::make_pair(F, ValueLatticeElement()));
   }