[PATCH] D46750: [SROA] pr37267: fix assertion failure while integer widening

Hiroshi Inoue via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 15 00:28:16 PDT 2018


inouehrs added inline comments.


================
Comment at: lib/Transforms/Scalar/SROA.cpp:1994
+    // We can't handle split slice tails.
+    if (RelBegin < 0)
+      return false;
----------------
efriedma wrote:
> Why does this check belong here, as opposed to the beginning of the function or somewhere in isIntegerWideningViable()?
`visitMemTransferInst` seems to be able to handle split tails of memcpy (e.g. when replacing a store to slice 1 in the test case with memcpy). So I do not want to reduce the opportunities by checking this at the beginning of `isIntegerWideningViableForSlice`.


================
Comment at: test/Transforms/SROA/pr37267.ll:6
+; PR37267
+; Check that we don't crash on this test.
+
----------------
efriedma wrote:
> Please add FileCheck lines to show how we split the alloca. A test like this doesn't really make it clear what you're expecting to happen instead of crashing.
I modified test case with FileCheck lines. Also I add comments to make the behavior clearer.


https://reviews.llvm.org/D46750





More information about the llvm-commits mailing list