<div dir="ltr"><div><div><div><div><div><div>Hey Guys !<br></div>I'm interested to participate in Google Summer of Code 2018 for  LLVM. Any Projects (new features or reimplementation) related to recent " Meltdown & Spectre " Problem.<br></div>I'm a beginner in Compiler Technology. Could you please recommend some videos or blog post about "<b>Introduction to LLVM internals ". </b>Because I find it difficult to understand LLVM IR Generation and Backend as it contains many different passes and different concepts. <br></div>Can I (as student) suggest a project proposal on my own regardless of one provided by LLVM Org itself. Whether that is encouraged ? Because many organizations follow different rules.<br></div>Hoping for a reply :) <br></div>Thank you all guys !<br></div>Pree<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 3 February 2018 at 05:55, via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send llvm-dev mailing list submissions to<br>
        <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:llvm-dev-request@lists.llvm.org">llvm-dev-request@lists.llvm.<wbr>org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:llvm-dev-owner@lists.llvm.org">llvm-dev-owner@lists.llvm.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of llvm-dev digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. [GSOC 2018] Mentors and projects needed! Any help<br>
      appreciated. (Tanya Lattner via llvm-dev)<br>
   2. Phabricator acting funny (George Karpenkov via llvm-dev)<br>
   3. Re: llvm.memcpy for struct copy (Hongbin Zheng via llvm-dev)<br>
   4. Vector Splitting for Stackmap Operands (Yihan Pang via llvm-dev)<br>
   5. Re: Customizing SBCC for lcov workflows<br>
      (Vedant Kumar via llvm-dev)<br>
   6. Re: Debug info error on bitcode inline modification<br>
      (David Blaikie via llvm-dev)<br>
   7. Re: retpoline mitigation and 6.0 (David Woodhouse via llvm-dev)<br>
   8. LLVM buildmaster will be updated and restarted tonight<br>
      (Galina Kistanova via llvm-dev)<br>
   9. Re: retpoline mitigation and 6.0 (Chandler Carruth via llvm-dev)<br>
  10. Re: retpoline mitigation and 6.0 (Chandler Carruth via llvm-dev)<br>
<br>
<br>
------------------------------<wbr>------------------------------<wbr>----------<br>
<br>
Message: 1<br>
Date: Fri, 2 Feb 2018 12:37:26 -0800<br>
From: Tanya Lattner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
Cc: Clang Dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>><br>
Subject: [llvm-dev] [GSOC 2018] Mentors and projects needed! Any help<br>
        appreciated.<br>
Message-ID: <<a href="mailto:E5D2C5CB-311D-41C2-BC4A-2F34199AEE05@llvm.org">E5D2C5CB-311D-41C2-BC4A-<wbr>2F34199AEE05@llvm.org</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
All,<br>
<br>
The LLVM project has had many years of success with the Google Summer of Code project and we would really like to continue our participation. However, without the support of more community members, we fear that we may not be selected as an organization this year. They are already reviewing projects and to improve our chances of participation we need more projects and mentors listed on the GSOC 2018 webpage.<br>
<br>
<a href="https://llvm.org/OpenProjects.html#gsoc18" rel="noreferrer" target="_blank">https://llvm.org/OpenProjects.<wbr>html#gsoc18</a><br>
<br>
Time is of the essence here. If you can think of a project that you think would be a useful addition or improvement to LLVM or a sub-project, please list it. If you personally can’t mentor then reach out to others who might be a good fit and maybe they could mentor or share responsibilities with you. I am sure there is no shortage of work to be done :) Its just a matter of getting it on our projects page or finding a mentor for an existing project listed.<br>
<br>
GSOC has been a great program for so many students. Many have gone on to find internships or even full time jobs at companies working with LLVM and related projects. Companies have found great employees through mentoring a student. Its a great introduction to many students into the world of open source and the LLVM project. There are so many positives to this program and we really hope to continue being a part of it.<br>
<br>
If you can help, please go ahead and add a project to the page or volunteer to be a mentor. If you don’t feel comfortable modifying the webpage, send me a patch and I will do it for you.<br>
<br>
Thank you!<br>
-Tanya<br>
<br>
<br>
<br>
<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.llvm.org/pipermail/llvm-dev/attachments/20180202/7f5c4a92/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/llvm-dev/<wbr>attachments/20180202/7f5c4a92/<wbr>attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Fri, 02 Feb 2018 12:50:22 -0800<br>
From: George Karpenkov via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
Subject: [llvm-dev] Phabricator acting funny<br>
Message-ID: <<a href="mailto:1F32AB9B-6EF7-400C-B0DB-508D77F8C459@apple.com">1F32AB9B-6EF7-400C-B0DB-<wbr>508D77F8C459@apple.com</a>><br>
Content-Type: text/plain; charset=utf-8<br>
<br>
Hi All,<br>
<br>
During the last couple of days I have noticed that my “reviews” page in phabricator show inconsistent content.<br>
Is there perhaps a caching problem, or did database get stuck in an inconsistent state?<br>
This is very frustrating for those relying on phabricator as a task organizer.<br>
<br>
E.g. for me the revision D42404 is not in “Waiting on review” list, but it is in the state “needs review”.<br>
In fact, it’s not shown anywhere when I go to <a href="http://reviews.llvm.org" rel="noreferrer" target="_blank">reviews.llvm.org</a>, and<br>
I could only dig it up by going to “Authored” and then looking through all of those.<br>
(I wish I could attach the screenshot, but the mailman wouldn’t let me)<br>
<br>
Regards,<br>
George<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Fri, 2 Feb 2018 13:27:18 -0800<br>
From: Hongbin Zheng via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: David Chisnall <<a href="mailto:David.Chisnall@cl.cam.ac.uk">David.Chisnall@cl.cam.ac.uk</a>><br>
Cc: llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
Subject: Re: [llvm-dev] llvm.memcpy for struct copy<br>
Message-ID:<br>
        <CAJ0ZJHSSc76tBDXnV_-<wbr>wQpLyEfbRJ=nKf2TDA2LKQpB=<a href="mailto:4inkhQ@mail.gmail.com">4inkh<wbr>Q@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
