HomePhabricator

Enabling the copy-constant-to-alloca optimization in more instances

Authored by andrew.w.kaylor on Jul 27 2021, 10:09 AM.

Description

Enabling the copy-constant-to-alloca optimization in more instances

Patch by Mohammad Fawaz

This patch allows lifetime calls to be ignored (and later erased) if we
know that the copy-constant-to-alloca optimization is going to happen.
The case that is missed is when the global variable is in a different address
space than the alloca (as shown in the example added to the lit test.)

This used to work before https://github.com/llvm/llvm-project/commit/6da31fa4a61d68af21dfa1e144e726ed6d77903e

Differential Revision: https://reviews.llvm.org/D106573