Pei Wang via llvm-dev
2017-Jun-26 21:07 UTC
[llvm-dev] About the concept of "materialization"
I’m current debugging one of my LLVM passes which utilized inline assembly. I constantly encounter crashes related to “value materialization”, according to the error messages I received. It seems a big concept in LLVM (or maybe generally in compilation), but I cannot find any document that is comprehensive enough to help me understand what exactly materialization is for. Could someone offer some pointers to useful materials introducing this concept or just explain it to me if it is straightforward enough? Thanks! Sincerely, Pei Wang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170626/63bb6ece/attachment.html>
Bruce Hoult via llvm-dev
2017-Jun-28 11:50 UTC
[llvm-dev] About the concept of "materialization"
You probably see it more often as "rematerialization". https://en.wikipedia.org/wiki/Rematerialization I believe "materialization" by itself (not "re") would usually be about things like getting a large constant (maybe a bit pattern or mask) into a register before it can be used. Some ISAs such as x86 support large constants directly in the instruction, but in RISC you usually have to choose between using a data load instruction to get the constant from a constant pool (maybe global, maybe just after the function using it), or using a series of instructions such as load-high, shift, or-immediate to create the constant. On Tue, Jun 27, 2017 at 12:07 AM, Pei Wang via llvm-dev < llvm-dev at lists.llvm.org> wrote:> I’m current debugging one of my LLVM passes which utilized inline > assembly. I constantly encounter crashes related to “value > materialization”, according to the error messages I received. It seems a > big concept in LLVM (or maybe generally in compilation), but I cannot find > any document that is comprehensive enough to help me understand what > exactly materialization is for. Could someone offer some pointers to useful > materials introducing this concept or just explain it to me if it is > straightforward enough? > > > > Thanks! > > > > Sincerely, > > Pei Wang > > > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170628/a4e46651/attachment.html>
Pei Wang via llvm-dev
2017-Jun-28 17:55 UTC
[llvm-dev] About the concept of "materialization"
Bruce, Thanks for the explanation. But based on my inspection on the source code, it seems that materialization is related to lazily reading LLVM objects (Module, Function, etc.) into the memory from bitcode files, which is possibly useful during LTO. I’m not sure though. Pei From: <bruce.hoult at gmail.com> on behalf of Bruce Hoult <bruce at hoult.org> Date: Wednesday, June 28, 2017 at 4:50 AM To: Pei Wang <pxw172 at ist.psu.edu> Cc: "llvm-dev at lists.llvm.org" <llvm-dev at lists.llvm.org> Subject: Re: [llvm-dev] About the concept of "materialization" You probably see it more often as "rematerialization". https://en.wikipedia.org/wiki/Rematerialization I believe "materialization" by itself (not "re") would usually be about things like getting a large constant (maybe a bit pattern or mask) into a register before it can be used. Some ISAs such as x86 support large constants directly in the instruction, but in RISC you usually have to choose between using a data load instruction to get the constant from a constant pool (maybe global, maybe just after the function using it), or using a series of instructions such as load-high, shift, or-immediate to create the constant. On Tue, Jun 27, 2017 at 12:07 AM, Pei Wang via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote: I’m current debugging one of my LLVM passes which utilized inline assembly. I constantly encounter crashes related to “value materialization”, according to the error messages I received. It seems a big concept in LLVM (or maybe generally in compilation), but I cannot find any document that is comprehensive enough to help me understand what exactly materialization is for. Could someone offer some pointers to useful materials introducing this concept or just explain it to me if it is straightforward enough? Thanks! Sincerely, Pei Wang _______________________________________________ LLVM Developers mailing list llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170628/72da189b/attachment.html>