(original) (raw)

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@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