[llvm-dev] Can a Constant have more than one use?

John Criswell via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 9 11:38:08 PDT 2017


On 8/9/17 1:23 PM, Siddharth Bhat via llvm-dev wrote:
> As the question asks. IIRC, I have only seen constants use to:
>
> 1. setup globals
> 2. as "constant parameters" to instructions.
>
> In both these cases, from what I understand, they will have a single 
> use. Is it possible to create a Constant with multiple use(r)s?

I am nearly positive that constants can be used more than once. They 
subclass from Value.  I am sure that you can create a test program that 
uses the same constant value in different places and see if it generates 
one ConstantInt or multiple ConstantInts for the same constant integer.

Regards,

John Criswell

>
> Thanks,
> Siddharth
> -- 
> Sending this from my phone, please excuse any typos!
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
http://www.cs.rochester.edu/u/criswell

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


More information about the llvm-dev mailing list