I wonder it is possible the explicitly mark the padding bytes such that the<br>
later optimization know the padding bytes and do some optimizations.<br>
<br>
Thanks<br>
Hongbin<br>
<br>
On Fri, Feb 2, 2018 at 2:59 AM, David Chisnall via llvm-dev <<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
<br>
> On 1 Feb 2018, at 18:39, Friedman, Eli <<a href="mailto:efriedma@codeaurora.org">efriedma@codeaurora.org</a>> wrote:<br>
> ><br>
> > On 2/1/2018 2:03 AM, David Chisnall via llvm-dev wrote:<br>
> >> In contrast, the padding between fields in non-packed structs<br>
> disappears as soon as SROA runs. This can lead to violations of C<br>
> semantics, where padding fields should not change (because C defines<br>
> bitwise comparisons on structs using memcmp). This can lead to subtly<br>
> different behaviour in C code depending on the target ABI (we’ve seen cases<br>
> where trailing padding is copied in one ABI but not in another, depending<br>
> solely on pointer size).<br>
> ><br>
> > The IR type of an alloca isn't supposed to affect the semantics; it's<br>
> just a sizeof(type) block of bytes.  We haven't always gotten this right in<br>
> the past, but it should work correctly on trunk, as far as I know.  If you<br>
> have an IR testcase where this still doesn't work correctly, please file a<br>
> bug.<br>
><br>
> It’s not an IR test case.  We have a C struct that is {void*, int}.  On a<br>
> system with 8-byte pointers, this becomes an LLVM struct { i8*, i8 }.  On a<br>
> system with 16-byte pointers, clang lowers it to { i8*, i8, [12 x i8] }.<br>
> From the perspective of SROA, the [12 x i8] is a real field.  When a<br>
> function is called with the struct, it is lowered to taking an explicit [12<br>
> x i8] argument, whereas the other version takes only i8* and i8 in<br>
> registers.  This means that if the callee writes the data out to memory and<br>
> then performs a memcmp, the 8-byte-pointer version may not have the same<br>
> padding, whereas the 16-byte-pointer version will.<br>
><br>
> In the code that we were using (the DukTape JavaScript interpreter), the<br>
> callee didn’t actually look at the padding bytes in either case, so we just<br>
> ended up with less efficient code in the 16-byte-pointer case, but the same<br>
> could equally have generated incorrect code for the 8-byte-pointer case.<br>
><br>
> David<br>
><br>
> ______________________________<wbr>_________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.llvm.org/pipermail/llvm-dev/attachments/20180202/72f196a1/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/llvm-dev/<wbr>attachments/20180202/72f196a1/<wbr>attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Fri, 2 Feb 2018 16:34:43 -0500<br>
From: Yihan Pang via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
Subject: [llvm-dev] Vector Splitting for Stackmap Operands<br>
Message-ID:<br>
        <CA+2_MPGDd8YfRL-M=<a href="mailto:86peafduwXC21akm9g_6Bb0hyzON6xf8w@mail.gmail.com">86peafduwXC<wbr>21akm9g_6Bb0hyzON6xf8w@mail.<wbr>gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
