[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
Wed Aug 5 20:36:24 PDT 2020


jdoerfert added inline comments.


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


================
Comment at: llvm/lib/Transforms/Scalar/SCCP.cpp:2059
+        CB->removeParamAttr(CB->getArgOperandNo(&arg), Attribute::Returned);
+      }
+    }
----------------
Style: No braces, `Arg` and I would not use `auto` but that is probably OK.


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

https://reviews.llvm.org/D84220



More information about the llvm-commits mailing list