[DSE] Support opaque pointers
authorNikita Popov <nikita.ppv@gmail.com>
Sun, 27 Jun 2021 14:11:20 +0000 (16:11 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Sun, 27 Jun 2021 15:41:40 +0000 (17:41 +0200)
commitf00941e061f39646b05fcab93f892fc793845da1
tree6499a494fd825c8206aa633a988693d6adae47af
parent09ac97ce350316b95b8cddb796d52f71b6f68296
[DSE] Support opaque pointers

For the start shortening optimization, always use a i8 type for
the GEP, as it is a raw offset calculation.

Handling of non-i8* memset/memcpy arguments requires insertion
of casts. These cases were previously miscompiled, as the offset
calculation was performed on the wrong type.
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
llvm/test/Transforms/DeadStoreElimination/OverwriteStoreBegin.ll