HI All,<br>
<br>
I am current working with SIMD instruction along with stackmap features.<br>
<br>
Recently I encountered a problem involving legalizing stackmap. In my<br>
stackmap, I record all the live values existing at the callsite. One of the<br>
operands in my stackmap is an illegal vector type for arm64 architecture (<br>
*v4f64*) and requires vector splitting in order to legalize the node (<br>
*v2f64*). However, I noticed that in the<br>
*DAGTypeLegalizer::<wbr>SplitVectorOperand* function, the switch case does not<br>
handle stackmap cases. So initially every time I run my code with<br>
<br>
  *-mllvm -debug-only=legalize_types*<br>
<br>
I will get an error " Do not know  how to split this operator's operand"<br>
<br>
My first attempt to fix this is to  add an if statment before the switch<br>
case to see if the Node is referring to a stackmap, and if so I will get<br>
the SDNode of the particular stackmap operand using<br>
<br>
*N->getOperand(OperandNumber).<wbr>getNode(); *<br>
<br>
and use that instead of the original SDNode in the switch case statement.<br>
<br>
For example, if I need to split  the 3rd operand of my stackmap which is an<br>
vector operand<br>
I will create a *SDNode* that equals to* N->getOperand(3).getNode()*;<br>
<br>
This attempt gives a failed assertion of " *Invalid node ID for RAUW<br>
deletion.*"<br>
<br>
My next attempt is to add additional instructions to replace the original<br>
illegal vector operand with the new resulting legal operand. This can be<br>
achieved using *ReplaceValueWidth*  function (if the stackmap flag is set)<br>
to replace the original *SDValue* of the vector operand with the new<br>
Resulting Value (in the function it is denoted as *Res*) that resulted<br>
 from *SplittingVecOp_*xxx function.<br>
