Introduction of Heterogeneous memory posses new problems of optimizing memory placements to ensure performance benefits from different memories. The complex memory structure and multiple library interfaces puts this additional and difficult workload on the programmer. To help the applications take optimal benefit of the new memory hierarchies we propose to automate dynamic memory allocation in the compiler by using static analysis at the AST-level and IR level using the LLVM/Clang compiler framework. We also take a look at the current related work that exists in the field.