This is an archive of the discontinued LLVM Phabricator instance.

CallGraph: Fix IgnoreAssumeLikeCalls option to Function::hasAddressTaken
ClosedPublic

Authored by arsenm on Dec 2 2022, 4:59 PM.

Details

Summary

This was added in 29e2d9461a91b and likely never worked in a useful
way.

The test added for it fails when converted to opaque pointers, since
the lifetime intrinsic now directly uses the address. The code was
only trying to handle a user indirectly through a bitcast
instruction. That would never have been useful; a bitcast of a global
value would be folded to a ConstantExpr cast.

I also don't understand why it was special casing use_empty on the
cast. Relax the check to be either BitCastOperator or
AddrSpaceCastOperator. In practice, BitCastOperator won't appear
today.

I believe the change in parallel_deletion_cg_update is a correct
improvement but I didn't fully follow it. .omp_outlined..0 is used in
a constant expression cast to a call which ends up getting deleted.

Diff Detail

Event Timeline

arsenm created this revision.Dec 2 2022, 4:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2022, 4:59 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
arsenm requested review of this revision.Dec 2 2022, 4:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2022, 4:59 PM
Herald added subscribers: sstefan1, wdng. · View Herald Transcript
jdoerfert accepted this revision.Dec 3 2022, 9:20 AM

LG, makes sense to me

This revision is now accepted and ready to land.Dec 3 2022, 9:20 AM
madhur13490 accepted this revision.Dec 4 2022, 9:46 PM

Looks fine

rampitec accepted this revision.Dec 5 2022, 10:53 AM

LGTM. AFAIR user_empty() was guarding some failure with using iterator, which does not seem relevant anymore.