<br>
However, this way I ran into other failed assertion at other locations.<br>
<br>
Right now I am not sure what is an effective way of handling stackmap<br>
vector operand in the legalizing phase and I appreciate any suggestions<br>
from the community<br>
<br>
Best,<br>
Yihan<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.llvm.org/pipermail/llvm-dev/attachments/20180202/9f051b72/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/llvm-dev/<wbr>attachments/20180202/9f051b72/<wbr>attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Fri, 02 Feb 2018 13:50:03 -0800<br>
From: Vedant Kumar via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: "Harp, Thom" <<a href="mailto:Thom.Harp@netapp.com">Thom.Harp@netapp.com</a>><br>
Cc: "<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>" <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
Subject: Re: [llvm-dev] Customizing SBCC for lcov workflows<br>
Message-ID: <<a href="mailto:38F6BC12-C937-41AD-A7A4-50A703B2534D@apple.com">38F6BC12-C937-41AD-A7A4-<wbr>50A703B2534D@apple.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi Thom,<br>
<br>
> On Feb 1, 2018, at 12:03 PM, Harp, Thom via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
> I’m working to implement Source Based Code Coverage in a workflow that uses lcov for report generation.  We’ve customized our llvm-cov to add a command to convert the SBCC counter data to lcov’s ‘.info’ format.  The problem is that the region-based counter definitions in SBCC can span source code regions that can contain blank lines (or lines with only comments).  Converting this to lcov’s line-based format skews our line and hit counts wildly compared to reports we generate from gcov data.  E.g, a ‘for’ loop might span 10 lines in the source code, but if 7 of those are comments or blank lines, gcov counts only the 3 lines that are executable while SBCC counts all 10 because at least one counter will span the whole block. llvm-cov has no visibility into the source code so we can’t reliably clean this up from there.<br>
><br>
> Instead I’m thinking of modifying the coverage mapping generator (clang/lib/CodeGen/<wbr>CoverageMappingGen.cpp) to (optionally) record the line numbers for source lines that have real code on them and emit this informaiton alongside the coverage-mapping data in the object files.  In llvm-cov I can then use the extra info so SBCC counts blank lines the same way gcov does.   I’m writing to solicit feedback on this idea.<br>
><br>
> To identify the interesting line numbers, I record the line numbers for statements that have no children while the coverage mapping generator walks the AST.  These statements are leaf nodes and correspond to single, concrete items in the source code (effectively filtering out statements that can span multiple lines of code).  Writing the collected line numbers to the __llvm_covmap section is easy enough.  I’m still working through the coverage mapping reader code so I can take advantage of the new information in llvm-cov while generating the lcov .info files.<br>
<br>
This sounds like a reasonable plan -- I don't think it needs to be an opt-in behavior. Once you've built up the list of source ranges that should be skipped you can feed it into gatherSkippedRegions(). I anticipate that most of the work will be in updating test cases in clang and compiler-rt.<br>
<br>
<br>
> I’d like to eventually push this change upstream (I can’t be the only one wanting to use lcov and SBCC together), so I’m seeking feedback before I invest too much time in my current direction.  Is my approach sound?<br>
<br>
That sounds great. My advice is to upstream your changes in small self-contained pieces. Concretely, it'd be nice to have the .info generation before any clang changes. Feel free to add me as a reviewer on Phab (<a href="http://reviews.llvm.org" rel="noreferrer" target="_blank">reviews.llvm.org</a> <<a href="http://reviews.llvm.org/" rel="noreferrer" target="_blank">http://reviews.llvm.org/</a>>).<br>
<br>
best,<br>
vedant<br>
<br>
>   Is there a better way to get source code information from llvm-cov?<br>
><br>
> Thanks.<br>
> -thom<br>
> ______________________________<wbr>_________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a> <mailto:<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.<wbr>org</a>><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a> <<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-<wbr>bin/mailman/listinfo/llvm-dev</a>><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.llvm.org/pipermail/llvm-dev/attachments/20180202/d7a36ac9/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/llvm-dev/<wbr>attachments/20180202/d7a36ac9/<wbr>attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 6<br>
Date: Fri, 02 Feb 2018 22:53:09 +0000<br>
From: David Blaikie via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: Ku Nanashi <<a href="mailto:nanashi.ku.0x0@gmail.com">nanashi.ku.0x0@gmail.com</a>><br>
Cc: <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
Subject: Re: [llvm-dev] Debug info error on bitcode inline<br>
        modification<br>
