[LLVMdev] Is metadata the right thing to associate one instruction to another?

Frank Winter fwinter at jlab.org
Mon Jul 13 10:39:24 PDT 2015


Background: I am still working on vectorizing (widening) a whole 
instruction tree (from the loads to the stores). I have all scalar loads 
in a SetVector and have created widened version of them (new instructions).

What would be very useful to have is the possibility to get to the 
vector load instruction from the scalar load in constant time. I was 
thinking to somehow add the vector load instruction (pointer) to the 
scalar version as metadata. With that, the traversal of the scalar tree 
can quickly get the vector version of the loads. But metadata seems to 
work with strings of MDNodes. That makes me worry if metadata is what I 
want..

My question: Is metadata the only possibility to 'associate' (in the 
sense of making it quickly accessible) an instruction to another? What 
type of metadata would be recommended ?

Thanks,
Frank




More information about the llvm-dev mailing list