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

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 19:21:38 PDT 2020


jdoerfert added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SCCP.cpp:2056
+      if (!CB)
+        continue;
+      for (auto &arg : CB->args()) {
----------------
congzhe wrote:
> jdoerfert wrote:
> > Funnily, if this branch would hit we have a problem. I mean, there is a use that could have an annotation like `returned` but we did make it UB now. Not that I think this branch should ever be taken anyway. I'd propose an assertion, @fhahn @efriedma WDYT ?
> Thank you, I guess I could replace the branch with something along the following line?
> ` assert(CB && "Use of zapped functions should be valid direct calls!");`
I think that would be better, yes.


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

https://reviews.llvm.org/D84220



More information about the llvm-commits mailing list