Message-ID:<br>
        <CAENS6EtCDzgr_6-<wbr>sMf3xUVUREMyb6xh+jF==Xo6Vm-<wbr>cTQ9=<a href="mailto:j1A@mail.gmail.com">j1A@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Every inlinable call in a function that has debug info (F->getSubprogram()<br>
returns non-null) must have a DebugLoc associated with it that has a scope<br>
chain that ends in that same DISubprogram.<br>
<br>
<a href="https://llvm.org/docs/SourceLevelDebugging.html" rel="noreferrer" target="_blank">https://llvm.org/docs/<wbr>SourceLevelDebugging.html</a> discusses some of the debug<br>
info IR metadata in LLVM.<br>
<br>
On Fri, Feb 2, 2018 at 1:03 AM Ku Nanashi via llvm-dev <<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
<br>
> Hi,<br>
><br>
> I'm trying to inline function defined in another bitcode module via<br>
> bitcode modification.<br>
> I'm linking multiple bitcode modules, setting inline related attributes,<br>
> applying -always-inline pass, but then debug info error occurs.<br>
> It seems debug info metadata isn't properly updated on inlining. How can I<br>
> fix it?<br>
> I'm using LLVM 3.8.1 on OS X (On below example target is Android but it<br>
> should be same on others).<br>
> I'll appreciate any advice. Thanks.<br>
><br>
> * Targets<br>
> caller.cpp<br>
> ------------------------------<wbr>------------------------------<wbr>-----<br>
> #include <android/log.h><br>
><br>
> #ifdef __cplusplus<br>
> extern "C" {<br>
> #endif<br>
><br>
> void caller()<br>
> {<br>
>         __android_log_print(ANDROID_<wbr>LOG_DEBUG, "TEST", "%s:%d:%s",<br>
> __FILE__, __LINE__, __FUNCTION__);<br>
> }<br>
><br>
> #ifdef __cplusplus<br>
> }<br>
> #endif<br>
> ------------------------------<wbr>------------------------------<wbr>-----<br>
><br>
> callee.cpp<br>
> ------------------------------<wbr>------------------------------<wbr>-----<br>
> #include <android/log.h><br>
><br>
> #ifdef __cplusplus<br>
> extern "C" {<br>
> #endif<br>
><br>
> void callee()<br>
> {<br>
>         __android_log_print(ANDROID_<wbr>LOG_DEBUG, "TEST", "%s:%d:%s",<br>
> __FILE__, __LINE__, __FUNCTION__);<br>
> }<br>
><br>
> #ifdef __cplusplus<br>
> }<br>
> #endif<br>
> ------------------------------<wbr>------------------------------<wbr>-----<br>
><br>
> * Building bitcode<br>
> ------------------------------<wbr>------------------------------<wbr>-----<br>
> $ clang++ (...snip target specific flags...) -emit-llvm caller.cpp -o<br>
> caller.bc<br>
> $ clang++ (...snip target specific flags...) -emit-llvm callee.cpp -o<br>
> callee.bc<br>
> ------------------------------<wbr>------------------------------<wbr>-----<br>
><br>
> * Linking bitcode<br>
> ------------------------------<wbr>------------------------------<wbr>-----<br>
> $ llvm-link caller.o callee.o -o=test.bc<br>
> ------------------------------<wbr>------------------------------<wbr>-----<br>
><br>
> * Modifying bitcode<br>
> inliner.cpp<br>
> ------------------------------<wbr>------------------------------<wbr>-----<br>
> #include "llvm/IR/Type.h"<br>
> #include "llvm/IR/Module.h"<br>
> #include "llvm/IR/Function.h"<br>
> #include "llvm/IR/GlobalValue.h"<br>
> #include "llvm/IR/InstIterator.h"<br>
> #include "llvm/IR/Instructions.h"<br>
> #include "llvm/IR/IRBuilder.h"<br>
> #include "llvm/Support/SourceMgr.h"<br>
> #include "llvm/IRReader/IRReader.h"<br>
> #include "llvm/Support/FileSystem.h"<br>
> #include "llvm/Bitcode/ReaderWriter.h"<br>
> #include "llvm/Support/raw_ostream.h"<br>
><br>
> using namespace llvm;<br>
><br>
> int main(int argc, char *argv[])<br>
> {<br>
>         SMDiagnostic error;<br>
>         LLVMContext context;<br>
>         Module *M = parseIRFile(argv[1], error, context).release();<br>
><br>
>         for (Module::iterator F = M->getFunctionList().begin(); F !=<br>
> M->getFunctionList().end(); F++)<br>
>         {<br>
>                 if (!F->isDeclaration())<br>
>                 {<br>
>                         if (F->getName() == "caller")<br>
>                         {<br>
>                                 Function* callee =<br>
> M->getFunction("callee");<br>
><br>
>                                 inst_iterator I = inst_begin((Function<br>
> *)F);<br>
>                                 Instruction *inst = &*I;<br>
><br>
>                                 CallInst::Create(callee, "", inst);<br>
>                         }<br>
><br>
>                         if (F->getName() == "callee")<br>
>                         {<br>
><br>
> F->setLinkage(GlobalValue::<wbr>InternalLinkage);<br>
>                                 F->addFnAttr(Attribute::<wbr>AlwaysInline);<br>
>                                 F->addFnAttr(Attribute::<wbr>InlineHint);<br>
>                         }<br>
>                 }<br>
>         }<br>
><br>
>         std::error_code ec;<br>
>         raw_fd_ostream os(argv[1], ec, sys::fs::F_None);<br>
>         WriteBitcodeToFile(M, os);<br>
> }<br>
> ------------------------------<wbr>------------------------------<wbr>-----<br>
><br>
> ------------------------------<wbr>------------------------------<wbr>-----<br>
> $ g++ (...snip host specific flags...) inliner.cpp -o inliner<br>
> $ ./inliner test.bc<br>
> ------------------------------<wbr>------------------------------<wbr>-----<br>
><br>
> * Applying -always-inline pass (Debug info error occurs)<br>
> ------------------------------<wbr>------------------------------<wbr>-----<br>
> $ opt -debug-pass=Structure -always-inline test.bc -o test.bc.inline<br>
> Pass Arguments:  -targetlibinfo -tti -assumption-cache-tracker -basiccg<br>
> -always-inline -verify<br>
> Target Library Information<br>
> Target Transform Information<br>
> Assumption Cache Tracker<br>
>   ModulePass Manager<br>
>     CallGraph Construction<br>
>     Call Graph SCC Pass Manager<br>
>       Inliner for always_inline functions<br>
>       FunctionPass Manager<br>
>         Module Verifier<br>
>     Bitcode Writer<br>
> !dbg attachment points at wrong subprogram for function<br>
> !16 = distinct !DISubprogram(name: "caller", scope: !1, file: !1, line:<br>
> 11, type: !17, isLocal: false, isDefinition: true, scopeLine: 12, flags:<br>
> DIFlagPrototyped, isOptimized: true, variables: !19)<br>
> void ()* @caller<br>
>   %call.i = call i32 (i32, i8*, i8*, ...) @__android_log_print(i32 3, i8*<br>
> getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8*<br>
> getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1.4, i32 0, i32 0), i8*<br>
> getelementptr inbounds ([111 x i8], [111 x i8]* @.str.2.5, i32 0, i32 0),<br>
> i32 13, i8* getelementptr inbounds ([7 x i8], [7 x i8]*<br>
> @__FUNCTION__.callee, i32 0, i32 0)) #2, !dbg !30<br>
> !30 = !DILocation(line: 13, column: 2, scope: !23)<br>
> !23 = distinct !DISubprogram(name: "callee", scope: !21, file: !21, line:<br>
> 11, type: !17, isLocal: false, isDefinition: true, scopeLine: 12, flags:<br>
> DIFlagPrototyped, isOptimized: true, variables: !19)<br>
> !23 = distinct !DISubprogram(name: "callee", scope: !21, file: !21, line:<br>
> 11, type: !17, isLocal: false, isDefinition: true, scopeLine: 12, flags:<br>
> DIFlagPrototyped, isOptimized: true, variables: !19)<br>
> LLVM ERROR: Broken function found, compilation aborted!<br>
> ------------------------------<wbr>------------------------------<wbr>-----<br>
><br>
> If I add -strip-debug pass, no error occurs, but of course debug info is<br>
> lost...<br>
> ------------------------------<wbr>------------------------------<wbr>-----<br>
> $ opt -debug-pass=Structure -strip-debug -always-inline test.bc -o<br>
> test.bc.inline<br>
> Pass Arguments:  -targetlibinfo -tti -assumption-cache-tracker -basiccg<br>
> -always-inline -verify<br>
> Target Library Information<br>
> Target Transform Information<br>
> Assumption Cache Tracker<br>
>   ModulePass Manager<br>
>     CallGraph Construction<br>
>     Call Graph SCC Pass Manager<br>
>       Inliner for always_inline functions<br>
>       FunctionPass Manager<br>
>         Module Verifier<br>
>     Bitcode Writer<br>
> ------------------------------<wbr>------------------------------<wbr>-----<br>
> ______________________________<wbr>_________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.llvm.org/pipermail/llvm-dev/attachments/20180202/8367c799/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/llvm-dev/<wbr>attachments/20180202/8367c799/<wbr>attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 7<br>
Date: Sat, 03 Feb 2018 00:03:53 +0000<br>
From: David Woodhouse via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: Hans Wennborg <<a href="mailto:hans@chromium.org">hans@chromium.org</a>>, Chandler Carruth<br>
        <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>>,  Rui Ueyama <<a href="mailto:ruiu@google.com">ruiu@google.com</a>>, Reid Kleckner<br>
        <<a href="mailto:rnk@google.com">rnk@google.com</a>><br>
