search for: mdstring

Displaying 20 results from an estimated 119 matches for "mdstring".

Did you mean: mbstring
2011 Nov 20
2
[LLVMdev] How can I output assembly comments from emitPrologue()?
...comments in my emitPrologue() function, just for my own readability. Searching for a way to do this found me this thread - http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-October/043722.html, which says that the best way to output comments from somewhere like emitPrologue() is to: 1. Create an MDString for the comment. 2. Attach it to an LLVM instruction using setMetadata(). 3. Add a new member to MachineInstr to hold the metadata, and attach it when converting LLVM instructions. 4. Update AsmPrinter to read off the metadata and output it as an assembly comment. Is this the only (...
2011 Dec 21
0
[LLVMdev] creating new Metadata
...using LLVM 2.7 `grep -r MDNode` in $LLVM_SOURCE may give you some examples. I don't know if there is a doxygen for LLVM 2.7, but you can see include/llvm/Metadata.h and unittests/VMCore/MetadataTest.cpp to know how to create a MDNode. Below is code snipt taken form MetadataTest.cpp. --- MDString *s1 = MDString::get(Context, StringRef(&x[0], 3)); MDString *s2 = MDString::get(Context, StringRef(&y[0], 3)); ConstantInt *CI = ConstantInt::get(getGlobalContext(), APInt(8, 0)); std::vector<Value *> V; V.push_back(s1); V.push_back(CI); V.push_back(s2); MDNode *n1 = M...
2013 Jun 26
2
[LLVMdev] Proposal: extended MDString syntax
Hello, I propose a new syntax for metadata strings (MDStrings) which would allow string data to be spread over multiple lines: !0 = metadata !{metadata !""" hello world """} The special three-quote sequence marks the beginning and end of a multi-line string. This syntax could have a variety of uses, but of particular interest...
2011 Dec 20
3
[LLVMdev] creating new Metadata
Dear llvm-ers, I am trying to attach a customized metadata to llvm instructions. Let's say, I want to attach some number to each instruction. I am trying to use void Instruction::setMetadata(unsigned KindID, MDNode* Node) but I am not sure how to create a brand new instance of an MDNode. Do you have any code samples demonstrating how to do that? Due to some tool dependencies, I am using
2014 Oct 02
3
[LLVMdev] How do I update Ocaml debug info? (was Re: [llvm] r218914 - DI: Fold constant arguments into a single MDString)
...at 2:57 PM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote: > > Author: dexonsmith > Date: Thu Oct 2 16:56:57 2014 > New Revision: 218914 > > URL: http://llvm.org/viewvc/llvm-project?rev=218914&view=rev > Log: > DI: Fold constant arguments into a single MDString > > This patch addresses the first stage of PR17891 by folding constant > arguments together into a single MDString. Integers are stringified and > a `\0` character is used as a separator. > > Part of PR17891. > > Note: I've attached my testcases upgrade scripts to t...
2013 Jun 26
0
[LLVMdev] Proposal: extended MDString syntax
...d the problem that you pointer out that machine instructions refer to LLVM-IR, but I don’t think that metadata is the right container for them. Nadav On Jun 26, 2013, at 3:29 PM, Dan Gohman <dan433584 at gmail.com> wrote: > Hello, > > I propose a new syntax for metadata strings (MDStrings) which would allow string data to be spread over multiple lines: > > !0 = metadata !{metadata !""" > hello > world > """} > > The special three-quote sequence marks the beginning and end of a multi-line string. > > This syntax could have...
2011 Nov 20
0
[LLVMdev] How can I output assembly comments from emitPrologue()?
...= pattern; } 2. I then defined a comment instruction, ala: def COMMENT : FakeInst<(outs), (ins Reg:$fake), "; $fake", []>; 3. I added the following to printOperand(...) in XXXAsmPrinter.cpp: switch (MO.getType()) { ... case MachineOperand::MO_Metadata: O << cast<MDString>(MO.getMetadata()->getOperand(0))->getString(); break; ... } 4. Finally, whenever I needed to emit comments I call the following: MDNode* comment = MDNode::get(getGlobalContext(), ArrayRef<Value*>(MDString::get(getGlobalContext(), "COMMENT HERE"))); BuildMI(MBB, MBB...
2011 Dec 22
3
[LLVMdev] creating new Metadata
...M_SOURCE may give you some examples. I don't > know if > there is a doxygen for LLVM 2.7, but you can see include/llvm/Metadata.h > and > unittests/VMCore/MetadataTest.cpp to know how to create a MDNode. Below is > code > snipt taken form MetadataTest.cpp. > > --- > MDString *s1 = MDString::get(Context, StringRef(&x[0], 3)); > MDString *s2 = MDString::get(Context, StringRef(&y[0], 3)); > ConstantInt *CI = ConstantInt::get(getGlobalContext(), APInt(8, 0)); > > std::vector<Value *> V; > V.push_back(s1); > V.push_back(CI); > V.push...
2013 Jun 26
0
[LLVMdev] Proposal: extended MDString syntax
On Jun 26, 2013, at 4:18 PM, Eric Christopher <echristo at gmail.com> wrote: > (Note, this is the first I've heard of this plan and just figured it out myself) Yes, this is also the first time I heard about this and I haven’t had a chance to think about this problem too deeply. > > So inverting it so that MI contains LLVM IR instead of the other way > around? Then
2011 Dec 22
0
[LLVMdev] creating new Metadata
...les. I > don't know if > there is a doxygen for LLVM 2.7, but you can see > include/llvm/Metadata.h and > unittests/VMCore/MetadataTest.cpp to know how to create a MDNode. > Below is code > snipt taken form MetadataTest.cpp. > > --- > MDString *s1 = MDString::get(Context, StringRef(&x[0], 3)); > MDString *s2 = MDString::get(Context, StringRef(&y[0], 3)); > ConstantInt *CI = ConstantInt::get(getGlobalContext(), APInt(8, 0)); > > std::vector<Value *> V; > V.push_back(s1); > V.push_ba...
2010 Oct 06
0
[LLVMdev] Associating types directly with debug metadata?
...you need to name an LLVM type in your MDNode, just create an undef >> value of that type. > > I agree completely. Ok, I will try using undefs, but do they work for aggregate types? Well, I'll see. However, I don't understand what is so different in my design from MDNode and MDString being values? Sure, I could make the TypeValue a subclass of MDNode, name it something like MDType, and use a tag different form "typeval", something like "metatype". Would that be better? Or should it still be a direct subclass of Value, like both MDNode and MDString are? I...
2010 Oct 06
2
[LLVMdev] Associating types directly with debug metadata?
On Oct 5, 2010, at 11:23 PM, Nick Lewycky wrote: >> >> Here is another version of the patch. This one includes also a small patch to llvm-gcc so that it generates the type metadata for structures and classes. This one also generates and parses correctly the metadata for .ll files. No .bc support yet. The biggest problem with this version is that it breaks when the compiler/linker
2013 Jun 26
0
[LLVMdev] Proposal: extended MDString syntax
On Jun 26, 2013, at 3:51 PM, Chandler Carruth <chandlerc at google.com> wrote: > Can you suggest an alternative solution? Can you describe why you don't think metadata is the right container? This alone isn't really helpful at moving us toward something that there has been widespread agreement LLVM needs. Hi Chandler, Sure, we can talk about serializing MF. But the discussion
2013 Nov 12
3
[LLVMdev] Debug info: type uniquing for C++ and the status on building clang with "-flto -g"
...lding clang with "-flto -g" after type uniquing: 3.4GB MDNodes after parsing all bc files, 7GB MDNodes after linking all bc files 4.6GB DIEs 4G MCContext --> The memory usage is still too big. So how to reduce the memory footprint at MDNode level: 1> Combine integers into MDString and further combining MDStrings (see PR17891) A partial implementation on the important debug info nodes can reduce the MDNodes from 7GB to 5.7GB 2> Release MDNodes that are only used by source modules (I will send out a proposal) An estimation based on partial implementation: t...
2012 Oct 02
0
[LLVMdev] [RFC] OpenMP Representation in LLVM IR
...non-existent > or can be determined by examining other intrinsic calls and thus, not > required to be explicitly present. > > Metadata specify only one thing: type of a directive. Currently LLVM > IR does not support integer or enumeration metadata types; thus, we > decided to use MDString (metadata string type) to represent the type. > The list of directives and their identifiers is shown in Table 1. > > Table 1. OpenMP Directives > > Type of directive #pragma omp ... | MDString in metadata > ------------------------------------------------------------ > pa...
2009 Jul 27
4
[LLVMdev] PROPOSAL : Introduce NamedMetadata
In LLVM IR metadata is used to attach auxiliary information with various IR constructs. Currently metadata information is represented using MDNode and MDString. The metadata can refer to LLVM values but these references are not counted as regular "uses" of these values because metadata is maintained 'on the side'. This ensures that the optimizer is not influenced by auxiliary information. For example, !1 = { i32 42 } define void @foo()...
2012 Sep 28
11
[LLVMdev] [RFC] OpenMP Representation in LLVM IR
...or such directives is either non-existent or can be determined by examining other intrinsic calls and thus, not required to be explicitly present. Metadata specify only one thing: type of a directive. Currently LLVM IR does not support integer or enumeration metadata types; thus, we decided to use MDString (metadata string type) to represent the type. The list of directives and their identifiers is shown in Table 1. Table 1. OpenMP Directives Type of directive #pragma omp ... | MDString in metadata ------------------------------------------------------------ parallel...
2013 Jun 26
2
[LLVMdev] Proposal: extended MDString syntax
On Wed, Jun 26, 2013 at 3:46 PM, Nadav Rotem <nrotem at apple.com> wrote: > But I think that serialization of MachineFunction should not be done in > metadata. I understand the problem that you pointer out that machine > instructions refer to LLVM-IR, but I don’t think that metadata is the right > container for them. Can you suggest an alternative solution? Can you describe
2010 Nov 07
2
[LLVMdev] More metadata questions
...to insert metadata into the LLVM IR. Let's say that I want to have two passes, one that creates some metadata string and inserts it into the IR, and the second one that reads it and acts according to what it finds (or doesn't find). Are the DI* classes the right way to go? Or should I use MDString, etc? Either way, I've found lots of ways to define them, but not the right way to actually get them to be where I want them in the IR. Thanks a lot, Guy -- View this message in context: http://old.nabble.com/More-metadata-questions-tp30152346p30152346.html Sent from the LLVM - Dev mailing l...
2016 Mar 03
5
[cfe-dev] RFC: CodeView debug info emission in Clang/LLVM
...ture. > Compromising at not reusing the type representation seems OK. > > I haven't come up with any ideas better than the design that Dave > Bartolomeo outlined below, so I think we should go ahead with that. One > thing I considered was extending DITypeRef to be a union between MDString*, > DIType*, and a type index, but I think that's too invasive. I also don't > want to make a whole DIType heap allocation just to wrap a 32-bit type > index, so I'm in favor of putting the indices into DISubprogram and > DIVariable. > > Any thoughts on this plan? >...