]> granicus.if.org Git - llvm/commit
Restore original intent of memset instcombine test
authorDaniel Neilson <dneilson@azul.com>
Thu, 29 Jun 2017 14:21:28 +0000 (14:21 +0000)
committerDaniel Neilson <dneilson@azul.com>
Thu, 29 Jun 2017 14:21:28 +0000 (14:21 +0000)
commit6a7b0b9cd50ec5a6ef5d21bcdba4d52ecf19f246
treeb89126009586fa18b5cb0ba3cb303651d0838aba
parent2e8a8343803ba1985e1b31307893f9eaae009138
Restore original intent of memset instcombine test

Summary:
The original intent of test/Transforms/InstCombine/memset.ll was to test for lowering of llvm.memset into stores when the size of the memset is 1, 2, 4, or 8. Sometime between then and now the test has stopped testing for that, but remained passing due to testing for the absence of llvm.memset calls rather than the presence of store instructions. Right now this test ends up with an empty function body because the alloca is eliminated as safe-to-remove, which results in the llvm.memset calls's being eliminated due to their pointer args being undef; so it is not testing for conversion of llvm.memset into store instructions at all.

This change alters the test to verify that store instructions are created, and moves the target of the memset to an arg of the proc to avoid it being eliminated as unused.

Reviewers: anna, efriedma

Reviewed By: efriedma

Subscribers: efriedma, llvm-commits

Differential Revision: https://reviews.llvm.org/D34642

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306681 91177308-0d34-0410-b5e6-96231b3b80d8
test/Transforms/InstCombine/memset.ll