[PATCH] D39973: Fix CaptureTracking for llvm.invariant.group.barrier
Yaxun Liu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 13 14:34:31 PST 2017
yaxunl added inline comments.
================
Comment at: lib/Analysis/CaptureTracking.cpp:247
+ // Intrinsic function invariant_group_barrier does not capture pointer.
+ if (isa<IntrinsicInst>(I) && cast<IntrinsicInst>(I)->getIntrinsicID() ==
+ Intrinsic::invariant_group_barrier) {
----------------
rampitec wrote:
> rampitec wrote:
> > yaxunl wrote:
> > > rampitec wrote:
> > > > Can we mark it as "NoCapture<0>" instead?
> > > line 243 also checks I->getType()->isVoidTy(), but this intrinsic returns a pointer. So even if we make it NoCapture, it still does not work.
> > Checking for a specific intrinsic seems error-prone. What if the pointer returned by the call is further used in the caller?
> Maybe it is possible to add a check for VoidTy with the condition, that value is unused if returned from non-void?
Good idea. Will do.
https://reviews.llvm.org/D39973
More information about the llvm-commits
mailing list