<div dir="ltr"><div><div>I've made reasonable progress with this. CallingConv.td appears to be a description of what the call lowering is going to do, not a means of altering the DAG. The target functions LowerCall, LowerFormalArguments, LowerReturn control the DAG modifications.<br><br></div>Intercepting the SDValues en route to and from the call in these three functions appears to suffice. Looks a bit hackish though, better suggestions still welcome.<br><br></div>Cheers<br><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 10, 2017 at 4:52 PM, 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. Re: PHI nodes and connected ICMp<br>
      (Anastasiya Ruzhanskaya via llvm-dev)<br>
   2. Re: PHI nodes and connected ICMp<br>
      (Anastasiya Ruzhanskaya via llvm-dev)<br>
   3. Custom call lowering - where? (Jon Chesterfield via llvm-dev)<br>
   4. Re: [poison] re: is select-of-select to logic+select allowed<br>
      ? (Dan Liew via llvm-dev)<br>
   5. llvm-5.0: couldn't build libomptarget (Siegmar Gross via llvm-dev)<br>
   6. Re: llvm-5.0: couldn't build libomptarget<br>
      (Jonas Hahnfeld via llvm-dev)<br>
   7. Re: InstCombine GEP (Nuno Lopes via llvm-dev)<br>
   8. Re: [ThinLTO] Suggestions on how to traverse SCCs in the<br>
      Module Summary Index bottom up (Charles Saternos via llvm-dev)<br>
   9. Re: Relicensing: Revised Developer Policy<br>
      (Rafael Avila de Espindola via llvm-dev)<br>
  10. Re: Relicensing: Revised Developer Policy<br>
      (Chris Lattner via llvm-dev)<br>
<br>
<br>
------------------------------<wbr>------------------------------<wbr>----------<br>
<br>
Message: 1<br>
Date: Thu, 10 Aug 2017 10:00:49 +0200<br>
From: Anastasiya Ruzhanskaya via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: Sanjoy Das <<a href="mailto:sanjoy@google.com">sanjoy@google.com</a>><br>
Cc: LLVM Developers Mailing List <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
Subject: Re: [llvm-dev] PHI nodes and connected ICMp<br>
Message-ID:<br>
        <<a href="mailto:CAH7gUZYfXvymt7gYfyqg1-szb2FKF6tJ7_tNhzWP3jpPVGqzQw@mail.gmail.com">CAH7gUZYfXvymt7gYfyqg1-<wbr>szb2FKF6tJ7_tNhzWP3jpPVGqzQw@<wbr>mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Maybe you, as a person connected with this theme, have some<br>
recommendations? Analyzing SCEV didn't help me, as I am not able to extract<br>
information, that is crucial for me.<br>
<br>
2017-08-10 9:55 GMT+02:00 Anastasiya Ruzhanskaya <<br>
<a href="mailto:anastasiya.ruzhanskaya@frtk.ru">anastasiya.ruzhanskaya@frtk.ru</a><wbr>>:<br>
<br>
> Hi!<br>
> By only two cases I mean , that in exiting block when computing the<br>
> condition related to PHI node I can expect only icmp on one of incoming<br>
> values or on phi node itself... I tried to come up with some more complex<br>
> examples but I always receive only these two cases, that is why I am asking.<br>
><br>
> This problem still relates to the problem of all induction, cumulative and<br>
> so on variables in loop. SCEV didn't help me, as it doesn't provide me with<br>
> the value against which I am comparing when exiting, and when it cannot<br>
> detect loop trip count directly I need this "exiting value". That is why I<br>
> am searching for all compare instructions in exiting blocks that are using<br>
> either "phi" itself or "incoming value".<br>
><br>
> 2017-08-10 9:47 GMT+02:00 Sanjoy Das <<a href="mailto:sanjoy@google.com">sanjoy@google.com</a>>:<br>
><br>
>> It may be helpful to see the incoming value as the incoming value of<br>
>> the "next" PHI (i.e. the instance of the PHI node on the next<br>
>> iteration).  With that interpretation in mind, you can see that<br>
>> comparing the PHI node itself is equivalent to:<br>
>><br>
>> do {<br>
>>   ...<br>
>>   // I is the value that becomes the PHI node<br>
>> } while (I++ < N);<br>
>><br>
>> and comparing with the incoming value of the PHI is equivalent to:<br>
>><br>
>> do {<br>
>>   ...<br>
>> } while (++I < N);<br>
>><br>
>><br>
>> I can't think of any fundamental reason why one would be preferred for<br>
>> increasing induction variables and the other would be preferred for<br>
>> decreasing induction variables.  I suspect what you're seeing is just<br>
>> an artifact of how clang lowers these loops.<br>
>><br>
>> I'm also not sure what you mean by "I can have only two cases".   Loop<br>
>> backedge conditions can be arbitrarily complex, if that's what you're<br>
>> asking.<br>
>><br>
>> -- Sanjoy<br>
>><br>
>><br>
>> On Thu, Aug 10, 2017 at 12:34 AM, Anastasiya Ruzhanskaya via llvm-dev<br>
>> <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
>> > Hello,<br>
>> > I have one more question about how phi nodes and their corresponding<br>
>> ICmp<br>
>> > instructions are associated. maybe it is simple, but at first I thought<br>
>> that<br>
>> > we always compare against one of incoming value. Is it true that  I can<br>
>> have<br>
>> > only  two cases:<br>
>> > %indvars.iv = phi i64 [ %indvars.iv.next, %1 ], [ 0, %0 ]<br>
>> > ...<br>
>> > %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1<br>
>> > %exitcond = icmp eq i64 %indvars.iv.next, 32<br>
>> ><br>
>> ><br>
>> > and<br>
>> ><br>
>> > %i.11 = phi i32 [ %<a href="http://i.11.be" rel="noreferrer" target="_blank">i.11.be</a>, %.backedge ], [ 32, %1 ]<br>
>> > ...<br>
>> > %13 = icmp sgt i32 %i.11, 3<br>
>> > ?<br>
>> > In the first one we always have icmp on the incoming value after<br>
>> addition,<br>
>> > multiplication and so on.<br>
>> > In the second - we compare at first against our phi variable and then<br>
>> > perform operations. I have noticed, that the first case correspond to<br>
>> "up"<br>
>> > operations - +=, *= ans do on, the second - to "down" : -=, /= and so<br>
>> on.<br>
>> > But maybe it depends on logic of the cycle too... So, are their two<br>
>> cases :<br>
>> > comparing in exiting block against PHI variable or against one of its'<br>
>> > incoming value?<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>
>><br>
><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.llvm.org/pipermail/llvm-dev/attachments/20170810/87946d0c/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/llvm-dev/<wbr>attachments/20170810/87946d0c/<wbr>attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Thu, 10 Aug 2017 10:27:47 +0200<br>
From: Anastasiya Ruzhanskaya via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: Sanjoy Das <<a href="mailto:sanjoy@google.com">sanjoy@google.com</a>><br>
Cc: LLVM Developers Mailing List <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
Subject: Re: [llvm-dev] PHI nodes and connected ICMp<br>
Message-ID:<br>
        <CAH7gUZYv98MNhyWpR=wxk2=_<wbr>3YKSaCfP-AF8hn7qx7=<a href="mailto:LYam4LA@mail.gmail.com">LYam4LA@<wbr>mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Also, even when not using canonical induction variables, and extracting max<br>
