Hi all, Currently metadata (other than debug info) can be attached to IR instructions but disappears during DAG selection. My question is why we do not keep the metadata during code lowering and then attach to MachineInstr, just as for IR instructions? Is there any technical challenge, or is it only because nobody wants to do so? Thanks for your help, Best, -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200722/30139c05/attachment.html>
I meet same question with you, and I finnally choose using instrinsic to tag the instruction -----Original Messages----- From:"Son Tuan VU via llvm-dev" <llvm-dev at lists.llvm.org> Sent Time:2020-07-22 20:31:18 (Wednesday) To: llvm-dev <llvm-dev at lists.llvm.org> Cc: Subject: [llvm-dev] Metadata in LLVM back-end Hi all, Currently metadata (other than debug info) can be attached to IR instructions but disappears during DAG selection. My question is why we do not keep the metadata during code lowering and then attach to MachineInstr, just as for IR instructions? Is there any technical challenge, or is it only because nobody wants to do so? Thanks for your help, Best, -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200722/c8a91354/attachment.html> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00003.txt URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200722/c8a91354/attachment.txt>
Son Tuan VU via llvm-dev <llvm-dev at lists.llvm.org> writes:> Currently metadata (other than debug info) can be attached to IR > instructions but disappears during DAG selection. > > My question is why we do not keep the metadata during code lowering and > then attach to MachineInstr, just as for IR instructions? Is there any > technical challenge, or is it only because nobody wants to do so?I have wanted codegen metadata for a very long time so I'm interested to hear the history behind this choice, and more importantly, whether adding such capability would be generally acceptable to the community. -David
> On Jul 27, 2020, at 10:11 AM, David Greene via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Son Tuan VU via llvm-dev <llvm-dev at lists.llvm.org> writes: > >> Currently metadata (other than debug info) can be attached to IR >> instructions but disappears during DAG selection. >> >> My question is why we do not keep the metadata during code lowering and >> then attach to MachineInstr, just as for IR instructions? Is there any >> technical challenge, or is it only because nobody wants to do so? > > I have wanted codegen metadata for a very long time so I'm interested to > hear the history behind this choice, and more importantly, whether > adding such capability would be generally acceptable to the community.The first questions need to be “what does it mean?”, “how does it work?”, and “what is it useful for?”. It is hard to evaluate a proposal without that. Metadata isn’t free - it must be maintained or invalidated for it to be useful. The details on that dramatically shape whether it can be used for any given purpose. -Chris