[PATCH] D152241: [CaptureTracking] Do not capture compares of same object

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 7 01:18:30 PDT 2023


nikic requested changes to this revision.
nikic added a comment.
This revision now requires changes to proceed.

Using getUnderlyingObject() here is not quite right: The underlying object is a pure provenance notion, while icmp is a pure address comparison. What we need here is that the icmp can be expressed as `Base + Offset1 == Base + Offset2`. This is *nearly* what getUnderlyingObject() does in practice, but not quite.

In particular, getUnderlyingObject() can also look through ptrmask intrinsics. However, `ptrmask(P, M) == P` clearly leaks bits of the pointers.

I think you'll have to implement a separate utility here that only looks through GEP + casts, but not things like ptrmask.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152241



More information about the llvm-commits mailing list