fix bug for useless malloc elimination in CodeGenPrepare
authorRuobing Han <hanruobing@gatech.edu>
Tue, 19 Jul 2022 21:39:14 +0000 (21:39 +0000)
committerRuobing Han <hanruobing@gatech.edu>
Wed, 20 Jul 2022 16:29:51 +0000 (16:29 +0000)
commit2b98b8e8fba1f7a7d11d099ecf2ebe1adc55b5aa
tree72ab2ae3ca32a4970e3dc2e231d6f43c19a7efa3
parent29a66ab7667786e2005637368de44f3751da1e23
fix bug for useless malloc elimination in CodeGenPrepare

Put AllocationFn check before I->willReturn can allow CodeGenPrepare to remove useless malloc instruction

Differential Revision: https://reviews.llvm.org/D130126
llvm/lib/Transforms/Utils/Local.cpp
llvm/test/Transforms/CodeGenPrepare/dead-allocation.ll [new file with mode: 0644]