[PATCH] D22336: [SCCP] zap multiple return values

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 16:00:14 PDT 2016


davide added a comment.

Fixed a silly bug, added a test.


================
Comment at: lib/Transforms/Scalar/SCCP.cpp:1908
@@ +1907,3 @@
+           "The return type should be a struct");
+    if (StructType *STy = dyn_cast<StructType>(F->getReturnType())) {
+      for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
----------------
eli.friedman wrote:
> Given the isStructTy assert, can you just use cast<> here?
Done.

================
Comment at: lib/Transforms/Scalar/SCCP.cpp:1914
@@ +1913,3 @@
+        if (LV.isOverdefined())
+          continue;
+      }
----------------
eli.friedman wrote:
> If this actually passes make check, we need more tests.  (There are two loops here.)
Indeed.


https://reviews.llvm.org/D22336





More information about the llvm-commits mailing list