Cc: llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>>, Thomas Gleixner<br>
        <<a href="mailto:tglx@linutronix.de">tglx@linutronix.de</a>>, Guenter Roeck <<a href="mailto:linux@roeck-us.net">linux@roeck-us.net</a>><br>
Subject: Re: [llvm-dev] retpoline mitigation and 6.0<br>
Message-ID: <<a href="mailto:1517616233.31953.83.camel@infradead.org">1517616233.31953.83.camel@<wbr>infradead.org</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
On Thu, 2018-02-01 at 10:10 +0100, Hans Wennborg via llvm-dev wrote:<br>
><br>
> I saw the retpoline mitigation landed in r323155. Are we ready to<br>
> merge this to 6.0, or are there any open issues that we're waiting<br>
> for? Also, were there any followups I should know about? Also,<br>
> release notes please :-)<br>
<br>
Eep, please can we keep the command line option for clang and the thunk<br>
ABI matching what GCC, the Linux kernel and Xen are all doing?<br>
<br>
To say that I am not stunningly keen on<br>
<a href="https://lkml.org/lkml/2018/2/2/975" rel="noreferrer" target="_blank">https://lkml.org/lkml/2018/2/<wbr>2/975</a> would be a bit of an<br>
understatement...<br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: smime.p7s<br>
Type: application/x-pkcs7-signature<br>
Size: 5213 bytes<br>
Desc: not available<br>
URL: <<a href="http://lists.llvm.org/pipermail/llvm-dev/attachments/20180203/1cfad99e/attachment-0001.bin" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/llvm-dev/<wbr>attachments/20180203/1cfad99e/<wbr>attachment-0001.bin</a>><br>
<br>
------------------------------<br>
<br>
Message: 8<br>
Date: Fri, 2 Feb 2018 16:17:27 -0800<br>
From: Galina Kistanova via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: LLVM Dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>>, cfe-commits<br>
        <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>>,  llvm-commits<br>
        <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>><br>
