[CaptureTracking] Do not check domination
authorNikita Popov <nikita.ppv@gmail.com>
Sun, 16 May 2021 08:40:02 +0000 (10:40 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Sun, 16 May 2021 08:49:36 +0000 (10:49 +0200)
commit6b8b43e7af3074124e3c9e429e1fb08165799be4
tree7745dda1f8a949f73cd68648a3c95af4d755e6c5
parentaaf5fd4316917506160078139ac2d860d6096bb3
[CaptureTracking] Do not check domination

For the CapturesBefore tracker, it is sufficient to check that
I can not reach BeforeHere. This does not necessarily require
that BeforeHere dominates I, it can also occur if the capture
happens on an entirely disjoint path.

This change was previously accepted in D90688, but had to be
reverted due to large compile-time impact in some cases: It
increases the number of reachability queries that are performed.

After recent changes, the compile-time impact is largely mitigated,
so I'm reapplying this patch. The remaining compile-time impact
is largely proportional to changes in code-size.
llvm/lib/Analysis/CaptureTracking.cpp
llvm/test/Transforms/MemCpyOpt/callslot.ll