backedge taken count, then I can't determine to which phi instruction ( if<br>
I have many of them in cycle) this backedge taken count relates to (as Loop<br>
can only provide me with canonical variable and SCEV gives a description of<br>
PHI). Or maybe again I didn't find an appropriate method to extract this<br>
phi node, which gives this count.<br>
<br>
2017-08-10 10:00 GMT+02:00 Anastasiya Ruzhanskaya <<br>
<a href="mailto:anastasiya.ruzhanskaya@frtk.ru">anastasiya.ruzhanskaya@frtk.ru</a><wbr>>:<br>
<br>
> Maybe you, as a person connected with this theme, have some<br>
> recommendations? Analyzing SCEV didn't help me, as I am not able to extract<br>
> information, that is crucial for me.<br>
><br>
> 2017-08-10 9:55 GMT+02:00 Anastasiya Ruzhanskaya <<br>
> <a href="mailto:anastasiya.ruzhanskaya@frtk.ru">anastasiya.ruzhanskaya@frtk.ru</a><wbr>>:<br>
><br>
>> Hi!<br>
>> By only two cases I mean , that in exiting block when computing the<br>
>> condition related to PHI node I can expect only icmp on one of incoming<br>
>> values or on phi node itself... I tried to come up with some more complex<br>
>> examples but I always receive only these two cases, that is why I am asking.<br>
>><br>
>> This problem still relates to the problem of all induction, cumulative<br>
>> and so on variables in loop. SCEV didn't help me, as it doesn't provide me<br>
>> with the value against which I am comparing when exiting, and when it<br>
>> cannot detect loop trip count directly I need this "exiting value". That is<br>
>> why I am searching for all compare instructions in exiting blocks that are<br>
>> using either "phi" itself or "incoming value".<br>
>><br>
>> 2017-08-10 9:47 GMT+02:00 Sanjoy Das <<a href="mailto:sanjoy@google.com">sanjoy@google.com</a>>:<br>
>><br>
>>> It may be helpful to see the incoming value as the incoming value of<br>
>>> the "next" PHI (i.e. the instance of the PHI node on the next<br>
>>> iteration).  With that interpretation in mind, you can see that<br>
>>> comparing the PHI node itself is equivalent to:<br>
>>><br>
>>> do {<br>
>>>   ...<br>
>>>   // I is the value that becomes the PHI node<br>
>>> } while (I++ < N);<br>
>>><br>
>>> and comparing with the incoming value of the PHI is equivalent to:<br>
>>><br>
>>> do {<br>
>>>   ...<br>
>>> } while (++I < N);<br>
>>><br>
>>><br>
>>> I can't think of any fundamental reason why one would be preferred for<br>
>>> increasing induction variables and the other would be preferred for<br>
>>> decreasing induction variables.  I suspect what you're seeing is just<br>
>>> an artifact of how clang lowers these loops.<br>
>>><br>
>>> I'm also not sure what you mean by "I can have only two cases".   Loop<br>
>>> backedge conditions can be arbitrarily complex, if that's what you're<br>
>>> asking.<br>
>>><br>
>>> -- Sanjoy<br>
>>><br>
>>><br>
>>> On Thu, Aug 10, 2017 at 12:34 AM, Anastasiya Ruzhanskaya via llvm-dev<br>
>>> <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
>>> > Hello,<br>
>>> > I have one more question about how phi nodes and their corresponding<br>
>>> ICmp<br>
>>> > instructions are associated. maybe it is simple, but at first I<br>
>>> thought that<br>
>>> > we always compare against one of incoming value. Is it true that  I<br>
>>> can have<br>
>>> > only  two cases:<br>
>>> > %indvars.iv = phi i64 [ %indvars.iv.next, %1 ], [ 0, %0 ]<br>
>>> > ...<br>
>>> > %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1<br>
>>> > %exitcond = icmp eq i64 %indvars.iv.next, 32<br>
>>> ><br>
>>> ><br>
>>> > and<br>
>>> ><br>
>>> > %i.11 = phi i32 [ %<a href="http://i.11.be" rel="noreferrer" target="_blank">i.11.be</a>, %.backedge ], [ 32, %1 ]<br>
>>> > ...<br>
>>> > %13 = icmp sgt i32 %i.11, 3<br>
>>> > ?<br>
>>> > In the first one we always have icmp on the incoming value after<br>
>>> addition,<br>
>>> > multiplication and so on.<br>
>>> > In the second - we compare at first against our phi variable and then<br>
>>> > perform operations. I have noticed, that the first case correspond to<br>
>>> "up"<br>
>>> > operations - +=, *= ans do on, the second - to "down" : -=, /= and so<br>
>>> on.<br>
>>> > But maybe it depends on logic of the cycle too... So, are their two<br>
>>> cases :<br>
>>> > comparing in exiting block against PHI variable or against one of its'<br>
>>> > incoming value?<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>
>>><br>
>><br>
>><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.llvm.org/pipermail/llvm-dev/attachments/20170810/a6ae6f34/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/llvm-dev/<wbr>attachments/20170810/a6ae6f34/<wbr>attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Thu, 10 Aug 2017 09:49:05 +0100<br>
From: Jon Chesterfield 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] Custom call lowering - where?<br>
Message-ID:<br>
        <CAOUYtQAUBdRgWzgXx=vDmOUe=7-<wbr>DEUXd1A1=<a href="mailto:J0vuLTzn-CywTA@mail.gmail.com">J0vuLTzn-CywTA@mail.<wbr>gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
The CallingConv.td file can specify CCCustom and ISelLowering has<br>
LowerFormalArguments. The existing uses of CCCustom pick a register to pass<br>
an unmodified argument in and LowerFormalArguments is mostly concerned with<br>
marking registers as live, though I think provides enough information that<br>
I can munge the DAG there.<br>
<br>
I would like to pass a scalar type (marked as a register class) in a vector<br>
register. I essentially want to wrap the argument in a SCALAR_TO_VECTOR ISD<br>
node before calling a function and unwrap it using EXTRACT_VECTOR_ELT or<br>
similar within the function.<br>
<br>
Where should I introduce these additional nodes, or should it be possible<br>
to achieve this via CCCustom?<br>
<br>
Cheers!<br>
<br>
Jon<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.llvm.org/pipermail/llvm-dev/attachments/20170810/24172886/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/llvm-dev/<wbr>attachments/20170810/24172886/<wbr>attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Thu, 10 Aug 2017 09:59:06 +0100<br>
From: Dan Liew via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: Peter Lawrence <<a href="mailto:peterl95124@sbcglobal.net">peterl95124@sbcglobal.net</a>><br>
Cc: llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
Subject: Re: [llvm-dev] [poison] re: is select-of-select to<br>
        logic+select allowed ?<br>
Message-ID:<br>
        <<a href="mailto:CAJ7DczHLK0VnCmQpAUGeJWR5%2BrFQTYH8oi0oZFbnaqVnOSt%2BGg@mail.gmail.com">CAJ7DczHLK0VnCmQpAUGeJWR5+<wbr>rFQTYH8oi0oZFbnaqVnOSt+Gg@<wbr>mail.gmail.com</a>><br>
Content-Type: text/plain; charset="UTF-8"<br>
<br>
On 7 June 2017 at 04:25, Peter Lawrence via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> Nuno,<br>
> Sanjoy,<br>
>             Can you provide some actual C source code examples that show how<br>
> End-to-end-miscompilations have resulted from the presence of “UB” in<br>
> Select statements ?<br>
<br>
We hit an example of this recently. See<br>
<a href="https://bugs.llvm.org/show_bug.cgi?id=34133" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_<wbr>bug.cgi?id=34133</a><br>
<br>
<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Thu, 10 Aug 2017 11:52:52 +0200<br>
From: Siegmar Gross 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] llvm-5.0: couldn't build libomptarget<br>
Message-ID:<br>
        <<a href="mailto:486b1da4-c287-03ed-ccbc-71f27b8675c2@informatik.hs-fulda.de">486b1da4-c287-03ed-ccbc-<wbr>71f27b8675c2@informatik.hs-<wbr>fulda.de</a>><br>
Content-Type: text/plain; charset=utf-8; format=flowed<br>
<br>
Hi,<br>
<br>
I've built llvm-5.0 with some projects (gcc-5.3.0 necessary for CUDA)<br>
on my "SUSE Linux Enterprise Server 12.2 (x86_64)". Unfortunately,<br>
the project libomptarget wasn't built, while I could build it some<br>
weeks ago in llvm-trunk.<br>
<br>
<br>
loki fd1026 107 clang -v<br>
clang version 5.0.0 (branches/release_50 310550)<br>
Target: x86_64-unknown-linux-gnu<br>
Thread model: posix<br>
InstalledDir: /usr/local/llvm-5.0/bin<br>
Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-<wbr>linux/4.8<br>
Selected GCC installation: /usr/lib64/gcc/x86_64-suse-<wbr>linux/4.8<br>
Candidate multilib: .;@m64<br>
Candidate multilib: 32;@m32<br>
Selected multilib: .;@m64<br>
Found CUDA installation: /usr/local/cuda, version 8.0<br>
<br>
loki fd1026 108 find /usr/local/llvm-5.0/ -name '*omptarget*'<br>
loki fd1026 109 tar zvft /usr/local/llvm-trunk_working.<wbr>tar.gz | grep omptarget<br>
-rwxr-xr-x root/root     20176 2017-07-17 17:56<br>
llvm-trunk/lib64/<a href="http://libomptarget.rtl.x86_64.so" rel="noreferrer" target="_blank">libomptarget.<wbr>rtl.x86_64.so</a><br>
-rwxr-xr-x root/root     25840 2017-07-17 17:56<br>
llvm-trunk/lib64/<a href="http://libomptarget.rtl.cuda.so" rel="noreferrer" target="_blank">libomptarget.<wbr>rtl.cuda.so</a><br>
-rwxr-xr-x root/root     81360 2017-07-17 17:56 llvm-trunk/lib64/libomptarget.<wbr>so<br>
loki fd1026 110<br>
<br>
<br>
I've used the following commands to configure and build everything.<br>
<br>
svn co <a href="http://llvm.org/svn/llvm-project/llvm/branches/release_50" rel="noreferrer" target="_blank">http://llvm.org/svn/llvm-<wbr>project/llvm/branches/release_<wbr>50</a> llvm<br>
cd llvm/tools<br>
svn co <a href="http://llvm.org/svn/llvm-project/cfe/branches/release_50" rel="noreferrer" target="_blank">http://llvm.org/svn/llvm-<wbr>project/cfe/branches/release_<wbr>50</a> clang<br>
svn co <a href="http://llvm.org/svn/llvm-project/polly/branches/release_50" rel="noreferrer" target="_blank">http://llvm.org/svn/llvm-<wbr>project/polly/branches/<wbr>release_50</a> polly<br>
cd clang/tools<br>
svn co <a href="http://llvm.org/svn/llvm-project/clang-tools-extra/branches/release_50/" rel="noreferrer" target="_blank">http://llvm.org/svn/llvm-<wbr>project/clang-tools-extra/<wbr>branches/release_50/</a> extra<br>
cd ../../../projects<br>
svn co <a href="http://llvm.org/svn/llvm-project/compiler-rt/branches/release_50" rel="noreferrer" target="_blank">http://llvm.org/svn/llvm-<wbr>project/compiler-rt/branches/<wbr>release_50</a> compiler-rt<br>
svn co <a href="http://llvm.org/svn/llvm-project/openmp/branches/release_50" rel="noreferrer" target="_blank">http://llvm.org/svn/llvm-<wbr>project/openmp/branches/<wbr>release_50</a> openmp<br>
svn co <a href="https://github.com/clang-ykt/openmp" rel="noreferrer" target="_blank">https://github.com/clang-ykt/<wbr>openmp</a> libomptarget<br>
<br>
<br>
mkdir build<br>
cd build<br>
cmake -DCMAKE_INSTALL_PREFIX:PATH=/<wbr>usr/local/${LLVM_VERSION} \<br>
   -GNinja \<br>
   -DLLVM_TARGETS_TO_BUILD:<wbr>STRING="NVPTX;X86" \<br>
   -DCMAKE_BUILD_TYPE:STRING="<wbr>Release" \<br>
   -DLLVM_PARALLEL_COMPILE_JOBS:<wbr>STRING="4" \<br>
   -DLLVM_PARALLEL_LINK_JOBS:<wbr>STRING="4" \<br>
   -DCMAKE_C_COMPILER:STRING="${<wbr>DIRPREFIX_PROG}/${GCCDIR}/bin/<wbr>gcc" \<br>
   -DCMAKE_C_FLAGS:STRING="-m64 -I/usr/local/valgrind/include" \<br>
   -DCMAKE_CXX_COMPILER:STRING="$<wbr>{DIRPREFIX_PROG}/${GCCDIR}/<wbr>bin/g++" \<br>
   -DCMAKE_CXX_FLAGS:STRING="-m64 -I/usr/local/valgrind/include" \<br>
   -DCMAKE_EXE_LINKER_FLAGS:<wbr>STRING="-m64" \<br>
   -DLLVM_LIBDIR_SUFFIX:STRING="<wbr>64" \<br>
   -DLLVM_POLLY_LINK_INTO_TOOLS:<wbr>BOOL=ON \<br>
