<div dir="ltr">Hi all,<div>  I added support for the allocsize function attribute to our compiler (LDC), thinking that that would enable removal of function calls when the allocated memory is not used.</div><div><br></div><div>For example:</div><div><div>```</div><div>declare i8* @my_malloc(i32) allocsize(0)</div><div><br></div><div>define void @test_malloc() {<br></div><div>  %1 = call i8* @my_malloc(i32 100)</div><div>  ret void<br></div><div>}</div></div><div>```</div><div>I thought the my_alloc call in test_malloc would be removed, but `opt -O3` doesn't do that (LLVM 4.0 and trunk). However, LLVM3.9's `opt` _does_ remove the call.</div><div><br></div><div>I can't find out why this was changed.</div><div>(if the call is to "malloc", it is removed because LLVM recognizes the function name)</div><div><br></div><div>Thanks for the explanation,</div><div>Kind regards,</div><div>  Johan</div><div><br></div></div>