[PATCH] D16774: AMDGPU: Stop pointlessly looking at users after a bad one is found

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 1 13:13:31 PST 2016


On 02/01/2016 12:48 PM, David Blaikie wrote:
>
>>
>>
>>     Why not just drop the Success variable entirely and return from here:
>>
>>     if (!collectUsesWithPtrTypes(...))
>>       return false
>     Return here is what I tried first, but this breaks some cases due
>     to the !isPointerTy check above. Call users without pointer types
>     would then fall through and incorrectly be changed.
>
>
> Sorry, couldn't really follow... the original code would return false 
> if collectUsesWithPtrTypes ever returns false, right? Were there side 
> effects that were desired after that point?

collectUsesWithPtrTypes should only be called with a pointer type value. 
Assuming there is an intrinsic call that uses a pointer and returns an 
integer for example, the User->getType()->isPointerTy() check will cause 
the call user to not be added to the worklist, because we do not want to 
have non-pointers in the worklist. I should probably just add another 
pointer check under the call handling so it stops falling through to here.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160201/cd5d138f/attachment.html>


More information about the llvm-commits mailing list