[PATCH] D26348: Allow convergent attribute for function arguments

Matias Goldberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 12 15:34:56 PST 2017


dark_sylinc added a comment.

Hi!

As I said I'm not an LLVM expert so if someone thinks I'm confusing IR with source level aspects then I won't get in the way.

> You just figured what this patch is about :)
> 
> The only thing the current patch is doing is exactly adding this knowledge to LLVM, you wrote
> 
>   float4 texture( cannot_diverge_branch sampler2D texSampler, float2 uv ); //Internally implemented by LLVM to map to a GPU instruction(s).
> 
> 
> This patch is proposing:
> 
>   float4 texture(convergent sampler2D texSampler, float2 uv ); //Internally implemented by LLVM to map to a GPU instruction(s).
> 
> 
> I don't think we really need to care about tagging variables right now, there might be some more optimizations possible, but that should be addressed separately.

Then we agree and we understand each other. What I was saying is to add even more information (information which may come from the source level annotations, or may be deducted automatically, or may depend on GPU arch) in order to perform aggressive optimizations, which you if believe it should be addressed separately, I won't object.

> As I mentioned previously, I believe it is very easy to fix, no need to change LLVM: marking the `texture` operation as having unknown side-effect should be enough.

I will pass this on to the radeonsi ticket.


https://reviews.llvm.org/D26348





More information about the llvm-commits mailing list