<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body><div>Text me 7028819341 I'm jr</div><div><br></div><div><br></div><div><br></div><div id="composer_signature"><div style="font-size:85%;color:#575757">Sent from my T-Mobile 4G LTE Device</div></div><div style="font-size:100%;color:#000000"><!-- originalMessage --><div>-------- Original message --------</div><div>From: via llvm-dev <llvm-dev@lists.llvm.org> </div><div>Date: 5/20/2016  11:57 AM  (GMT-08:00) </div><div>To: llvm-dev@lists.llvm.org </div><div>Subject: llvm-dev Digest, Vol 143, Issue 118 </div><div><br></div></div>Send llvm-dev mailing list submissions to<br>      llvm-dev@lists.llvm.org<br><br>To subscribe or unsubscribe via the World Wide Web, visit<br>  http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br>or, via email, send a message with subject or body 'help' to<br> llvm-dev-request@lists.llvm.org<br><br>You can reach the person managing the list at<br>      llvm-dev-owner@lists.llvm.org<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: -mllvm -inline-threshold no longer honored?<br>      (Jack Howarth via llvm-dev)<br>   2. Re: Working on FP SCEV Analysis (Saito, Hideki via llvm-dev)<br>   3. Re: Working on FP SCEV Analysis (Saito, Hideki via llvm-dev)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Fri, 20 May 2016 14:54:42 -0400<br>From: Jack Howarth via llvm-dev <llvm-dev@lists.llvm.org><br>To: Easwaran Raman <eraman@google.com><br>Cc: llvm-dev <llvm-dev@lists.llvm.org><br>Subject: Re: [llvm-dev] -mllvm -inline-threshold no longer honored?<br>Message-ID:<br>     <CADtEn-2rh_CdODikALyRyVLgLDQO18PQ02z4U1WQCN5oLsw6KQ@mail.gmail.com><br>Content-Type: text/plain; charset=UTF-8<br><br>Easwaran,<br>     I can confirm that, after the commit of r270153, -mllvm<br>-inline-threshold=500 is honored again as tested with the c-ray 1.1<br>benchmark. Thanks for fixing that issue.<br>        Jack<br>ps Any chance you can take a look at improving the default<br>inline-threshold being used for the c-ray benchmark?<br><br>On Tue, May 17, 2016 at 5:23 PM, Easwaran Raman <eraman@google.com> wrote:<br>> I think r257832  introduced this regression. I'm looking into it.<br>><br>> On Tue, May 17, 2016 at 10:13 AM, Jack Howarth via llvm-dev<br>> <llvm-dev@lists.llvm.org> wrote:<br>>><br>>> While checking on the status of<br>>> https://llvm.org/bugs/show_bug.cgi?id=22657 in current llvm/clang<br>>> trunk, I noticed that the previous work-around for recovering the<br>>> missing in-lining of the  c-ray 1.1 benchmarks of passing -mllvm<br>>> -inline-threshold=500 no longer works. This regression doesn't exist<br>>> in the 3.8.0 release. Any idea what commit in 3.9svn might have<br>>> introduced this regression?<br>>>        Jack<br>>> _______________________________________________<br>>> LLVM Developers mailing list<br>>> llvm-dev@lists.llvm.org<br>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br>><br>><br><br><br>------------------------------<br><br>Message: 2<br>Date: Fri, 20 May 2016 18:58:13 +0000<br>From: "Saito, Hideki via llvm-dev" <llvm-dev@lists.llvm.org><br>To: "mzolotukhin@apple.com" <mzolotukhin@apple.com><br>Cc: llvm-dev <llvm-dev@lists.llvm.org><br>Subject: Re: [llvm-dev] Working on FP SCEV Analysis<br>Message-ID:<br>   <899F03F2C73A55449C51631866B887494BFCA445@FMSMSX109.amr.corp.intel.com><br> <br>Content-Type: text/plain; charset="utf-8"<br><br><br>Michael, she hasn’t posted a patch (or the link) yet, but she wrote “I implemented this with FP SCEV and the code looks very structured, including SCEVExpander”.<br>So, there is actual code that can be looked at. May have to wait until Sunday morning in Israel.<br><br>Thanks,<br>Hideki<br><br>From: mzolotukhin@apple.com [mailto:mzolotukhin@apple.com]<br>Sent: Friday, May 20, 2016 11:38 AM<br>To: Saito, Hideki <hideki.saito@intel.com><br>Cc: Chandler Carruth <chandlerc@google.com>; Demikhovsky, Elena <elena.demikhovsky@intel.com>; Adam Nemet <anemet@apple.com>; Sanjoy Das <sanjoy@playingwithpointers.com>; llvm-dev <llvm-dev@lists.llvm.org><br>Subject: Re: [llvm-dev] Working on FP SCEV Analysis<br><br>Hi Hideki,<br><br>Thanks for the summary!<br><br>On May 20, 2016, at 10:04 AM, Saito, Hideki via llvm-dev <llvm-dev@lists.llvm.org<mailto:llvm-dev@lists.llvm.org>> wrote:<br><br><br>To the best of my experience, handling case B (secondary induction) is must-have, and if I’m not mistaken,<br>people aren’t opposed to that.<br><br>For me, handling case A (primary induction) is “why not?”, but I certainly admit that that can be very naïve<br>thinking coming from lack of good understanding on SCEV and their proper usages. Now, let’s assume we<br>can postpone discussion about  case A. What is the best approach to handle case B? Let me summarize<br>the discussion so far. Hope I didn’t miss anything.<br><br>1)<br>Extend SCEV was the initial approach taken by Elena.<br>                Elena thinks this solution ”looks very structured”.<br>                If I’m not mistaken, some people think this is overkill and overly complicates already complicated SCEV.<br>                Anyone care to look at the patch Elena came up with?<br>Sorry if I missed it. Could you please post a link to the patch here? I’ve been mostly speculating on how complicated the SCEV solution would be, if the actual patch happens to be really simple and obvious, we can go this way.<br><br>Michael<br><br><br>2)<br>IndVarSimplify::handleFloatingPointIV  (mentioned by Andy)<br>                This transforms integer-valued FP (primary) IV into integer IV and convert.<br>                Chandler says most of Graphics shading language use case mentioned by Owen<br>                should be handled here.<br>                It certainly has the logic of detecting FP induction, but Andy punted discussions<br>                on non-integer valued IV issues to MichaelZ and Adam.<br>3)<br>extend InductionDescriptor::isInductionPHI in the vectorizer to directly analyze the PHIs without SCEV support<br>(mentioned by Adam)<br>                If this is the standard way to deal with all secondary inductions, it certainly looks attractive.<br>                Elena, would you try doing this and compare with 1)?<br><br>Thanks,<br>Hideki<br><br>----------------------<br>I looked at what our FORTRAN compiler (non-LLVM) does for the following (x, y, z, and f are float by default typing,<br>based on names).<br><br>       subroutine foo(x, y, z, A, N)<br>       double precision A(N)<br>       do f = x, y, z<br>         A(f) = f<br>       enddo<br>       end<br><br>The frontend computes the trip count outside of the loop (per language rule) and uses an integer primary<br>induction variable (compile-generated) for loop control. So, (future) FORTRAN usage doesn’t seem to be<br>a good example for promoting support for case A (= FP primary induction variable).<br><br><br><br>From: Chandler Carruth [mailto:chandlerc@google.com]<br>Sent: Thursday, May 19, 2016 7:03 PM<br>To: Demikhovsky, Elena <elena.demikhovsky@intel.com<mailto:elena.demikhovsky@intel.com>>; anemet@apple.com<mailto:anemet@apple.com>; Sanjoy Das <sanjoy@playingwithpointers.com<mailto:sanjoy@playingwithpointers.com>><br>Cc: Saito, Hideki <hideki.saito@intel.com<mailto:hideki.saito@intel.com>>; llvm-dev <llvm-dev@lists.llvm.org<mailto:llvm-dev@lists.llvm.org>>; Andrew Trick <atrick@apple.com<mailto:atrick@apple.com>><br>Subject: Re: [llvm-dev] Working on FP SCEV Analysis<br><br>On Thu, May 19, 2016 at 7:03 AM Demikhovsky, Elena <elena.demikhovsky@intel.com<mailto:elena.demikhovsky@intel.com>> wrote:<br>> One option would be to extend InductionDescriptor::isInductionPHI in the vectorizer to directly analyze the PHIs without SCEV support as Sanjoy suggested.  I *think* that that could be sufficient to handle case B.<br><br>I implemented this with FP SCEV and the code looks very structured, including SCEVExpander. Extending the existing structures without implementing FP SCEV will be problematic.<br>And my end goal is to handle case *A*.<br>Ok, but there have been *numerous* requests for an explanation of why this is important, and that hasn't emerged yet.<br><br>We really need to have a clear understanding of the relative importance of solving these problems in order to understand the best approach.<br><br><br><br>-           Elena<br><br>From: anemet@apple.com<mailto:anemet@apple.com> [mailto:anemet@apple.com<mailto:anemet@apple.com>]<br>Sent: Thursday, May 19, 2016 07:43<br>To: Sanjoy Das <sanjoy@playingwithpointers.com<mailto:sanjoy@playingwithpointers.com>><br>Cc: Demikhovsky, Elena <elena.demikhovsky@intel.com<mailto:elena.demikhovsky@intel.com>>; Saito, Hideki <hideki.saito@intel.com<mailto:hideki.saito@intel.com>>; llvm-dev <llvm-dev@lists.llvm.org<mailto:llvm-dev@lists.llvm.org>>; Andrew Trick <atrick@apple.com<mailto:atrick@apple.com>><br><br>Subject: Re: [llvm-dev] Working on FP SCEV Analysis<br><br><br>On May 18, 2016, at 12:17 PM, Sanjoy Das via llvm-dev <llvm-dev@lists.llvm.org<mailto:llvm-dev@lists.llvm.org>> wrote:<br><br><br><br>Demikhovsky, Elena wrote:<br>> Even then, I'd personally want to see further evidence of why the<br>correct solution is to model the floating point IV in SCEV rather than<br>find a more powerful way of converting the IV to an integer that models<br>> the non-integer values taken on by the IV. As an example, if the use<br>case is the following code with appropriate flags to relax IEEE<br>semantics so this looks like normal algabra etc:<br><br>> for (float f = 0.01f; f < 1.0f; f += 0.01f) ç **A**<br><br>...<br><br>> I'd rather see us cleverly turn it into:<br><br>> float f = 0.01f;<br><br>> for (int i = 1; i < 100; i += 1, f += 0.01f) ç **B**<br><br>I can later try to enhance IndVarSimplify::handleFloatingPointIV() in<br>order to convert**A** to **B**.<br><br>But **B** is exactly the case I’m starting from. The main IV “i” is<br>integer. The variable “f” is also considered as IV in this loop.<br><br>And this loop is not vectorized because “f” is floating point.<br><br>I don’t think that the case **B** is uncommon.<br><br>If B is the case we actually care about, I'd say changing SCEV to work with floating points is an overkill.  How would you expect an SCEVFAddExpr to help vectorize B, other than tell you what the initial value and the increment is (and these can be found with a simple value analysis)?<br><br>One option would be to extend InductionDescriptor::isInductionPHI in the vectorizer to directly analyze the PHIs without SCEV support as Sanjoy suggested.  I *think* that that could be sufficient to handle case B.<br><br>Then if we find other pressing cases to handle we can rethink the strategy.<br><br>Also the current diagnostics is pretty bad for Hideki’s testcase with TTT as float.  This is what we currently report with -Rpass-analysis=loop-vectorize:<br><br>/tmp/sss.c:3:6: remark: loop not vectorized: value that could not be<br>      identified as reduction is used outside the loop<br>      [-Rpass-analysis=loop-vectorize]<br><br>I have no clue why we say that the value is used outside the loop.  I think this should just say that we have a loop-variant value that we couldn’t identify either as an induction or as a reduction.<br><br>Adam<br><br><br>If we're interested in handling complex variants of A directly: computing trip counts, proving away predicates etc. without translating the loops to use integer IVs (perhaps because we can't legally do so), then I can see FP-SCEV as a reasonable implementation strategy, but it looks like the general consensus is that such cases are rare and generally not worth optimizing?<br><br>-- Sanjoy<br><br><br><br>-*/Elena/*<br><br>---------------------------------------------------------------------<br>Intel Israel (74) Limited<br><br>This e-mail and any attachments may contain confidential material for<br>the sole use of the intended recipient(s). Any review or distribution<br>by others is strictly prohibited. If you are not the intended<br>recipient, please contact the sender and delete all copies.<br>_______________________________________________<br>LLVM Developers mailing list<br>llvm-dev@lists.llvm.org<mailto:llvm-dev@lists.llvm.org><br>http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br><br>---------------------------------------------------------------------<br>Intel Israel (74) Limited<br>This e-mail and any attachments may contain confidential material for<br>the sole use of the intended recipient(s). Any review or distribution<br>by others is strictly prohibited. If you are not the intended<br>recipient, please contact the sender and delete all copies.<br>_______________________________________________<br>LLVM Developers mailing list<br>llvm-dev@lists.llvm.org<mailto:llvm-dev@lists.llvm.org><br>http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br><br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160520/ab79bae3/attachment-0001.html><br><br>------------------------------<br><br>Message: 3<br>Date: Fri, 20 May 2016 18:59:55 +0000<br>From: "Saito, Hideki via llvm-dev" <llvm-dev@lists.llvm.org><br>To: "anemet@apple.com" <anemet@apple.com><br>Cc: llvm-dev <llvm-dev@lists.llvm.org><br>Subject: Re: [llvm-dev] Working on FP SCEV Analysis<br>Message-ID:<br>        <899F03F2C73A55449C51631866B887494BFCA453@FMSMSX109.amr.corp.intel.com><br> <br>Content-Type: text/plain; charset="utf-8"<br><br><br>Adam, thanks for the clarification.<br><br>FP induction analysis should be useful for other loop optimizations that care about cross-iteration dependence.<br>Thus, I think the mechanism is best implemented as an analysis or a utility, as opposed to something confined<br>inside vectorizer. Any objections in this general direction?<br><br>Thanks,<br>Hideki<br><br><br>From: anemet@apple.com [mailto:anemet@apple.com]<br>Sent: Friday, May 20, 2016 11:32 AM<br>To: Saito, Hideki <hideki.saito@intel.com><br>Cc: Chandler Carruth <chandlerc@google.com>; Demikhovsky, Elena <elena.demikhovsky@intel.com>; Sanjoy Das <sanjoy@playingwithpointers.com>; llvm-dev <llvm-dev@lists.llvm.org>; Andrew Trick <atrick@apple.com><br>Subject: Re: [llvm-dev] Working on FP SCEV Analysis<br><br>Hi Hideki,<br><br>I like this summary overall, thanks.  More below.<br><br>On May 20, 2016, at 10:04 AM, Saito, Hideki <hideki.saito@intel.com<mailto:hideki.saito@intel.com>> wrote:<br><br><br>To the best of my experience, handling case B (secondary induction) is must-have, and if I’m not mistaken,<br>people aren’t opposed to that.<br><br>For me, handling case A (primary induction) is “why not?”, but I certainly admit that that can be very naïve<br>thinking coming from lack of good understanding on SCEV and their proper usages. Now, let’s assume we<br>can postpone discussion about  case A. What is the best approach to handle case B? Let me summarize<br>the discussion so far. Hope I didn’t miss anything.<br><br>1)<br>Extend SCEV was the initial approach taken by Elena.<br>                Elena thinks this solution ”looks very structured”.<br>                If I’m not mistaken, some people think this is overkill and overly complicates already complicated SCEV.<br>                Anyone care to look at the patch Elena came up with?<br>2)<br>IndVarSimplify::handleFloatingPointIV  (mentioned by Andy)<br>                This transforms integer-valued FP (primary) IV into integer IV and convert.<br>                Chandler says most of Graphics shading language use case mentioned by Owen<br>                should be handled here.<br>                It certainly has the logic of detecting FP induction, but Andy punted discussions<br>                on non-integer valued IV issues to MichaelZ and Adam.<br><br>My understanding is that we only need this for *A* not for *B*.<br><br>On the specific issue of non-integer values, there is simply no attempt made in the code to deal with them.  That said, I think it should be possible to compute the trip count and then derive an integer induction variable controlling the loop.<br><br><br>3)<br>extend InductionDescriptor::isInductionPHI in the vectorizer to directly analyze the PHIs without SCEV support<br>(mentioned by Adam)<br>                If this is the standard way to deal with all secondary inductions, it certainly looks attractive.<br>                Elena, would you try doing this and compare with 1)?<br><br>Just to clarify, the code is currently structured to check if the PHI is an add-recurrence that was detected by SCEV.  The idea is to add a fall-back to analyze the PHI directly if its type is a float.<br><br>There is already precedence for such things in LV.  We support more reductions (including floating-point) than what SCEV can analyze, therefore RecurrenceDescriptor::AddReductionVar needs to analyze PHIs directly.<br><br>Adam<br><br><br><br>Thanks,<br>Hideki<br><br>----------------------<br>I looked at what our FORTRAN compiler (non-LLVM) does for the following (x, y, z, and f are float by default typing,<br>based on names).<br><br>       subroutine foo(x, y, z, A, N)<br>       double precision A(N)<br>       do f = x, y, z<br>         A(f) = f<br>       enddo<br>       end<br><br>The frontend computes the trip count outside of the loop (per language rule) and uses an integer primary<br>induction variable (compile-generated) for loop control. So, (future) FORTRAN usage doesn’t seem to be<br>a good example for promoting support for case A (= FP primary induction variable).<br><br><br><br>From: Chandler Carruth [mailto:chandlerc@google.com]<br>Sent: Thursday, May 19, 2016 7:03 PM<br>To: Demikhovsky, Elena <elena.demikhovsky@intel.com<mailto:elena.demikhovsky@intel.com>>; anemet@apple.com<mailto:anemet@apple.com>; Sanjoy Das <sanjoy@playingwithpointers.com<mailto:sanjoy@playingwithpointers.com>><br>Cc: Saito, Hideki <hideki.saito@intel.com<mailto:hideki.saito@intel.com>>; llvm-dev <llvm-dev@lists.llvm.org<mailto:llvm-dev@lists.llvm.org>>; Andrew Trick <atrick@apple.com<mailto:atrick@apple.com>><br>Subject: Re: [llvm-dev] Working on FP SCEV Analysis<br><br>On Thu, May 19, 2016 at 7:03 AM Demikhovsky, Elena <elena.demikhovsky@intel.com<mailto:elena.demikhovsky@intel.com>> wrote:<br>> One option would be to extend InductionDescriptor::isInductionPHI in the vectorizer to directly analyze the PHIs without SCEV support as Sanjoy suggested.  I *think* that that could be sufficient to handle case B.<br><br>I implemented this with FP SCEV and the code looks very structured, including SCEVExpander. Extending the existing structures without implementing FP SCEV will be problematic.<br>And my end goal is to handle case *A*.<br>Ok, but there have been *numerous* requests for an explanation of why this is important, and that hasn't emerged yet.<br><br>We really need to have a clear understanding of the relative importance of solving these problems in order to understand the best approach.<br><br><br><br>-           Elena<br><br>From: anemet@apple.com<mailto:anemet@apple.com> [mailto:anemet@apple.com<mailto:anemet@apple.com>]<br>Sent: Thursday, May 19, 2016 07:43<br>To: Sanjoy Das <sanjoy@playingwithpointers.com<mailto:sanjoy@playingwithpointers.com>><br>Cc: Demikhovsky, Elena <elena.demikhovsky@intel.com<mailto:elena.demikhovsky@intel.com>>; Saito, Hideki <hideki.saito@intel.com<mailto:hideki.saito@intel.com>>; llvm-dev <llvm-dev@lists.llvm.org<mailto:llvm-dev@lists.llvm.org>>; Andrew Trick <atrick@apple.com<mailto:atrick@apple.com>><br><br>Subject: Re: [llvm-dev] Working on FP SCEV Analysis<br><br><br>On May 18, 2016, at 12:17 PM, Sanjoy Das via llvm-dev <llvm-dev@lists.llvm.org<mailto:llvm-dev@lists.llvm.org>> wrote:<br><br><br><br>Demikhovsky, Elena wrote:<br>> Even then, I'd personally want to see further evidence of why the<br>correct solution is to model the floating point IV in SCEV rather than<br>find a more powerful way of converting the IV to an integer that models<br>> the non-integer values taken on by the IV. As an example, if the use<br>case is the following code with appropriate flags to relax IEEE<br>semantics so this looks like normal algabra etc:<br><br>> for (float f = 0.01f; f < 1.0f; f += 0.01f) ç **A**<br><br>...<br><br>> I'd rather see us cleverly turn it into:<br><br>> float f = 0.01f;<br><br>> for (int i = 1; i < 100; i += 1, f += 0.01f) ç **B**<br><br>I can later try to enhance IndVarSimplify::handleFloatingPointIV() in<br>order to convert**A** to **B**.<br><br>But **B** is exactly the case I’m starting from. The main IV “i” is<br>integer. The variable “f” is also considered as IV in this loop.<br><br>And this loop is not vectorized because “f” is floating point.<br><br>I don’t think that the case **B** is uncommon.<br><br>If B is the case we actually care about, I'd say changing SCEV to work with floating points is an overkill.  How would you expect an SCEVFAddExpr to help vectorize B, other than tell you what the initial value and the increment is (and these can be found with a simple value analysis)?<br><br>One option would be to extend InductionDescriptor::isInductionPHI in the vectorizer to directly analyze the PHIs without SCEV support as Sanjoy suggested.  I *think* that that could be sufficient to handle case B.<br><br>Then if we find other pressing cases to handle we can rethink the strategy.<br><br>Also the current diagnostics is pretty bad for Hideki’s testcase with TTT as float.  This is what we currently report with -Rpass-analysis=loop-vectorize:<br><br>/tmp/sss.c:3:6: remark: loop not vectorized: value that could not be<br>      identified as reduction is used outside the loop<br>      [-Rpass-analysis=loop-vectorize]<br><br>I have no clue why we say that the value is used outside the loop.  I think this should just say that we have a loop-variant value that we couldn’t identify either as an induction or as a reduction.<br><br>Adam<br><br><br>If we're interested in handling complex variants of A directly: computing trip counts, proving away predicates etc. without translating the loops to use integer IVs (perhaps because we can't legally do so), then I can see FP-SCEV as a reasonable implementation strategy, but it looks like the general consensus is that such cases are rare and generally not worth optimizing?<br><br>-- Sanjoy<br><br><br><br>-*/Elena/*<br><br>---------------------------------------------------------------------<br>Intel Israel (74) Limited<br><br>This e-mail and any attachments may contain confidential material for<br>the sole use of the intended recipient(s). Any review or distribution<br>by others is strictly prohibited. If you are not the intended<br>recipient, please contact the sender and delete all copies.<br>_______________________________________________<br>LLVM Developers mailing list<br>llvm-dev@lists.llvm.org<mailto:llvm-dev@lists.llvm.org><br>http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br><br>---------------------------------------------------------------------<br>Intel Israel (74) Limited<br>This e-mail and any attachments may contain confidential material for<br>the sole use of the intended recipient(s). Any review or distribution<br>by others is strictly prohibited. If you are not the intended<br>recipient, please contact the sender and delete all copies.<br><br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160520/3e728240/attachment.html><br><br>------------------------------<br><br>Subject: Digest Footer<br><br>_______________________________________________<br>llvm-dev mailing list<br>llvm-dev@lists.llvm.org<br>http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br><br><br>------------------------------<br><br>End of llvm-dev Digest, Vol 143, Issue 118<br>******************************************<br></body></html>