[all-commits] [llvm/llvm-project] fed817: [DSE] Consider the aliasing through global variabl...

Haopeng Liu via All-commits all-commits at lists.llvm.org
Tue Jan 14 10:05:05 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fed817a8b25e178cd701fefcdfe80c447d2ab212
      https://github.com/llvm/llvm-project/commit/fed817a8b25e178cd701fefcdfe80c447d2ab212
  Author: Haopeng Liu <153236845+haopliu at users.noreply.github.com>
  Date:   2025-01-14 (Tue, 14 Jan 2025)

  Changed paths:
    M llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
    M llvm/test/Transforms/DeadStoreElimination/inter-procedural.ll

  Log Message:
  -----------
  [DSE] Consider the aliasing through global variable while checking clobber (#120044)

While update the read clobber check for the "initializes" attr, we
checked the aliasing among arguments, but didn't consider the aliasing
through global variable. It causes problems in this example:

```
int g_var = 123;

void update(int* ptr) {
  *ptr = g_var;

void foo() {
  g_var = 0;
  bar(&g_var);
}
```
We mistakenly removed `g_var = 0;` as a dead store.

Fix the issue by requiring the CallBase only access argmem or
inaccessiblemem.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list