<br>
-DLIBOMPTARGET_DEP_LIBELF_<wbr>INCLUDE_DIR:STRING="/usr/<wbr>local/elfutils-0.169/include" \<br>
<br>
-DLIBOMPTARGET_DEP_LIBELF_<wbr>LIBRARIES:STRING="/usr/local/<wbr>elfutils-0.169/lib64/libelf.<wbr>so"<br>
\<br>
   -DLIBOMPTARGET_DEP_LIBFFI_<wbr>INCLUDE_DIR:STRING="/usr/<wbr>include" \<br>
   -DLIBOMPTARGET_DEP_LIBFFI_<wbr>LIBRARIES:STRING="/usr/lib64/<wbr>libffi.so" \<br>
   -DCUDA_INCLUDE_DIRS:STRING="/<wbr>usr/local/cuda/include" \<br>
   -DCUDA_LIBRARIES:STRING="/usr/<wbr>local/cuda/lib64/libcudart.so" \<br>
   -DBUILD_SHARED_LIBS:BOOL=ON \<br>
   ../llvm \<br>
   |& tee log.cmake<br>
<br>
ninja |& tee log.ninja-build<br>
ninja check |& tee log.ninja-check<br>
ninja install |& tee log.ninja-install<br>
<br>
loki build 217 tail -11 log.cmake<br>
   Manually-specified variables were not used by the project:<br>
     CUDA_INCLUDE_DIRS<br>
     CUDA_LIBRARIES<br>
     LIBOMPTARGET_DEP_LIBELF_<wbr>INCLUDE_DIR<br>
     LIBOMPTARGET_DEP_LIBELF_<wbr>LIBRARIES<br>
     LIBOMPTARGET_DEP_LIBFFI_<wbr>INCLUDE_DIR<br>
     LIBOMPTARGET_DEP_LIBFFI_<wbr>LIBRARIES<br>
-- Build files have been written to: /export2/src/llvm-5.0/build<br>
<br>
loki build 218 grep -i omptarget log.*<br>
log.cmake:    LIBOMPTARGET_DEP_LIBELF_<wbr>INCLUDE_DIR<br>
log.cmake:    LIBOMPTARGET_DEP_LIBELF_<wbr>LIBRARIES<br>
log.cmake:    LIBOMPTARGET_DEP_LIBFFI_<wbr>INCLUDE_DIR<br>
log.cmake:    LIBOMPTARGET_DEP_LIBFFI_<wbr>LIBRARIES<br>
loki build 219<br>
<br>
<br>
Isn't libomptarget supported any longer? Do I have to change something in<br>
my checkout or configuration? I would be grateful if somebody can answer<br>
my questions. Please let me know if you need anything else. Thank you very<br>
much for any help in advance.<br>
<br>
<br>
Kind regards<br>
<br>
Siegmar<br>
<br>
<br>
------------------------------<br>
<br>
Message: 6<br>
Date: Thu, 10 Aug 2017 12:17:39 +0200<br>
From: Jonas Hahnfeld via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: Siegmar Gross <<a href="mailto:siegmar.gross@informatik.hs-fulda.de">siegmar.gross@informatik.hs-<wbr>fulda.de</a>><br>
Cc: <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>, <a href="mailto:openmp-dev@lists.llvm.org">openmp-dev@lists.llvm.org</a><br>
Subject: Re: [llvm-dev] llvm-5.0: couldn't build libomptarget<br>
Message-ID: <<a href="mailto:726a0e53c14e423615f81e49985af5d9@hahnjo.de">726a0e53c14e423615f81e49985af<wbr>5d9@hahnjo.de</a>><br>
Content-Type: text/plain; charset=US-ASCII; format=flowed<br>
<br>
Hi,<br>
<br>
+openmp-dev for discussion about runtime libraries.<br>
<br>
libomptarget has been disabled until the tests pass and that change has<br>
been merged for 5.0.<br>
If you really want it to build specify -DOPENMP_ENABLE_LIBOMPTARGET=<wbr>On.<br>
As a side node: Currently, the committed code only allows offloading to<br>
the host, not yet to NVIDIA GPUs.<br>
<br>
Cheers,<br>
Jonas<br>
<br>
Am 2017-08-10 11:52, schrieb Siegmar Gross via llvm-dev:<br>
> Hi,<br>
><br>
> I've built llvm-5.0 with some projects (gcc-5.3.0 necessary for CUDA)<br>
> on my "SUSE Linux Enterprise Server 12.2 (x86_64)". Unfortunately,<br>
> the project libomptarget wasn't built, while I could build it some<br>
> weeks ago in llvm-trunk.<br>
><br>
><br>
> loki fd1026 107 clang -v<br>
> clang version 5.0.0 (branches/release_50 310550)<br>
> Target: x86_64-unknown-linux-gnu<br>
> Thread model: posix<br>
> InstalledDir: /usr/local/llvm-5.0/bin<br>
> Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-<wbr>linux/4.8<br>
> Selected GCC installation: /usr/lib64/gcc/x86_64-suse-<wbr>linux/4.8<br>
> Candidate multilib: .;@m64<br>
> Candidate multilib: 32;@m32<br>
> Selected multilib: .;@m64<br>
> Found CUDA installation: /usr/local/cuda, version 8.0<br>
><br>
> loki fd1026 108 find /usr/local/llvm-5.0/ -name '*omptarget*'<br>
> loki fd1026 109 tar zvft /usr/local/llvm-trunk_working.<wbr>tar.gz | grep<br>
> omptarget<br>
> -rwxr-xr-x root/root     20176 2017-07-17 17:56<br>
> llvm-trunk/lib64/<a href="http://libomptarget.rtl.x86_64.so" rel="noreferrer" target="_blank">libomptarget.<wbr>rtl.x86_64.so</a><br>
> -rwxr-xr-x root/root     25840 2017-07-17 17:56<br>
> llvm-trunk/lib64/<a href="http://libomptarget.rtl.cuda.so" rel="noreferrer" target="_blank">libomptarget.<wbr>rtl.cuda.so</a><br>
> -rwxr-xr-x root/root     81360 2017-07-17 17:56<br>
> llvm-trunk/lib64/libomptarget.<wbr>so<br>
> loki fd1026 110<br>
><br>
><br>
> I've used the following commands to configure and build everything.<br>
><br>
> svn co <a href="http://llvm.org/svn/llvm-project/llvm/branches/release_50" rel="noreferrer" target="_blank">http://llvm.org/svn/llvm-<wbr>project/llvm/branches/release_<wbr>50</a> llvm<br>
> cd llvm/tools<br>
> svn co <a href="http://llvm.org/svn/llvm-project/cfe/branches/release_50" rel="noreferrer" target="_blank">http://llvm.org/svn/llvm-<wbr>project/cfe/branches/release_<wbr>50</a> clang<br>
> svn co <a href="http://llvm.org/svn/llvm-project/polly/branches/release_50" rel="noreferrer" target="_blank">http://llvm.org/svn/llvm-<wbr>project/polly/branches/<wbr>release_50</a> polly<br>
> cd clang/tools<br>
> svn co<br>
> <a href="http://llvm.org/svn/llvm-project/clang-tools-extra/branches/release_50/" rel="noreferrer" target="_blank">http://llvm.org/svn/llvm-<wbr>project/clang-tools-extra/<wbr>branches/release_50/</a><br>
> extra<br>
> cd ../../../projects<br>
> svn co<br>
> <a href="http://llvm.org/svn/llvm-project/compiler-rt/branches/release_50" rel="noreferrer" target="_blank">http://llvm.org/svn/llvm-<wbr>project/compiler-rt/branches/<wbr>release_50</a><br>
> compiler-rt<br>
> svn co <a href="http://llvm.org/svn/llvm-project/openmp/branches/release_50" rel="noreferrer" target="_blank">http://llvm.org/svn/llvm-<wbr>project/openmp/branches/<wbr>release_50</a><br>
> openmp<br>
> svn co <a href="https://github.com/clang-ykt/openmp" rel="noreferrer" target="_blank">https://github.com/clang-ykt/<wbr>openmp</a> libomptarget<br>
><br>
><br>
> mkdir build<br>
> cd build<br>
> cmake -DCMAKE_INSTALL_PREFIX:PATH=/<wbr>usr/local/${LLVM_VERSION} \<br>
>   -GNinja \<br>
>   -DLLVM_TARGETS_TO_BUILD:<wbr>STRING="NVPTX;X86" \<br>
>   -DCMAKE_BUILD_TYPE:STRING="<wbr>Release" \<br>
>   -DLLVM_PARALLEL_COMPILE_JOBS:<wbr>STRING="4" \<br>
>   -DLLVM_PARALLEL_LINK_JOBS:<wbr>STRING="4" \<br>
>   -DCMAKE_C_COMPILER:STRING="${<wbr>DIRPREFIX_PROG}/${GCCDIR}/bin/<wbr>gcc" \<br>
>   -DCMAKE_C_FLAGS:STRING="-m64 -I/usr/local/valgrind/include" \<br>
>   -DCMAKE_CXX_COMPILER:STRING="$<wbr>{DIRPREFIX_PROG}/${GCCDIR}/<wbr>bin/g++" \<br>
>   -DCMAKE_CXX_FLAGS:STRING="-m64 -I/usr/local/valgrind/include" \<br>
>   -DCMAKE_EXE_LINKER_FLAGS:<wbr>STRING="-m64" \<br>
>   -DLLVM_LIBDIR_SUFFIX:STRING="<wbr>64" \<br>
>   -DLLVM_POLLY_LINK_INTO_TOOLS:<wbr>BOOL=ON \<br>
><br>
> -DLIBOMPTARGET_DEP_LIBELF_<wbr>INCLUDE_DIR:STRING="/usr/<wbr>local/elfutils-0.169/include"<br>
> \<br>
><br>
> -DLIBOMPTARGET_DEP_LIBELF_<wbr>LIBRARIES:STRING="/usr/local/<wbr>elfutils-0.169/lib64/libelf.<wbr>so"<br>
> \<br>
>   -DLIBOMPTARGET_DEP_LIBFFI_<wbr>INCLUDE_DIR:STRING="/usr/<wbr>include" \<br>
>   -DLIBOMPTARGET_DEP_LIBFFI_<wbr>LIBRARIES:STRING="/usr/lib64/<wbr>libffi.so" \<br>
>   -DCUDA_INCLUDE_DIRS:STRING="/<wbr>usr/local/cuda/include" \<br>
>   -DCUDA_LIBRARIES:STRING="/usr/<wbr>local/cuda/lib64/libcudart.so" \<br>
>   -DBUILD_SHARED_LIBS:BOOL=ON \<br>
>   ../llvm \<br>
>   |& tee log.cmake<br>
><br>
> ninja |& tee log.ninja-build<br>
> ninja check |& tee log.ninja-check<br>
> ninja install |& tee log.ninja-install<br>
><br>
> loki build 217 tail -11 log.cmake<br>
>   Manually-specified variables were not used by the project:<br>
>     CUDA_INCLUDE_DIRS<br>
>     CUDA_LIBRARIES<br>
>     LIBOMPTARGET_DEP_LIBELF_<wbr>INCLUDE_DIR<br>
>     LIBOMPTARGET_DEP_LIBELF_<wbr>LIBRARIES<br>
>     LIBOMPTARGET_DEP_LIBFFI_<wbr>INCLUDE_DIR<br>
>     LIBOMPTARGET_DEP_LIBFFI_<wbr>LIBRARIES<br>
> -- Build files have been written to: /export2/src/llvm-5.0/build<br>
><br>
> loki build 218 grep -i omptarget log.*<br>
> log.cmake:    LIBOMPTARGET_DEP_LIBELF_<wbr>INCLUDE_DIR<br>
> log.cmake:    LIBOMPTARGET_DEP_LIBELF_<wbr>LIBRARIES<br>
> log.cmake:    LIBOMPTARGET_DEP_LIBFFI_<wbr>INCLUDE_DIR<br>
> log.cmake:    LIBOMPTARGET_DEP_LIBFFI_<wbr>LIBRARIES<br>
> loki build 219<br>
><br>
><br>
> Isn't libomptarget supported any longer? Do I have to change something<br>
> in<br>
> my checkout or configuration? I would be grateful if somebody can<br>
> answer<br>
> my questions. Please let me know if you need anything else. Thank you<br>
> very<br>
> much for any help in advance.<br>
><br>
><br>
> Kind regards<br>
><br>
> Siegmar<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>
<br>
------------------------------<br>
<br>
Message: 7<br>
Date: Thu, 10 Aug 2017 12:01:55 +0100<br>
From: Nuno Lopes via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: "Nema, Ashutosh" <<a href="mailto:Ashutosh.Nema@amd.com">Ashutosh.Nema@amd.com</a>>, "llvm-dev"<br>
        <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
