search for: getallmetadata

Displaying 6 results from an estimated 6 matches for "getallmetadata".

2011 Aug 11
5
[LLVMdev] IR code modification/transformation
...it. Now, I want to iterate over the instruction and be able to modify the values of the instruction. For example, if my instruction is an add "<result> = add i32 4, %var" I want to transform it in a sub "<result> = sub i32 4, %var". I looked up on getOperands() and getAllMetadata() and some others methods, but none work. Can you help me with that please? Thx
2010 Apr 24
2
[LLVMdev] Proposal for Adding MetaData to a BasicBlock
...manipulated in class "Instruction", I propose to add the following methods from class "Instruction" to class "BasicBlock": public: bool hasMetadata() const MDNode *getMetadata(unsigned KindID) const; MDNode *getMetadata(const char *Kind) const; void getAllMetadata(SmallVectorImpl<std::pair<unsigned, MDNode*> > &MDs)const; void setMetadata(unsigned KindID, MDNode *Node); void setMetadata(const char *Kind, MDNode *Node); private: // These are all implemented in Metadata.cpp. MDNode *getMetadataImpl(unsigned KindID) const;...
2015 Apr 15
4
[LLVMdev] RFC: Metadata attachments to function definitions
...e_type` allows aggressive unions. Can't provide as much API as `std::vector<>`, but the API for metadata attachments is small and opaque: bool hasMetadata(unsigned Tag) const; MDNode *getMetadata(unsigned Tag) const; void setMetadata(unsigned Tag, const MDNode *MD); void getAllMetadata( SmallVectorImpl<std::pair<unsigned, const MDNode *>> &MDs) const; >> Cost would be 16B per `Function`, with the >> same malloc/heap costs as `SmallVector<..., 1>`. But I haven't seen a >> profile that suggests this would be worth the complexit...
2012 May 04
0
[LLVMdev] Getting Metadata
Hi. I have strange case: This is a code for getting metadata from callsite: .... CallSite CS(cast<Value>(I->first)); SmallVector<std::pair<unsigned int, MDNode*> , 4> MD; CS.getInstruction()->getAllMetadata(MD); CS.getInstruction()->dump(); for (SmallVector<std::pair<unsigned int, MDNode*> , 4>::iterator md = MD.begin(); md!=MD.end(); md++) { for (unsigned i=0; i<md->second->getNumOperands(); i++) { md->second->dump(); .... Metadata from IR: .... !2488 =...
2015 Apr 18
2
[LLVMdev] RFC: Metadata attachments to function definitions
...> Can't provide as much API as `std::vector<>`, but the API for metadata > attachments is small and opaque: > > bool hasMetadata(unsigned Tag) const; > MDNode *getMetadata(unsigned Tag) const; > void setMetadata(unsigned Tag, const MDNode *MD); > void getAllMetadata( > SmallVectorImpl<std::pair<unsigned, const MDNode *>> &MDs) const; > > >> Cost would be 16B per `Function`, with the > >> same malloc/heap costs as `SmallVector<..., 1>`. But I haven't seen a > >> profile that suggests this wou...
2015 Apr 15
2
[LLVMdev] RFC: Metadata attachments to function definitions
...> Can't provide as much API as `std::vector<>`, but the API for metadata > attachments is small and opaque: > > bool hasMetadata(unsigned Tag) const; > MDNode *getMetadata(unsigned Tag) const; > void setMetadata(unsigned Tag, const MDNode *MD); > void getAllMetadata( > SmallVectorImpl<std::pair<unsigned, const MDNode *>> &MDs) const; > > >> Cost would be 16B per `Function`, with the > >> same malloc/heap costs as `SmallVector<..., 1>`. But I haven't seen a > >> profile that suggests this wou...