[llvm] [CaptureTracking] Do not capture compares of same object (PR #74228)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 4 07:00:36 PST 2024


nikic wrote:

> This patch is incompatible with [this code block](https://github.com/llvm/llvm-project/blob/6561efe142ae2a5d434ff646319b0bfb1dd39dee/llvm/lib/Analysis/InstructionSimplify.cpp#L2794-L2835), which simplifies non-capturing pointer comparisons to false.

Yes, this fold is known to be buggy. The right way to do it would be to extend https://github.com/llvm/llvm-project/blob/79e62315be5b762f399e98c0b638e682eac66322/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp#L833 to handle allocator calls. Pretty sure I had a patch for this ... somewhere on phabricator.

https://github.com/llvm/llvm-project/pull/74228


More information about the llvm-commits mailing list