Author: dim
Date: Thu Jun  2 19:54:38 2016
New Revision: 301227
URL: https://svnweb.freebsd.org/changeset/base/301227

Log:
  Pull in r271548 from upstream llvm trunk (by me):
  
    Only attempt to detect AVG if SSE2 is available
  
    Summary:
    In PR29973 Sanjay Patel reported an assertion failure when a certain
    loop was optimized, for a target without SSE2 support.  It turned out
    this was because of the AVG pattern detection introduced in rL253952.
  
    Prevent the assertion failure by bailing out early in
    `detectAVGPattern()`, if the target does not support SSE2.
  
    Also add a minimized test case.
  
    Reviewers: congh, eli.friedman, spatel
  
    Subscribers: emaste, llvm-commits
  
    Differential Revision: http://reviews.llvm.org/D20905
  
  This should fix assertion failures ("Requires at least SSE2!") when
  building the games/0ad port with CPUTYPE=pentium3.
  
  Reported by:  madpilot

Modified:
  head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp
  head/lib/clang/include/clang/Basic/Version.inc

Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp
==============================================================================
--- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp        Thu Jun  2 
19:06:04 2016        (r301226)
+++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp        Thu Jun  2 
19:54:38 2016        (r301227)
@@ -26159,6 +26159,8 @@ static SDValue detectAVGPattern(SDValue 
   if (InScalarVT.getSizeInBits() <= ScalarVT.getSizeInBits())
     return SDValue();
 
+  if (!Subtarget->hasSSE2())
+    return SDValue();
   if (Subtarget->hasAVX512()) {
     if (VT.getSizeInBits() > 512)
       return SDValue();

Modified: head/lib/clang/include/clang/Basic/Version.inc
==============================================================================
--- head/lib/clang/include/clang/Basic/Version.inc      Thu Jun  2 19:06:04 
2016        (r301226)
+++ head/lib/clang/include/clang/Basic/Version.inc      Thu Jun  2 19:54:38 
2016        (r301227)
@@ -9,4 +9,4 @@
 
 #define        SVN_REVISION                    "262564"
 
-#define        FREEBSD_CC_VERSION              1100003U
+#define        FREEBSD_CC_VERSION              1100004U
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to