Subject: [llvm-dev] LLVM buildmaster will be updated and restarted<br>
        tonight<br>
Message-ID:<br>
        <<a href="mailto:CAJ8eiNzezmtOOxpay4YQ7427Wh52YyxQZKLK7bOouxjtnqv8pA@mail.gmail.com">CAJ8eiNzezmtOOxpay4YQ7427Wh52<wbr>YyxQZKLK7bOouxjtnqv8pA@mail.<wbr>gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
 Hello everyone,<br>
<br>
LLVM buildmaster will be updated and restarted after 6 PM Pacific time<br>
today.<br>
<br>
Thanks<br>
<br>
Galina<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.llvm.org/pipermail/llvm-dev/attachments/20180202/7d56a5ea/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/llvm-dev/<wbr>attachments/20180202/7d56a5ea/<wbr>attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 9<br>
Date: Sat, 03 Feb 2018 00:23:50 +0000<br>
From: Chandler Carruth via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: David Woodhouse <<a href="mailto:dwmw2@infradead.org">dwmw2@infradead.org</a>><br>
Cc: llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>>, Thomas Gleixner<br>
        <<a href="mailto:tglx@linutronix.de">tglx@linutronix.de</a>>, Guenter Roeck <<a href="mailto:linux@roeck-us.net">linux@roeck-us.net</a>><br>
Subject: Re: [llvm-dev] retpoline mitigation and 6.0<br>
Message-ID:<br>
        <<a href="mailto:CAGCO0KjLtz5C4PfH9mHkVY-DgcFO52KZekzCP9xxz_5wiJCV3g@mail.gmail.com">CAGCO0KjLtz5C4PfH9mHkVY-<wbr>DgcFO52KZekzCP9xxz_5wiJCV3g@<wbr>mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
