[PATCH] D100141: [nofree] Restrict semantics to memory visible to caller
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 19 08:02:53 PDT 2021
jdoerfert added a comment.
In D100141#2697374 <https://reviews.llvm.org/D100141#2697374>, @nlopes wrote:
> I've updated Alive2 with the new semantics and I see one regression:
> `llvm/test/Transforms/InstCombine/malloc-free-delete.ll`
>
> define void @test14(* %foo) nofree {
> free * %foo
> ret void
> }
> =>
> define void @test14(* %foo) nofree {
> call void #trap() nowrite noreturn
> assume i1 0
> }
>
> Transformation doesn't verify!
>
> ERROR: Source is more defined than target
>
> Example:
> * %foo = null
>
> free(null) is a no-op, so I think the test case is buggy. This transformation can only be done if the argument is non-null.
Right, the transformation should be `llvm.assume(%foo == null)`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100141/new/
https://reviews.llvm.org/D100141
More information about the llvm-commits
mailing list