Subject: Re: [llvm-dev] InstCombine GEP<br>
Message-ID: <<wbr>EBC09CB892C8466D8845FA6ACB695E<wbr>09@PC07655><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
I agree that’s a bit strange.<br>
I dunno about SROA, but BasicAA certainly knows about structs and unions.  I don’t think right now it has any problem handling those. (and if there’s some case it doesn’t, shouldn’t be hard to fix)<br>
Also, BasicAA has special rules for arrays of structs that can conclude no-alias even if some of the indexes aren’t constants. So you could even turn those no-alias results into may-alias; instcombine is losing information here.<br>
<br>
I guess you could lookup the history to see why/when that transformation was introduced if noone remembers.<br>
<br>
Nuno<br>
<br>
<br>
<br>
From: Nema, Ashutosh via llvm-dev<br>
Sent: Thursday, August 10, 2017 8:22 AM<br>
To: llvm-dev<br>
Subject: [llvm-dev] InstCombine GEP<br>
<br>
Hi,<br>
<br>
<br>
<br>
I have a doubt with GEP transformation in the instruction-combiner.<br>
<br>
<br>
<br>
Consider below test-case:<br>
<br>
struct ABC {<br>
<br>
  int A;<br>
<br>
  int B[100];<br>
<br>
  struct XYZ {<br>
<br>
    int X;<br>
<br>
    int Y[100];<br>
<br>
  } OBJ;<br>
<br>
};<br>
<br>
void Setup(struct ABC *);<br>
<br>
int foo(int offset) {<br>
<br>
  struct ABC *Ptr = malloc(sizeof(struct ABC));<br>
<br>
  Setup(Ptr);<br>
<br>
  return Ptr->OBJ.X + Ptr->OBJ.Y[33];<br>
<br>
}<br>
<br>
<br>
<br>
Generated IR for the test-case:<br>
<br>
define i32 @foo(i32 %offset) local_unnamed_addr #0 {<br>
<br>
entry:<br>
<br>
  %call = tail call i8* @malloc(i64 808)<br>
<br>
  %0 = bitcast i8* %call to %struct.ABC*<br>
<br>
  tail call void @Setup(%struct.ABC* %0) #3<br>
<br>
  %OBJ = getelementptr inbounds i8, i8* %call, i64 404<br>
<br>
  %X = bitcast i8* %OBJ to i32*<br>
<br>
  %1 = load i32, i32* %X, align 4, !tbaa !2<br>
<br>
  %arrayidx = getelementptr inbounds i8, i8* %call, i64 540<br>
<br>
  %2 = bitcast i8* %arrayidx to i32*<br>
<br>
  %3 = load i32, i32* %2, align 4, !tbaa !8<br>
<br>
  %add = add nsw i32 %3, %1<br>
<br>
  ret i32 %add<br>
<br>
}<br>
<br>
<br>
<br>
Instruction combiner transforms GEPs to i8 type, because of this the GEP offset looks weird and the actual type information is missing on GEP.<br>
<br>
I expected the GEPs to use the actual type offsetting for which the memory is allocated.<br>
<br>
<br>
<br>
Expected IR:<br>
<br>
<br>
<br>
; Function Attrs: nounwind uwtable<br>
<br>
define i32 @foo(i32 %offset) local_unnamed_addr #0 {<br>
<br>
entry:<br>
<br>
  %call = tail call i8* @malloc(i64 808)<br>
<br>
  %0 = bitcast i8* %call to %struct.ABC*<br>
<br>
  tail call void @Setup(%struct.ABC* %0) #3<br>
<br>
  %X = getelementptr inbounds %struct.ABC, %struct.ABC* %0, i64 0, i32 2, i32 0<br>
<br>
  %1 = load i32, i32* %X, align 4, !tbaa !2<br>
<br>
  %arrayidx = getelementptr inbounds %struct.ABC, %struct.ABC* %0, i64 0, i32 2, i32 1, i64 33<br>
