[PATCH] D19730: [BasicAA] Treat llvm.assume as not accessing memory in getModRefBehavior(Function)

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 12:47:50 PDT 2016


----- Original Message -----
> From: "Sanjoy Das" <sanjoy at playingwithpointers.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "Daniel Berlin" <dberlin at dberlin.org>, "Geoff Berry" <gberry at codeaurora.org>, "Chandler Carruth"
> <chandlerc at gmail.com>, "Philip Reames" <listmail at philipreames.com>, mcrosier at codeaurora.org, "llvm-commits"
> <llvm-commits at lists.llvm.org>, "Junbum Lim" <junbuml at codeaurora.org>,
> reviews+D19730+public+66d50dddcf8372b8 at reviews.llvm.org
> Sent: Friday, April 29, 2016 2:39:01 PM
> Subject: Re: [PATCH] D19730: [BasicAA] Treat llvm.assume as not accessing memory in getModRefBehavior(Function)
> 
> 
> 
> Hal Finkel wrote:
> > I understand. However, without our current system, this still
> > obviously
> > needs to be correct. What is to prevent a pass from (correctly)
> > seeing
> > the call to assume, using AA to conclude it does not actually alter
> > memory, seeing it has no return values, intrinsics don't throw, and
> > so
> 
> Intrinsics are allowed to throw -- statepoints, patchpoints, guard
> intrinsics and the deoptimize intrinsic are all defined to be
> throwing.
>   If all of LLVM respects the "can unwind" property, then we should
>   be
> able to mark assume as "readnone" and be done with it.  I'm just not
> sure that there aren't places in LLVM that assume (no pun intended!)
> readnone functions are inherently nounwind.

Yes, but assume is marked as nounwind. We can't change this because doing so would pessimize many of the optimizations the assumptions are indented to assist.

 -Hal

> 
> -- Sanjoy
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory


More information about the llvm-commits mailing list