[llvm] [SROA] Unfold gep of index select (PR #80983)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 7 14:27:42 PST 2024


================
@@ -158,11 +158,20 @@ bb:
 
 define i32 @test_select_idx_memcpy(i1 %c, ptr %p) {
----------------
Artem-B wrote:

Before this patch the test did not change the IR. It's not clear to me what it was intended to demonstrate, as there are no additional comments. The `memcpy` in the test name suggests that it's something about memcpy, but what exactly is it? That we never split or remove it? If that's the case, we are breaking that intent now.

Now we're also using this specific test to demonstrate that SROA does transform `gep(ptr, select(const,const))` correctly, but it's not reflected in the test name.

If someone w/o the context of this patch were to read either the old copy of this test or the one in this patch, they would not have a clear (or even, correct) idea of the purpose of the test. We should make it obvious what are the key parts we're testing here. E.g. `this test verifies that select unfolding works correctly even if the alloca is splittable, but non-promotable`, with the test name reflecting that purpose.

https://github.com/llvm/llvm-project/pull/80983


More information about the llvm-commits mailing list