[llvm] 569868f - [SCCP] Only track returns of functions with non-void ret ty (NFC).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 07:15:53 PDT 2020


Author: Florian Hahn
Date: 2020-07-16T15:15:19+01:00
New Revision: 569868f6b7f390bb6ceffb4fceb70ff0019c5bea

URL: https://github.com/llvm/llvm-project/commit/569868f6b7f390bb6ceffb4fceb70ff0019c5bea
DIFF: https://github.com/llvm/llvm-project/commit/569868f6b7f390bb6ceffb4fceb70ff0019c5bea.diff

LOG: [SCCP] Only track returns of functions with non-void ret ty (NFC).

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.

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/SCCP.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index 5ebd3b71fe78..2a5fcfc09268 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -233,7 +233,7 @@ class SCCPSolver : public InstVisitor<SCCPSolver> {
       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()));
   }
 


        


More information about the llvm-commits mailing list