[PATCH] D29996: [DeadStoreElimination] Check function modref behavior before considering memory clobbered
Philip Reames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 24 17:07:48 PST 2017
reames accepted this revision.
reames added a comment.
This revision is now accepted and ready to land.
The actual code change looks obviously correct.
LGTM once the AA change lands.
================
Comment at: test/Transforms/DeadStoreElimination/operand-bundles.ll:48
+define void @test4() {
+; CHECK-LABEL: @test4
+ %local_obj = call i8* @calloc(i64 1, i64 4)
----------------
sanjoy wrote:
> Looks like today `-basicaa -dse` does not elide the second store in
>
> ```
> declare void @foo()
> declare void @bar(i8*)
>
> define void @test4(i8* %ptr) {
> store i8 0, i8* %ptr, align 4
> call void @foo() readonly
> store i8 0, i8* %ptr, align 4
> call void @bar(i8* nocapture %ptr)
> ret void
> }
> ```
>
> Will it be able to do that with your changes? If so, adding that as a test case will be nice.
It doesn't look like we have the framework for this in DSE which is unfortunate. Oddly enough earlycse probably will get this example.
https://reviews.llvm.org/D29996
More information about the llvm-commits
mailing list