<br>
  %2 = load i32, i32* %arrayidx, align 4, !tbaa !8<br>
<br>
  %add = add nsw i32 %2, %1<br>
<br>
  ret i32 %add<br>
<br>
}<br>
<br>
<br>
<br>
In the above IR the GEP offsetting looks very explicit for the type struct.ABC.<br>
<br>
<br>
<br>
Looking at the InstCombiner source found the below code is responsible for it:<br>
<br>
1914   /// See if we can simplify:<br>
<br>
1915   ///   X = bitcast A* to B*<br>
<br>
1916   ///   Y = gep X, <...constant indices...><br>
<br>
1917   /// into a gep of the original struct.  This is important for SROA and alias<br>
<br>
1918   /// analysis of unions.  If "A" is also a bitcast, wait for A/X to be merged.<br>
<br>
1919   if (BitCastInst *BCI = dyn_cast<BitCastInst>(PtrOp)) {<br>
<br>
1920    ....<br>
<br>
<br>
<br>
I’m not sure how transforming GEP offset to i8 type will help alias analysis & SROA for the mentioned test case.<br>
<br>
<br>
<br>
Regards,<br>
<br>
Ashutosh<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.llvm.org/pipermail/llvm-dev/attachments/20170810/28bf3864/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/llvm-dev/<wbr>attachments/20170810/28bf3864/<wbr>attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 8<br>
Date: Thu, 10 Aug 2017 11:24:15 -0400<br>
From: Charles Saternos via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: Davide Italiano <<a href="mailto:davide@freebsd.org">davide@freebsd.org</a>><br>
Cc: llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
Subject: Re: [llvm-dev] [ThinLTO] Suggestions on how to traverse SCCs<br>
        in the Module Summary Index bottom up<br>
Message-ID:<br>
        <CAFC5sR1Fi3=42K=<a href="mailto:7L1SiDa5RO0rcvXkFyvvtKbNF6qViN0rKGQ@mail.gmail.com">7L1SiDa5RO0rc<wbr>vXkFyvvtKbNF6qViN0rKGQ@mail.<wbr>gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
><br>
> That said, I'm not sure why you need to find the entry point of the<br>
> program.<br>
> SCCs (collapsed) create a DAG so you can first propagate the attribute<br>
> within the SCC (until convergence) and then propagate across SCCs (see<br>
> the strong component section of<br>
> <a href="http://www.imm.dtu.dk/~hrni/PPA/slides6.pdf" rel="noreferrer" target="_blank">http://www.imm.dtu.dk/~hrni/<wbr>PPA/slides6.pdf</a> ). Unless I misunderstood<br>
> your problem (which I might have :),<br>
<br>
<br>
OK cool, the slideshow clarified what SCCs do. So it looks like<br>
scc_iterator will navigate the reduced graph in topological order, which<br>
means all I have to worry about are describing the graphtraits, and the<br>
scc_iterator does the rest?<br>
<br>
you don't need to start from the entry point, as long as you have a<br>
> topological order.<br>
<br>
<br>
That makes sense. I was going off the implementation of the callgraph<br>
(which starts at the callgraph's entry point), but I was misinterpreting<br>
the significance of that. It looks like my problem is just a bug in my<br>
GraphTraits implementation then, because I'm only finding 2 SCCs (each with<br>
one node) in my test example which should be finding 10 nodes.<br>
<br>
Thanks for the help Davide!<br>
- Charles<br>
<br>
On Thu, Aug 10, 2017 at 3:39 AM, Davide Italiano <<a href="mailto:davide@freebsd.org">davide@freebsd.org</a>> wrote:<br>
<br>
> On Wed, Aug 9, 2017 at 3:04 PM, Charles Saternos via llvm-dev<br>
> <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> > I just realized that I've been misunderstanding this (I think). If I'm<br>
> > understanding it now, the entry node for the graph should actually be the<br>
> > graph's root (not a bottom node), and that the scc_iterator works its way<br>
> > down. So for the ModuleSummary, I should find the main function and<br>
> return<br>
> > that (or whatever function is the entry point for the entire program).<br>
> ><br>
><br>
> You can look at how the traits are used. Several passes in tree use<br>
> them, so you can get an idea (look for CGSCC, for example, the<br>
> inliner). Also, SCCs are discovered in post-order. If you want a<br>
> different visitation order you should built that yourself on top of<br>
> the existing one (see for example the code in FunctionAttrs.cpp which<br>
> discovers the SCC in RPO).<br>
><br>
> That said, I'm not sure why you need to find the entry point of the<br>
> program.<br>
> SCCs (collapsed) create a DAG so you can first propagate the attribute<br>
> within the SCC (until convergence) and then propagate across SCCs (see<br>
> the strong component section of<br>
> <a href="http://www.imm.dtu.dk/~hrni/PPA/slides6.pdf" rel="noreferrer" target="_blank">http://www.imm.dtu.dk/~hrni/<wbr>PPA/slides6.pdf</a> ). Unless I misunderstood<br>
> your problem (which I might have :), you don't need to start from the<br>
> entry point, as long as you have a topological order.<br>
><br>
> --<br>
> Davide<br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.llvm.org/pipermail/llvm-dev/attachments/20170810/d58f75cc/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/llvm-dev/<wbr>attachments/20170810/d58f75cc/<wbr>attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 9<br>
Date: Thu, 10 Aug 2017 08:33:44 -0700<br>
From: Rafael Avila de Espindola via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: Chris Lattner <<a href="mailto:clattner@llvm.org">clattner@llvm.org</a>>, llvm-dev<br>
        <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
Subject: Re: [llvm-dev] Relicensing: Revised Developer Policy<br>
Message-ID:<br>
        <87wp6b8mjr.fsf@dell.i-did-<wbr>not-set--mail-host-address--<wbr>so-tickle-me><br>
Content-Type: text/plain; charset=utf-8<br>
<br>
Hi,<br>
<br>
I still don't see any justification in the text why a license change is<br>
required over having a contributor agreement including whatever patent<br>
wording we want.<br>
<br>
As such, I don't agree with it.<br>
<br>
Cheers,<br>
Rafael<br>
<br>
Chris Lattner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> writes:<br>
<br>
> Hi all,<br>
><br>
> Now that we’ve settled on the license legalese to get to, we need to start the process of relicensing.  We’re still sorting through all of the details of what this will take, but the first step is clear: new contributions to LLVM will need to be under both the old license structure and the new one (until the old structure is completely phased out).  From a mechanical perspective, this is pretty simple, but I want to make sure that the community is aware of this and has time to digest and discuss any concerns.<br>
><br>
> In order to spell out what this will look like, we’ve gone ahead and revised <a href="http://llvm.org/docs/DeveloperPolicy.html" rel="noreferrer" target="_blank">http://llvm.org/docs/<wbr>DeveloperPolicy.html</a> to reflect what the new structure will look like.  While the license text is the canonical truth, the DeveloperPolicy serves a few purposes: it explains to non-lawyers what the license means, provides rationale for the design, and deals with relicensing process topics.<br>
><br>
> I’ve attached a draft of the revised document below.  Please take a look and let me know if anything should be further clarified or if you have any other questions and comments.  Thanks!<br>
><br>
> -Chris<br>
><br>
><br>
><br>
><br>
><br>
> Copyright, License, and Patents<br>
> ==============================<wbr>=<br>
><br>
> .. note::<br>
><br>
>    This section deals with legal matters but does not provide legal advice.  We<br>
>    are not lawyers --- please seek legal counsel from a licensed attorney.<br>
><br>
> This section addresses the issues of copyright, license and patents for the LLVM<br>
> project.  The copyright for the code is held by the contributors of<br>
> the code.  The code is licensed under permissive `open source licensing terms`_,<br>
> namely the Apache 2 license, which includes a copyright and `patent license`_.<br>
> When you contribute code to the LLVM project, you license it under these terms.<br>
><br>
> If you have questions or comments about these topics, please contact the<br>
> `LLVM Developer's Mailing List <mailto:<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.<wbr>org</a>>`_.  However,<br>
> please realize that most compiler developers are not lawyers, and therefore you<br>
> will not be getting official legal advice.<br>
><br>
> Copyright<br>
> ---------<br>
><br>
> The LLVM project does not collect copyright assignments, which means that the<br>
> copyright for the code in the project is held by the respective contributors.<br>
> Because you (or your company)<br>
> retain ownership of the code you contribute, you know it may only be used under<br>
> the terms of the open source license you contributed it under: the license for<br>
> your contributions cannot be changed in the future without your approval.<br>
><br>
> Because the LLVM project does not require copyright assignments, changing the<br>
> LLVM license requires tracking down the<br>
> contributors to LLVM and getting them to agree that a license change is<br>
> acceptable for their contributions.  We feel that a high burden for relicensing<br>
> is good for the project, because contributors do not have to fear that their<br>
> code will be used in a way with which they disagree.<br>
><br>
> Relicensing<br>
> -----------<br>
><br>
> The last paragraph notwithstanding, the LLVM Project is in the middle of a large<br>
> effort to change licenses, which aims to solve several problems:<br>
><br>
> * The old licenses made it difficult to move code from (e.g.) the compiler to<br>
>   runtime libraries, because runtime libraries used a different license from the<br>
>   rest of the compiler.<br>
> * Some contributions were not submitted to LLVM due to concerns that<br>
>   the patent grant required by the project was overly broad.<br>
> * The patent grant was unique to the LLVM Project, not written by a lawyer, and<br>
>   was difficult to determine what was protection was provided (if any).<br>
><br>
> The scope of relicensing is all code that is considered part of the LLVM<br>
> project, including the main LLVM repository, runtime libraries (compiler_rt,<br>
> OpenMP, etc), Polly, and all other subprojects.  There are a few exceptions:<br>
><br>
> * Code imported from other projects (e.g. Google Test, Autoconf, etc) will<br>
>   remain as it is.  This code isn't *developed* as part of the LLVM project, it<br>
>   is *used* by LLVM.<br>
> * Some subprojects are impractical or uninteresting to relicense (e.g. llvm-gcc<br>
>   and dragonegg). These will be split off from the LLVM project (e.g. to<br>
>   separate Github projects), allowing interested people to continue their<br>
>   development elsewhere.<br>
><br>
> To relicense LLVM, we will be seeking approval from all of the copyright holders<br>
> of code in the repository, or potentially remove/rewrite code if we cannot.<br>
> This is a large<br>
> and challenging project which will take a significant amount of time to<br>
> complete.  In the interim, **all contributions to the project will be made under<br>
> the terms of both the new license and the legacy license scheme** (each of which<br>
> is described below).  The exception to this is the legacy patent grant, which<br>
> will not be required for new contributions.<br>
><br>
> When all of the code in the project has been converted to the new license or<br>
> removed, we will drop the requirement to contribute under the legacy license.<br>
> This will achieve the goal of having<br>
> a single standardized license for the entire codebase.<br>
><br>
> If you are a prior contributor to LLVM and have not done so already, please do<br>
> *TODO* to allow us to use your code. *Add a link to a separate page here, which<br>
> is probably a click through web form or something like that.  Details to be<br>
> determined later*.<br>
><br>
><br>
> .. _open source licensing terms:<br>
><br>
> New LLVM Project License Framework<br>
> ------------------------------<wbr>----<br>
><br>
> Contributions to LLVM are licensed under the `Apache License, Version 2.0<br>
> <<a href="https://www.apache.org/licenses/LICENSE-2.0" rel="noreferrer" target="_blank">https://www.apache.org/<wbr>licenses/LICENSE-2.0</a>>`_, with two limited<br>
> exceptions intended to ensure that LLVM is very permissively licensed.<br>
> Collectively, the name of this license is "Apache 2.0 License with LLVM<br>
> exceptions".  The exceptions read:<br>
><br>
> ::<br>
><br>
>    ---- LLVM Exceptions to the Apache 2.0 License ----<br>
><br>
>    As an exception, if, as a result of your compiling your source code, portions<br>
>    of this Software are embedded into an Object form of such source code, you<br>
>    may redistribute such embedded portions in such Object form without complying<br>
>    with the conditions of Sections 4(a), 4(b) and 4(d) of the License.<br>
><br>
>    In addition, if you combine or link compiled forms of this Software with<br>
>    software that is licensed under the GPLv2 ("Combined Software") and if a<br>
>    court of competent jurisdiction determines that the patent provision (Section<br>
>    3), the indemnity provision (Section 9) or other Section of the License<br>
>    conflicts with the conditions of the GPLv2, you may retroactively and<br>
>    prospectively choose to deem waived or otherwise exclude such Section(s) of<br>
>    the License, but only in their entirety and only with respect to the Combined<br>
>    Software.<br>
><br>
><br>
> We intend to keep LLVM perpetually open source and available under a permissive<br>
> license - this fosters the widest adoption of LLVM by<br>
> **allowing commercial products to be derived from LLVM** with few restrictions<br>
> and without a requirement for making any derived works also open source.  In<br>
> particular, LLVM's license is not a "copyleft" license like the GPL.<br>
><br>
> The "Apache 2.0 License with LLVM exceptions" allows you to:<br>
><br>
> * freely download and use LLVM (in whole or in part) for personal, internal, or<br>
>   commercial purposes.<br>
> * include LLVM in packages or distributions you create.<br>
> * combine LLVM with code licensed under every other major open source<br>
>   license (including BSD, MIT, GPLv2, GPLv3...).<br>
> * make changes to LLVM code without being required to contribute it back<br>
>   to the project - contributions are appreciated though!<br>
><br>
> However, it imposes these limitations on you:<br>
><br>
> * You must retain the copyright notice if you redistribute LLVM: You cannot<br>
>   strip the copyright headers off or replace them with your own.<br>
> * Binaries that include LLVM must reproduce the copyright notice (e.g. in an<br>
>   included README file or in an "About" box), unless the LLVM code was added as<br>
>   a by-product of compilation.  For example, if an LLVM runtime library like<br>
>   compiler_rt or libc++ was automatically included into your application by the<br>
>   compiler, you do not need to attribute it.<br>
> * You can't use our names to promote your products (LLVM derived or not) -<br>
>   though you can make truthful statements about your use of the LLVM code,<br>
>   without implying our sponsorship.<br>
> * There's no warranty on LLVM at all.<br>
><br>
> We want LLVM code to be widely used, and believe that this provides a model that<br>
> is great for contributors and users of the project.  For more information about<br>
> the Apache 2.0 License, please see the `Apache License FAQ<br>
> <<a href="http://www.apache.org/foundation/license-faq.html" rel="noreferrer" target="_blank">http://www.apache.org/<wbr>foundation/license-faq.html</a>>`_<wbr>, maintained by the<br>
> Apache Project.<br>
><br>
><br>
> .. note::<br>
><br>
>    The LLVM Project includes some really old subprojects (dragonegg,<br>
>    llvm-gcc-4.0, and llvm-gcc-4.2), which are licensed under **GPL<br>
>    licenses**.  This code is not actively maintained - it does not even<br>
>    build successfully.  This code is cleanly separated into distinct SVN<br>
>    repositories from the rest of LLVM, and the LICENSE.txt files specifically<br>
>    indicate that they contain GPL code.  When LLVM transitions from SVN to Git,<br>
>    we plan to drop these code bases from the new repository structure.<br>
><br>
><br>
> .. _patent license:<br>
><br>
> Patents<br>
> -------<br>
><br>
> Section 3 of the Apache 2.0 license is a patent grant under which<br>
> contributors of code to the project contribute the rights to use any of<br>
> their patents that would otherwise be infringed by that code contribution<br>
> (protecting uses of that code).  Further, the patent grant is revoked<br>
> from anyone who files a patent lawsuit about code in LLVM - this protects the<br>
> community by providing a "patent commons" for the code base and reducing the<br>
> odds of patent lawsuits in general.<br>
><br>
> The license specifically scopes which patents are included with code<br>
> contributions.  To help explain this, the `Apache License FAQ<br>
> <<a href="http://www.apache.org/foundation/license-faq.html" rel="noreferrer" target="_blank">http://www.apache.org/<wbr>foundation/license-faq.html</a>>`_ explains this scope using<br>
> some questions and answers, which we reproduce here for your convenience (for<br>
> reference, the "ASF" is the Apache Software Foundation, the guidance still<br>
> holds though)::<br>
><br>
>    Q1: If I own a patent and contribute to a Work, and, at the time my<br>
>    contribution is included in that Work, none of my patent's claims are subject<br>
>    to Apache's Grant of Patent License, is there a way any of those claims would<br>
>    later become subject to the Grant of Patent License solely due to subsequent<br>
>    contributions by other parties who are not licensees of that patent.<br>
><br>
>    A1: No.<br>
><br>
>    Q2: If at any time after my contribution, I am able to license other patent<br>
>    claims that would have been subject to Apache's Grant of Patent License if<br>
>    they were licenseable by me at the time of my contribution, do those other<br>
>    claims become subject to the Grant of Patent License?<br>
><br>
>    A2: Yes.<br>
><br>
>    Q3: If I own or control a licensable patent and contribute code to a specific<br>
>    Apache product, which of my patent claims are subject to Apache's Grant of<br>
>    Patent License?<br>
><br>
>    A3:  The only patent claims that are licensed to the ASF are those you own or<br>
>    have the right to license that read on your contribution or on the<br>
>    combination of your contribution with the specific Apache product to which<br>
>    you contributed as it existed at the time of your contribution. No additional<br>
>    patent claims become licensed as a result of subsequent combinations of your<br>
>    contribution with any other software. Note, however, that licensable patent<br>
>    claims include those that you acquire in the future, as long as they read on<br>
>    your original contribution as made at the original time. Once a patent claim<br>
>    is subject to Apache's Grant of Patent License, it is licensed under the<br>
>    terms of that Grant to the ASF and to recipients of any software distributed<br>
>    by the ASF for any Apache software product whatsoever.<br>
><br>
><br>
> Legacy License Structure<br>
> ------------------------<br>
><br>
> .. note::<br>
>    The code base was previously licensed under the Terms described here.<br>
>    We are in the middle of relicensing to a new approach (described above), but<br>
>    until this effort is complete, the code is also still available under these<br>
>    terms.  Once we finish the relicensing project, new versions of the code will<br>
>    not be available under these terms.  However, nothing takes away your right<br>
>    to use old versions under the licensing terms under which they were<br>
>    originally released.<br>
><br>
> We intend to keep LLVM perpetually open source and to use a permissive open<br>
> source license.  The code in<br>
> LLVM is available under the `University of Illinois/NCSA Open Source License<br>
> <<a href="http://www.opensource.org/licenses/UoI-NCSA.php" rel="noreferrer" target="_blank">http://www.opensource.org/<wbr>licenses/UoI-NCSA.php</a>>`_, which boils down to<br>
> this:<br>
><br>
> * You can freely distribute LLVM.<br>
> * You must retain the copyright notice if you redistribute LLVM.<br>
> * Binaries derived from LLVM must reproduce the copyright notice (e.g. in an<br>
>   included README file).<br>
> * You can't use our names to promote your LLVM derived products.<br>
> * There's no warranty on LLVM at all.<br>
><br>
> We believe this fosters the widest adoption of LLVM because it **allows<br>
> commercial products to be derived from LLVM** with few restrictions and without<br>
> a requirement for making any derived works also open source (i.e. LLVM's<br>
> license is not a "copyleft" license like the GPL). We suggest that you read the<br>
> `License <<a href="http://www.opensource.org/licenses/UoI-NCSA.php" rel="noreferrer" target="_blank">http://www.opensource.org/<wbr>licenses/UoI-NCSA.php</a>>`_ if further<br>
> clarification is needed.<br>
><br>
> In addition to the UIUC license, the runtime library components of LLVM<br>
> (**compiler_rt, libc++, and libclc**) are also licensed under the `MIT License<br>
> <<a href="http://www.opensource.org/licenses/mit-license.php" rel="noreferrer" target="_blank">http://www.opensource.org/<wbr>licenses/mit-license.php</a>>`_, which does not contain<br>
> the binary redistribution clause.  As a user of these runtime libraries, it<br>
> means that you can choose to use the code under either license (and thus don't<br>
> need the binary redistribution clause), and as a contributor to the code that<br>
> you agree that any contributions to these libraries be licensed under both<br>
> licenses.  We feel that this is important for runtime libraries, because they<br>
> are implicitly linked into applications and therefore should not subject those<br>
> applications to the binary redistribution clause. This also means that it is ok<br>
> to move code from (e.g.)  libc++ to the LLVM core without concern, but that code<br>
> cannot be moved from the LLVM core to libc++ without the copyright owner's<br>
> permission.<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>
<br>
------------------------------<br>
<br>
Message: 10<br>
Date: Thu, 10 Aug 2017 08:53:06 -0700<br>
From: Chris Lattner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
To: Rafael Avila de Espindola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>><br>
Cc: llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
Subject: Re: [llvm-dev] Relicensing: Revised Developer Policy<br>
Message-ID: <<a href="mailto:20A56370-75A6-4FA0-B2A5-9F3F593CBD7B@llvm.org">20A56370-75A6-4FA0-B2A5-<wbr>9F3F593CBD7B@llvm.org</a>><br>
Content-Type: text/plain; charset=utf-8<br>
<br>
Hi Rafael,<br>
<br>
We’ve discussed why a license change is preferable over the span of several years now.  I’m happy to explain over the phone, contact me off list and we can talk.<br>
<br>
-Chris<br>
<br>
> On Aug 10, 2017, at 8:33 AM, Rafael Avila de Espindola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> I still don't see any justification in the text why a license change is<br>
> required over having a contributor agreement including whatever patent<br>
> wording we want.<br>
><br>
> As such, I don't agree with it.<br>
><br>
> Cheers,<br>
> Rafael<br>
><br>
> Chris Lattner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> writes:<br>
><br>
>> Hi all,<br>
>><br>
>> Now that we’ve settled on the license legalese to get to, we need to start the process of relicensing.  We’re still sorting through all of the details of what this will take, but the first step is clear: new contributions to LLVM will need to be under both the old license structure and the new one (until the old structure is completely phased out).  From a mechanical perspective, this is pretty simple, but I want to make sure that the community is aware of this and has time to digest and discuss any concerns.<br>
>><br>
>> In order to spell out what this will look like, we’ve gone ahead and revised <a href="http://llvm.org/docs/DeveloperPolicy.html" rel="noreferrer" target="_blank">http://llvm.org/docs/<wbr>DeveloperPolicy.html</a> to reflect what the new structure will look like.  While the license text is the canonical truth, the DeveloperPolicy serves a few purposes: it explains to non-lawyers what the license means, provides rationale for the design, and deals with relicensing process topics.<br>
>><br>
>> I’ve attached a draft of the revised document below.  Please take a look and let me know if anything should be further clarified or if you have any other questions and comments.  Thanks!<br>
>><br>
>> -Chris<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> Copyright, License, and Patents<br>
>> ==============================<wbr>=<br>
>><br>
>> .. note::<br>
>><br>
>>   This section deals with legal matters but does not provide legal advice.  We<br>
>>   are not lawyers --- please seek legal counsel from a licensed attorney.<br>
>><br>
>> This section addresses the issues of copyright, license and patents for the LLVM<br>
>> project.  The copyright for the code is held by the contributors of<br>
>> the code.  The code is licensed under permissive `open source licensing terms`_,<br>
>> namely the Apache 2 license, which includes a copyright and `patent license`_.<br>
>> When you contribute code to the LLVM project, you license it under these terms.<br>
>><br>
>> If you have questions or comments about these topics, please contact the<br>
>> `LLVM Developer's Mailing List <mailto:<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.<wbr>org</a>>`_.  However,<br>
>> please realize that most compiler developers are not lawyers, and therefore you<br>
>> will not be getting official legal advice.<br>
>><br>
>> Copyright<br>
>> ---------<br>
>><br>
>> The LLVM project does not collect copyright assignments, which means that the<br>
>> copyright for the code in the project is held by the respective contributors.<br>
>> Because you (or your company)<br>
>> retain ownership of the code you contribute, you know it may only be used under<br>
>> the terms of the open source license you contributed it under: the license for<br>
>> your contributions cannot be changed in the future without your approval.<br>
>><br>
>> Because the LLVM project does not require copyright assignments, changing the<br>
>> LLVM license requires tracking down the<br>
>> contributors to LLVM and getting them to agree that a license change is<br>
>> acceptable for their contributions.  We feel that a high burden for relicensing<br>
>> is good for the project, because contributors do not have to fear that their<br>
>> code will be used in a way with which they disagree.<br>
>><br>
>> Relicensing<br>
>> -----------<br>
>><br>
>> The last paragraph notwithstanding, the LLVM Project is in the middle of a large<br>
>> effort to change licenses, which aims to solve several problems:<br>
>><br>
>> * The old licenses made it difficult to move code from (e.g.) the compiler to<br>
>>  runtime libraries, because runtime libraries used a different license from the<br>
>>  rest of the compiler.<br>
>> * Some contributions were not submitted to LLVM due to concerns that<br>
>>  the patent grant required by the project was overly broad.<br>
>> * The patent grant was unique to the LLVM Project, not written by a lawyer, and<br>
>>  was difficult to determine what was protection was provided (if any).<br>
>><br>
>> The scope of relicensing is all code that is considered part of the LLVM<br>
>> project, including the main LLVM repository, runtime libraries (compiler_rt,<br>
>> OpenMP, etc), Polly, and all other subprojects.  There are a few exceptions:<br>
>><br>
>> * Code imported from other projects (e.g. Google Test, Autoconf, etc) will<br>
>>  remain as it is.  This code isn't *developed* as part of the LLVM project, it<br>
>>  is *used* by LLVM.<br>
>> * Some subprojects are impractical or uninteresting to relicense (e.g. llvm-gcc<br>
>>  and dragonegg). These will be split off from the LLVM project (e.g. to<br>
>>  separate Github projects), allowing interested people to continue their<br>
>>  development elsewhere.<br>
>><br>
>> To relicense LLVM, we will be seeking approval from all of the copyright holders<br>
>> of code in the repository, or potentially remove/rewrite code if we cannot.<br>
>> This is a large<br>
>> and challenging project which will take a significant amount of time to<br>
>> complete.  In the interim, **all contributions to the project will be made under<br>
>> the terms of both the new license and the legacy license scheme** (each of which<br>
>> is described below).  The exception to this is the legacy patent grant, which<br>
>> will not be required for new contributions.<br>
>><br>
>> When all of the code in the project has been converted to the new license or<br>
>> removed, we will drop the requirement to contribute under the legacy license.<br>
>> This will achieve the goal of having<br>
>> a single standardized license for the entire codebase.<br>
>><br>
>> If you are a prior contributor to LLVM and have not done so already, please do<br>
>> *TODO* to allow us to use your code. *Add a link to a separate page here, which<br>
>> is probably a click through web form or something like that.  Details to be<br>
>> determined later*.<br>
>><br>
>><br>
>> .. _open source licensing terms:<br>
>><br>
>> New LLVM Project License Framework<br>
>> ------------------------------<wbr>----<br>
>><br>
>> Contributions to LLVM are licensed under the `Apache License, Version 2.0<br>
>> <<a href="https://www.apache.org/licenses/LICENSE-2.0" rel="noreferrer" target="_blank">https://www.apache.org/<wbr>licenses/LICENSE-2.0</a>>`_, with two limited<br>
>> exceptions intended to ensure that LLVM is very permissively licensed.<br>
>> Collectively, the name of this license is "Apache 2.0 License with LLVM<br>
>> exceptions".  The exceptions read:<br>
>><br>
>> ::<br>
>><br>
>>   ---- LLVM Exceptions to the Apache 2.0 License ----<br>
>><br>
>>   As an exception, if, as a result of your compiling your source code, portions<br>
>>   of this Software are embedded into an Object form of such source code, you<br>
>>   may redistribute such embedded portions in such Object form without complying<br>
>>   with the conditions of Sections 4(a), 4(b) and 4(d) of the License.<br>
>><br>
>>   In addition, if you combine or link compiled forms of this Software with<br>
>>   software that is licensed under the GPLv2 ("Combined Software") and if a<br>
>>   court of competent jurisdiction determines that the patent provision (Section<br>
>>   3), the indemnity provision (Section 9) or other Section of the License<br>
>>   conflicts with the conditions of the GPLv2, you may retroactively and<br>
>>   prospectively choose to deem waived or otherwise exclude such Section(s) of<br>
>>   the License, but only in their entirety and only with respect to the Combined<br>
>>   Software.<br>
>><br>
>><br>
>> We intend to keep LLVM perpetually open source and available under a permissive<br>
>> license - this fosters the widest adoption of LLVM by<br>
>> **allowing commercial products to be derived from LLVM** with few restrictions<br>
>> and without a requirement for making any derived works also open source.  In<br>
>> particular, LLVM's license is not a "copyleft" license like the GPL.<br>
>><br>
>> The "Apache 2.0 License with LLVM exceptions" allows you to:<br>
>><br>
>> * freely download and use LLVM (in whole or in part) for personal, internal, or<br>
>>  commercial purposes.<br>
>> * include LLVM in packages or distributions you create.<br>
>> * combine LLVM with code licensed under every other major open source<br>
>>  license (including BSD, MIT, GPLv2, GPLv3...).<br>
>> * make changes to LLVM code without being required to contribute it back<br>
>>  to the project - contributions are appreciated though!<br>
>><br>
>> However, it imposes these limitations on you:<br>
>><br>
>> * You must retain the copyright notice if you redistribute LLVM: You cannot<br>
>>  strip the copyright headers off or replace them with your own.<br>
>> * Binaries that include LLVM must reproduce the copyright notice (e.g. in an<br>
>>  included README file or in an "About" box), unless the LLVM code was added as<br>
>>  a by-product of compilation.  For example, if an LLVM runtime library like<br>
>>  compiler_rt or libc++ was automatically included into your application by the<br>
>>  compiler, you do not need to attribute it.<br>
>> * You can't use our names to promote your products (LLVM derived or not) -<br>
>>  though you can make truthful statements about your use of the LLVM code,<br>
>>  without implying our sponsorship.<br>
>> * There's no warranty on LLVM at all.<br>
>><br>
>> We want LLVM code to be widely used, and believe that this provides a model that<br>
>> is great for contributors and users of the project.  For more information about<br>
>> the Apache 2.0 License, please see the `Apache License FAQ<br>
>> <<a href="http://www.apache.org/foundation/license-faq.html" rel="noreferrer" target="_blank">http://www.apache.org/<wbr>foundation/license-faq.html</a>>`_<wbr>, maintained by the<br>
>> Apache Project.<br>
>><br>
>><br>
>> .. note::<br>
>><br>
>>   The LLVM Project includes some really old subprojects (dragonegg,<br>
>>   llvm-gcc-4.0, and llvm-gcc-4.2), which are licensed under **GPL<br>
>>   licenses**.  This code is not actively maintained - it does not even<br>
>>   build successfully.  This code is cleanly separated into distinct SVN<br>
>>   repositories from the rest of LLVM, and the LICENSE.txt files specifically<br>
>>   indicate that they contain GPL code.  When LLVM transitions from SVN to Git,<br>
>>   we plan to drop these code bases from the new repository structure.<br>
>><br>
>><br>
>> .. _patent license:<br>
>><br>
>> Patents<br>
>> -------<br>
>><br>
>> Section 3 of the Apache 2.0 license is a patent grant under which<br>
>> contributors of code to the project contribute the rights to use any of<br>
>> their patents that would otherwise be infringed by that code contribution<br>
>> (protecting uses of that code).  Further, the patent grant is revoked<br>
>> from anyone who files a patent lawsuit about code in LLVM - this protects the<br>
>> community by providing a "patent commons" for the code base and reducing the<br>
>> odds of patent lawsuits in general.<br>
>><br>
>> The license specifically scopes which patents are included with code<br>
>> contributions.  To help explain this, the `Apache License FAQ<br>
>> <<a href="http://www.apache.org/foundation/license-faq.html" rel="noreferrer" target="_blank">http://www.apache.org/<wbr>foundation/license-faq.html</a>>`_ explains this scope using<br>
>> some questions and answers, which we reproduce here for your convenience (for<br>
>> reference, the "ASF" is the Apache Software Foundation, the guidance still<br>
>> holds though)::<br>
>><br>
>>   Q1: If I own a patent and contribute to a Work, and, at the time my<br>
>>   contribution is included in that Work, none of my patent's claims are subject<br>
>>   to Apache's Grant of Patent License, is there a way any of those claims would<br>
>>   later become subject to the Grant of Patent License solely due to subsequent<br>
>>   contributions by other parties who are not licensees of that patent.<br>
>><br>
>>   A1: No.<br>
>><br>
>>   Q2: If at any time after my contribution, I am able to license other patent<br>
>>   claims that would have been subject to Apache's Grant of Patent License if<br>
>>   they were licenseable by me at the time of my contribution, do those other<br>
>>   claims become subject to the Grant of Patent License?<br>
>><br>
>>   A2: Yes.<br>
>><br>
>>   Q3: If I own or control a licensable patent and contribute code to a specific<br>
>>   Apache product, which of my patent claims are subject to Apache's Grant of<br>
>>   Patent License?<br>
>><br>
>>   A3:  The only patent claims that are licensed to the ASF are those you own or<br>
>>   have the right to license that read on your contribution or on the<br>
>>   combination of your contribution with the specific Apache product to which<br>
>>   you contributed as it existed at the time of your contribution. No additional<br>
>>   patent claims become licensed as a result of subsequent combinations of your<br>
>>   contribution with any other software. Note, however, that licensable patent<br>
>>   claims include those that you acquire in the future, as long as they read on<br>
>>   your original contribution as made at the original time. Once a patent claim<br>
>>   is subject to Apache's Grant of Patent License, it is licensed under the<br>
>>   terms of that Grant to the ASF and to recipients of any software distributed<br>
>>   by the ASF for any Apache software product whatsoever.<br>
>><br>
>><br>
>> Legacy License Structure<br>
>> ------------------------<br>
>><br>
>> .. note::<br>
>>   The code base was previously licensed under the Terms described here.<br>
>>   We are in the middle of relicensing to a new approach (described above), but<br>
>>   until this effort is complete, the code is also still available under these<br>
>>   terms.  Once we finish the relicensing project, new versions of the code will<br>
>>   not be available under these terms.  However, nothing takes away your right<br>
>>   to use old versions under the licensing terms under which they were<br>
>>   originally released.<br>
>><br>
>> We intend to keep LLVM perpetually open source and to use a permissive open<br>
>> source license.  The code in<br>
>> LLVM is available under the `University of Illinois/NCSA Open Source License<br>
>> <<a href="http://www.opensource.org/licenses/UoI-NCSA.php" rel="noreferrer" target="_blank">http://www.opensource.org/<wbr>licenses/UoI-NCSA.php</a>>`_, which boils down to<br>
>> this:<br>
>><br>
>> * You can freely distribute LLVM.<br>
>> * You must retain the copyright notice if you redistribute LLVM.<br>
>> * Binaries derived from LLVM must reproduce the copyright notice (e.g. in an<br>
>>  included README file).<br>
>> * You can't use our names to promote your LLVM derived products.<br>
>> * There's no warranty on LLVM at all.<br>
>><br>
>> We believe this fosters the widest adoption of LLVM because it **allows<br>
>> commercial products to be derived from LLVM** with few restrictions and without<br>
>> a requirement for making any derived works also open source (i.e. LLVM's<br>
>> license is not a "copyleft" license like the GPL). We suggest that you read the<br>
>> `License <<a href="http://www.opensource.org/licenses/UoI-NCSA.php" rel="noreferrer" target="_blank">http://www.opensource.org/<wbr>licenses/UoI-NCSA.php</a>>`_ if further<br>
>> clarification is needed.<br>
>><br>
>> In addition to the UIUC license, the runtime library components of LLVM<br>
>> (**compiler_rt, libc++, and libclc**) are also licensed under the `MIT License<br>
>> <<a href="http://www.opensource.org/licenses/mit-license.php" rel="noreferrer" target="_blank">http://www.opensource.org/<wbr>licenses/mit-license.php</a>>`_, which does not contain<br>
>> the binary redistribution clause.  As a user of these runtime libraries, it<br>
>> means that you can choose to use the code under either license (and thus don't<br>
>> need the binary redistribution clause), and as a contributor to the code that<br>
>> you agree that any contributions to these libraries be licensed under both<br>
>> licenses.  We feel that this is important for runtime libraries, because they<br>
>> are implicitly linked into applications and therefore should not subject those<br>
>> applications to the binary redistribution clause. This also means that it is ok<br>
>> to move code from (e.g.)  libc++ to the LLVM core without concern, but that code<br>
>> cannot be moved from the LLVM core to libc++ without the copyright owner's<br>
>> permission.<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>
<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 158, Issue 52<br>
******************************<wbr>***********<br>
</blockquote></div><br></div></div></div></div></div>