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

Congzhe Cao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 18:07:27 PDT 2020


congzhe added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SCCP.cpp:2056
+      if (!CB)
+        continue;
+      for (auto &arg : CB->args()) {
----------------
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!");`


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

https://reviews.llvm.org/D84220



More information about the llvm-commits mailing list