On Fri, Feb 2, 2018 at 4:03 PM David Woodhouse <<a href="mailto:dwmw2@infradead.org">dwmw2@infradead.org</a>> wrote:<br>
<br>
> On Thu, 2018-02-01 at 10:10 +0100, Hans Wennborg via llvm-dev wrote:<br>
> ><br>
> > I saw the retpoline mitigation landed in r323155. Are we ready to<br>
> > merge this to 6.0, or are there any open issues that we're waiting<br>
> > for? Also, were there any followups I should know about? Also,<br>
> > release notes please :-)<br>
><br>
> Eep, please can we keep the command line option for clang and the thunk<br>
> ABI matching what GCC, the Linux kernel and Xen are all doing?<br>
><br>
> To say that I am not stunningly keen on<br>
> <a href="https://lkml.org/lkml/2018/2/2/975" rel="noreferrer" target="_blank">https://lkml.org/lkml/2018/2/<wbr>2/975</a> would be a bit of an<br>
> understatement...<br>
<br>
<br>
Two aspects to this...<br>
<br>
One, we're somewhat reluctant to guarantee an ABI here. At least I am.<br>
While we don't *expect* rampant divergence here, I don't want this to<br>
become something we cannot change if there are good reasons to do so. We've<br>
already changed the thunks once based on feedback (putting LFENCE after the<br>
PAUSE).<br>
<br>
Given that we don't want this to be a guaranteed part of the ABI, I really<br>
want the thunk names to be specific about which implementation is being<br>
used. For example, if we come up with a new, better thunk interface, we<br>
would want to give it a new name (even if it were just a suffix of "2") so<br>
that we don't get runtime failures. Since LLVM and GCC can't possible<br>
release in sync, IMO they *should* use different names. I asked the GCC<br>
developers to include 'gcc' in the name, but at least the person I asked<br>
was not at all receptive.<br>
<br>
<br>
Two, I actually agree with you about the command line flags. I asked for it<br>
to be '-mretpoline'. I think a short, clear flag is really best, and we've<br>
very publicly documented this technique as 'retpoline'. But the GCC<br>
community has a fairly different design AFAICT... The only embedded thunks<br>
the offer are inline (ours are always out-of-line, even if they aren't<br>
external). Also, they support thunking indirect branches that we don't:<br>
ret. Our feature really is oriented around exposing the retpoline<br>
mitigation, and I don't think there is any demand for the complexity that<br>
would be entailed by generalizing it further. But I'm sure the GCC folks<br>
have a very reasonably different perspective here that make them prefer a<br>
quite different feature (they can thunk rets) and naming scheme.<br>
<br>
<br>
So I don't really know how to fix this. I think there are reasonable<br>
arguments in each direction. IMO, the easiest improvement would be for GCC<br>
to add command line aliases spelled using 'retpoline' for the specific use<br>
case, but keep the more general commandline interface for which they have<br>
reasonable use cases.<br>
<br>
The naming thing I think is essentially by-design so that if we (or you)<br>
need to split apart the implementation, there are distinct names available.<br>
Until then, aliases seem very cheap to maintain?<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.llvm.org/pipermail/llvm-dev/attachments/20180203/223d1983/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/llvm-dev/<wbr>attachments/20180203/223d1983/<wbr>attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 10<br>
Date: Sat, 03 Feb 2018 00:27:13 +0000<br>
From: Chandler Carruth via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: David Woodhouse <<a href="mailto:dwmw2@infradead.org">dwmw2@infradead.org</a>><br>
Cc: llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>>, Thomas Gleixner<br>
        <<a href="mailto:tglx@linutronix.de">tglx@linutronix.de</a>>, Guenter Roeck <<a href="mailto:linux@roeck-us.net">linux@roeck-us.net</a>><br>
Subject: Re: [llvm-dev] retpoline mitigation and 6.0<br>
Message-ID:<br>
        <<wbr>CAGCO0KjoxZFXZVfKQR0dFVH6Kzw9=<a href="mailto:JX-9c-rx-pLeWLpru3j2A@mail.gmail.com"><wbr>JX-9c-rx-pLeWLpru3j2A@mail.<wbr>gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
On Fri, Feb 2, 2018 at 4:23 PM Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>><br>
wrote:<br>
<br>
> On Fri, Feb 2, 2018 at 4:03 PM David Woodhouse <<a href="mailto:dwmw2@infradead.org">dwmw2@infradead.org</a>><br>
> wrote:<br>
><br>
>> On Thu, 2018-02-01 at 10:10 +0100, Hans Wennborg via llvm-dev wrote:<br>
>> ><br>
>> > I saw the retpoline mitigation landed in r323155. Are we ready to<br>
>> > merge this to 6.0, or are there any open issues that we're waiting<br>
>> > for? Also, were there any followups I should know about? Also,<br>
>> > release notes please :-)<br>
>><br>
>> Eep, please can we keep the command line option for clang and the thunk<br>
>> ABI matching what GCC, the Linux kernel and Xen are all doing?<br>
>><br>
>> To say that I am not stunningly keen on<br>
>> <a href="https://lkml.org/lkml/2018/2/2/975" rel="noreferrer" target="_blank">https://lkml.org/lkml/2018/2/<wbr>2/975</a> would be a bit of an<br>
>> understatement...<br>
><br>
><br>
A minor note on this specific patch:<br>
<br>
You don't need '-mretpoline -mretpoline-external-thunk'. The second flag<br>
implies the first. (Or should, if not, its a bug.) Our goal was that you<br>
needed exactly one flag to enable this in whatever form.<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.llvm.org/pipermail/llvm-dev/attachments/20180203/f0d1405f/attachment.html" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/llvm-dev/<wbr>attachments/20180203/f0d1405f/<wbr>attachment.html</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
______________________________<wbr>_________________<br>
llvm-dev mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br>
<br>
------------------------------<br>
<br>
End of llvm-dev Digest, Vol 164, Issue 6<br>
******************************<wbr>**********<br>
</blockquote></div><br></div>