On Sep 11, 2009, at 2:11 PM, Dan Gohman wrote:> > On Sep 11, 2009, at 9:57 AM, Chris Lattner wrote: > > >> Devang's work on debug info prompted this, thoughts welcome: >> http://nondot.org/sabre/LLVMNotes/ExtensibleMetadata.txt > > The document mentions "instructions" a lot. We'll want to be able to > apply metadata to ConstantExprs as well at least, if not also > Arguments > (think noalias) and other stuff, so it seems best to just talk about > "values" instead, and DenseMap<Value *, ...> instead of > DenseMap<Instruction *, ...>.I wrote: "Note that this document talks about metadata for instructions, it might make sense to generalize this to being metadata for all non-uniqued values (global variables, functions, basic blocks, arguments), but I'm just keeping it simple for now." However, constant exprs are uniqued. What would you find it useful for? -Chris
On Sep 11, 2009, at 4:47 PM, Chris Lattner wrote:> > On Sep 11, 2009, at 2:11 PM, Dan Gohman wrote: > > >> >> >> On Sep 11, 2009, at 9:57 AM, Chris Lattner wrote: >> >> >> >> >> >>> Devang's work on debug info prompted this, thoughts welcome: >>> >>> http://nondot.org/sabre/LLVMNotes/ExtensibleMetadata.txt >>> >> >> >> The document mentions "instructions" a lot. We'll want to be able to >> >> apply metadata to ConstantExprs as well at least, if not also >> Arguments >> >> (think noalias) and other stuff, so it seems best to just talk about >> >> "values" instead, and DenseMap<Value *, ...> instead of >> >> DenseMap<Instruction *, ...>. >> > > I wrote: "Note that this document talks about metadata for > instructions, it might make sense to generalize this to being > metadata for all non-uniqued values (global variables, functions, > basic blocks, arguments), but I'm just keeping it simple for now."I missed that part.> However, constant exprs are uniqued. What would you find it useful > for?We have inbounds on ConstantExprs today, for example. Dan
On Sep 11, 2009, at 4:55 PM, Dan Gohman wrote:>> >> I wrote: "Note that this document talks about metadata for >> instructions, it might make sense to generalize this to being >> metadata for all non-uniqued values (global variables, functions, >> basic blocks, arguments), but I'm just keeping it simple for now." > > I missed that part. > >> However, constant exprs are uniqued. What would you find it useful >> for? > > We have inbounds on ConstantExprs today, for example.... and it was an interesting source of problems. Do you think that inbounds on constantexprs is really a good idea? It means that we can get into a world where we have: "gep p, 0, 1" and "gep inbounds p, 0, 1" not be uniqued. The impact of this is somewhat reduced by libanalysis and vmcore trying to infer inbounds etc. Instead of putting inbounds on the constantexpr, why not make that "inference" be a predicate that any client could ask of the constantexpr? -Chris