[PATCH] D84220: [IPSCCP] Fix a bug that the "returned" attribute is not cleared when function is optimized to return undef

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 10:02:04 PDT 2020


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SCCP.cpp:37
 #include "llvm/Analysis/ValueLatticeUtils.h"
+#include "llvm/IR/AbstractCallSite.h"
 #include "llvm/IR/BasicBlock.h"
----------------
Is this include needed?


================
Comment at: llvm/lib/Transforms/Scalar/SCCP.cpp:2057
+	continue;
+      CallBase *CB = dyn_cast<CallBase>(U.getUser());
+      assert(CB && "Use of zapped functions should be valid direct calls!");
----------------
I think you can just use `cast<>` here, which has a similar assertion.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84220/new/

https://reviews.llvm.org/D84220



More information about the llvm-commits mailing list