[LLVMdev] Confusion with a Use of a getelementptr instruction being a Use of a select instruction instead

John Criswell criswell at illinois.edu
Thu Jul 7 10:06:33 PDT 2011

On 7/6/11 2:06 PM, Griffin Wright wrote:
> Hello,
> I'm doing some Def/Use analysis, and I'm hung up on one tricky spot.  
> The BB in question is attached.  Ignore the red.
> The issue is that '%13 = load...' instruction does not show up as a 
> Use for the '%scevgep25' definition, and I feel like it should.  
> Instead, it shows up as a Use for '%iftmp.55.0 = select...', though 
> Operand(0) for this '%13 = load' instruction [listed as a Use for 
> '%iftmp.55.0 = select...'] is reported as the %scevgep25 instruction, 
> which is correct.

I'm not understanding all of the details of the behavior you're 
describing, but I agree that the %13 load should be a use of %scevgep25 
and that the select is a use of %14 and %15.

How are you iterating over the uses of %scevgep25?  Are you removing or 
inserting instructions while iterating over the uses, thereby 
potentially invalidating the use_iterator?  Invalidating the 
use_iterator would be my first guess.

-- John T.

> Sorry if that was a bit convoluted.  Essentially, it seems that 
> 'getelementptr' instructions with their Use's instructions being 
> (direct or indirect)operands to 'select' instructions have their Uses 
> show up as Uses for the select only and not for the getelementptr 
> instruction.
> Does anyone have any idea why this might be happening?  All the other 
> def/use information I get seems correct.
> Thanks,
> Griffin
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110707/9e125c56/attachment.html>

More information about the llvm-dev mailing list