[PATCH] D130155: [DeadStoreElimination] Handle null accessing

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 25 03:49:54 PDT 2022


nikic added reviewers: fhahn, asbirlea.
nikic added a comment.

I think both this change and D130153 <https://reviews.llvm.org/D130153> are fine in principle, but I am concerned about the larger issue this exposes. Code has been making (historically quite reasonable) assumptions about how certain intrinsics work, for example that debug intrinsics don't access memory. These assumptions are still correct, but LLVM doesn't know this anymore, because it thinks that debug intrinsics, or memset, etc can read the thread ID now (or in this case, it's one step further, in that we lose the information that memset can only write to its argument, because we don't track complex scenarios like "can only write argument memory, but read other memory").

I guess if the number of places that make assumptions are limited, it may be okay to add such workarounds, but it's rather unfortunate. I also suspect that this can manifest in less obvious ways, e.g. because debug invariance in some places may depend on debug intrinsics not accessing memory.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130155/new/

https://reviews.llvm.org/D130155



More information about the llvm-commits mailing list