svn commit: r283015 - stable/10/contrib/llvm/patches

Dimitry Andric dim at FreeBSD.org
Sat May 16 22:06:42 UTC 2015


Author: dim
Date: Sat May 16 22:06:40 2015
New Revision: 283015
URL: https://svnweb.freebsd.org/changeset/base/283015

Log:
  Bring the contrib/llvm/patches directory up-to-date.
  
  MFC r263892:
  Add the llvm/clang patch for r263891.
  
  MFC r264350:
  Update the llvm/clang patch for r264345.
  
  MFC r266675:
  Add the clang patch for r266674.
  
  MFC r275651:
  Add llvm patch corresponding to r275633.
  
  MFC r275747:
  Update llvm patches for r274286 and r275633 so all the tests will pass.
  
  MFC r275760:
  Add clang patch corresponding to r275759.
  
  MFC r275772:
  Update clang patch for r275759 to use correct test cases.
  
  Additionally:
  * Remove the clang patch corresponding to r263619, as ARM EABI
    hard-float support was never MFC'd.
  * Add clang patch corresponding to r279302.

Added:
  stable/10/contrib/llvm/patches/patch-r264345-dwarf2-freebsd10.diff
     - copied unchanged from r264350, head/contrib/llvm/patches/patch-r264345-dwarf2-freebsd10.diff
  stable/10/contrib/llvm/patches/patch-r266674-clang-r209489-fix-xmmintrin.diff
     - copied unchanged from r266675, head/contrib/llvm/patches/patch-r266674-clang-r209489-fix-xmmintrin.diff
  stable/10/contrib/llvm/patches/patch-r275633-llvm-r223171-fix-vectorizer.diff
     - copied, changed from r275651, head/contrib/llvm/patches/patch-r275633-llvm-r223171-fix-vectorizer.diff
  stable/10/contrib/llvm/patches/patch-r275759-clang-r221170-ppc-vaarg.diff
     - copied, changed from r275760, head/contrib/llvm/patches/patch-r275759-clang-r221170-ppc-vaarg.diff
  stable/10/contrib/llvm/patches/patch-r279302-clang-r211785-add-fuse-ld.diff
Deleted:
  stable/10/contrib/llvm/patches/patch-r263619-clang-r201662-arm-gnueabihf.diff
Modified:
  stable/10/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff
Directory Properties:
  stable/10/   (props changed)

Copied: stable/10/contrib/llvm/patches/patch-r264345-dwarf2-freebsd10.diff (from r264350, head/contrib/llvm/patches/patch-r264345-dwarf2-freebsd10.diff)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/10/contrib/llvm/patches/patch-r264345-dwarf2-freebsd10.diff	Sat May 16 22:06:40 2015	(r283015, copy of r264350, head/contrib/llvm/patches/patch-r264345-dwarf2-freebsd10.diff)
@@ -0,0 +1,20 @@
+This patch makes clang default to DWARF2 debug info format for FreeBSD.
+
+Introduced here: http://svnweb.freebsd.org/changeset/base/264345
+
+Index: tools/clang/lib/Driver/Tools.cpp
+===================================================================
+--- tools/clang/lib/Driver/Tools.cpp
++++ tools/clang/lib/Driver/Tools.cpp
+@@ -2627,8 +2635,9 @@ void Clang::ConstructJob(Compilation &C, const Job
+       CmdArgs.push_back("-gdwarf-4");
+     else if (!A->getOption().matches(options::OPT_g0) &&
+              !A->getOption().matches(options::OPT_ggdb0)) {
+-      // Default is dwarf-2 for darwin.
+-      if (getToolChain().getTriple().isOSDarwin())
++      // Default is dwarf-2 for darwin and FreeBSD.
++      const llvm::Triple &Triple = getToolChain().getTriple();
++      if (Triple.isOSDarwin() || Triple.getOS() == llvm::Triple::FreeBSD)
+         CmdArgs.push_back("-gdwarf-2");
+       else
+         CmdArgs.push_back("-g");

Copied: stable/10/contrib/llvm/patches/patch-r266674-clang-r209489-fix-xmmintrin.diff (from r266675, head/contrib/llvm/patches/patch-r266674-clang-r209489-fix-xmmintrin.diff)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/10/contrib/llvm/patches/patch-r266674-clang-r209489-fix-xmmintrin.diff	Sat May 16 22:06:40 2015	(r283015, copy of r266675, head/contrib/llvm/patches/patch-r266674-clang-r209489-fix-xmmintrin.diff)
@@ -0,0 +1,49 @@
+Pull in r209489 from upstream clang trunk (by Akira Hatanaka):
+
+  Fix a bug in xmmintrin.h.
+
+  The last step of _mm_cvtps_pi16 should use _mm_packs_pi32, which is a function
+  that reads two __m64 values and packs four 32-bit values into four 16-bit
+  values.  
+
+  <rdar://problem/16873717>
+
+Pull in r209559 from upstream clang trunk (by Akira Hatanaka):
+
+  Recommit r209532 with -ffreestanding.
+
+  This is a test case for r209489.
+
+Introduced here: http://svnweb.freebsd.org/changeset/base/266674
+
+Index: tools/clang/lib/Headers/xmmintrin.h
+===================================================================
+--- tools/clang/lib/Headers/xmmintrin.h
++++ tools/clang/lib/Headers/xmmintrin.h
+@@ -903,7 +903,7 @@ _mm_cvtps_pi16(__m128 __a)
+   __a = _mm_movehl_ps(__a, __a);
+   __c = _mm_cvtps_pi32(__a);
+   
+-  return _mm_packs_pi16(__b, __c);
++  return _mm_packs_pi32(__b, __c);
+ }
+ 
+ static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
+Index: tools/clang/test/Headers/xmmintrin.c
+===================================================================
+--- tools/clang/test/Headers/xmmintrin.c
++++ tools/clang/test/Headers/xmmintrin.c
+@@ -0,0 +1,13 @@
++// RUN: %clang_cc1 %s -ffreestanding -triple x86_64-apple-macosx10.9.0 -emit-llvm -o - | FileCheck %s
++
++#include <xmmintrin.h>
++
++// Make sure the last step of _mm_cvtps_pi16 converts <4 x i32> to <4 x i16> by
++// checking that clang emits PACKSSDW instead of PACKSSWB.
++
++// CHECK: define i64 @test_mm_cvtps_pi16
++// CHECK: call x86_mmx @llvm.x86.mmx.packssdw
++
++__m64 test_mm_cvtps_pi16(__m128 a) {
++  return _mm_cvtps_pi16(a);
++}

Modified: stable/10/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff
==============================================================================
--- stable/10/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff	Sat May 16 21:24:32 2015	(r283014)
+++ stable/10/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff	Sat May 16 22:06:40 2015	(r283015)
@@ -1,3 +1,14 @@
+Pull in r200383 from upstream llvm trunk (by David Majnemer):
+
+  MC: Reorganize macro MC test along dialect lines
+
+  This commit seeks to do two things:
+  - Run the surfeit of tests under the Darwin dialect.  This ends up
+    affecting tests which assumed that spaces could deliminate arguments.
+  - The GAS dialect tests should limit their surface area to things that
+    could plausibly work under GAS. For example, Darwin style arguments
+    have no business being in such a test.
+
 Pull in r201784 from upstream llvm trunk (by Benjamin Kramer):
 
   AsmParser: Disable Darwin-style macro argument expansion on non-darwin targets.
@@ -53,3 +64,208 @@ Index: test/MC/AsmParser/exprs.s
  
  .macro check_expr
    .if ($0) != ($1)
+Index: test/MC/AsmParser/macros.s (deleted)
+===================================================================
+Index: test/MC/AsmParser/macros-darwin.s
+===================================================================
+--- test/MC/AsmParser/macros-darwin.s
++++ test/MC/AsmParser/macros-darwin.s
+@@ -1,9 +1,97 @@
+-// RUN: llvm-mc -triple i386-apple-darwin10 %s | FileCheck %s
++// RUN: not llvm-mc -triple i386-apple-darwin10 %s 2> %t.err | FileCheck %s
++// RUN: FileCheck --check-prefix=CHECK-ERRORS %s < %t.err
+ 
+-.macro test1
++.macro .test0
++.macrobody0
++.endmacro
++.macro .test1
++.test0
++.endmacro
++
++.test1
++// CHECK-ERRORS: <instantiation>:1:1: error: unknown directive
++// CHECK-ERRORS-NEXT: macrobody0
++// CHECK-ERRORS-NEXT: ^
++// CHECK-ERRORS: <instantiation>:1:1: note: while in macro instantiation
++// CHECK-ERRORS-NEXT: .test0
++// CHECK-ERRORS-NEXT: ^
++// CHECK-ERRORS: 11:1: note: while in macro instantiation
++// CHECK-ERRORS-NEXT: .test1
++// CHECK-ERRORS-NEXT: ^
++
++.macro test2
++.byte $0
++.endmacro
++// CHECK: .byte 10
++test2 10
++
++.macro test3
+ .globl "$0 $1 $2 $$3 $n"
+ .endmacro
+ 
+ // CHECK: .globl "1 23  $3 2"
+-test1 1, 2 3
++test3 1, 2 3
+ 
++// CHECK: .globl	"1 (23)  $3 2"
++test3 1, (2 3)
++
++// CHECK: .globl "12  $3 1"
++test3 1 2
++
++.macro test4
++.globl "$0 -- $1"
++.endmacro
++
++// CHECK: .globl  "(ab)(,)) -- (cd)"
++test4 (a b)(,)),(cd)
++
++// CHECK: .globl  "(ab)(,)) -- (cd)"
++test4 (a b)(,)),(cd)
++
++.macro test5 _a
++.globl "\_a"
++.endm
++
++// CHECK: .globl zed1
++test5 zed1
++
++.macro test6 $a
++.globl "\$a"
++.endm
++
++// CHECK: .globl zed2
++test6 zed2
++
++.macro test7 .a
++.globl "\.a"
++.endm
++
++// CHECK: .globl zed3
++test7 zed3
++
++.macro test8 _a, _b, _c
++.globl "\_a,\_b,\_c"
++.endmacro
++
++.macro test9 _a _b _c
++.globl "\_a \_b \_c"
++.endmacro
++
++// CHECK: .globl  "a,b,c"
++test8 a, b, c
++// CHECK: .globl  "%1,%2,%3"
++test8 %1, %2, %3 #a comment
++// CHECK: .globl "x-y,z,1"
++test8 x - y, z, 1
++// CHECK: .globl  "1 2 3"
++test9 1, 2,3
++
++test8 1,2 3
++// CHECK-ERRORS: error: macro argument '_c' is missing
++// CHECK-ERRORS-NEXT: test8 1,2 3
++// CHECK-ERRORS-NEXT:           ^
++
++test8 1 2, 3
++// CHECK-ERRORS: error: macro argument '_c' is missing
++// CHECK-ERRORS-NEXT:test8 1 2, 3
++// CHECK-ERRORS-NEXT:           ^
+Index: test/MC/AsmParser/macros-gas.s
+===================================================================
+--- test/MC/AsmParser/macros-gas.s
++++ test/MC/AsmParser/macros-gas.s
+@@ -0,0 +1,93 @@
++// RUN: not llvm-mc -triple i386-linux-gnu %s 2> %t.err | FileCheck %s
++// RUN: FileCheck --check-prefix=CHECK-ERRORS %s < %t.err
++
++.macro .test0
++.macrobody0
++.endm
++.macro .test1
++.test0
++.endm
++
++.test1
++// CHECK-ERRORS: <instantiation>:1:1: error: unknown directive
++// CHECK-ERRORS-NEXT: macrobody0
++// CHECK-ERRORS-NEXT: ^
++// CHECK-ERRORS: <instantiation>:1:1: note: while in macro instantiation
++// CHECK-ERRORS-NEXT: .test0
++// CHECK-ERRORS-NEXT: ^
++// CHECK-ERRORS: 11:1: note: while in macro instantiation
++// CHECK-ERRORS-NEXT: .test1
++// CHECK-ERRORS-NEXT: ^
++
++.macro test2 _a
++.byte \_a
++.endm
++// CHECK: .byte 10
++test2 10
++
++.macro test3 _a _b _c
++.ascii "\_a \_b \_c \\_c"
++.endm
++
++// CHECK: .ascii "1 2 3 \003"
++test3 1, 2, 3
++
++// FIXME: test3 1, 2 3 should be treated like test 1, 2, 3
++
++// FIXME: remove the n argument from the remaining test3 examples
++// CHECK: .ascii "1 (23) n \n"
++test3 1, (2 3), n
++
++// CHECK: .ascii "1 (23) n \n"
++test3 1 (2 3) n
++
++// CHECK: .ascii "1 2 n \n"
++test3 1 2 n
++
++.macro test5 _a
++.globl \_a
++.endm
++
++// CHECK: .globl zed1
++test5 zed1
++
++.macro test6 $a
++.globl \$a
++.endm
++
++// CHECK: .globl zed2
++test6 zed2
++
++.macro test7 .a
++.globl \.a
++.endm
++
++// CHECK: .globl zed3
++test7 zed3
++
++.macro test8 _a, _b, _c
++.ascii "\_a,\_b,\_c"
++.endm
++
++.macro test9 _a _b _c
++.ascii "\_a \_b \_c"
++.endm
++
++// CHECK: .ascii "a,b,c"
++test8 a, b, c
++// CHECK: .ascii "%1,%2,%3"
++test8 %1 %2 %3 #a comment
++// CHECK: .ascii "x-y,z,1"
++test8 x - y z 1
++// CHECK: .ascii "1 2 3"
++test9 1, 2,3
++
++test8 1,2 3
++// CHECK-ERRORS: error: macro argument '_c' is missing
++// CHECK-ERRORS-NEXT: test8 1,2 3
++// CHECK-ERRORS-NEXT:           ^
++
++test8 1 2, 3
++// CHECK-ERRORS: error: expected ' ' for macro argument separator
++// CHECK-ERRORS-NEXT:test8 1 2, 3
++// CHECK-ERRORS-NEXT:         ^

Copied and modified: stable/10/contrib/llvm/patches/patch-r275633-llvm-r223171-fix-vectorizer.diff (from r275651, head/contrib/llvm/patches/patch-r275633-llvm-r223171-fix-vectorizer.diff)
==============================================================================
--- head/contrib/llvm/patches/patch-r275633-llvm-r223171-fix-vectorizer.diff	Tue Dec  9 20:04:26 2014	(r275651, copy source)
+++ stable/10/contrib/llvm/patches/patch-r275633-llvm-r223171-fix-vectorizer.diff	Sat May 16 22:06:40 2015	(r283015)
@@ -1,3 +1,11 @@
+Pull in r223170 from upstream llvm trunk (by Michael Zolotukhin):
+
+  Apply loop-rotate to several vectorizer tests.
+
+  Such loops shouldn't be vectorized due to the loops form.
+  After applying loop-rotate (+simplifycfg) the tests again start to check
+  what they are intended to check.
+
 Pull in r223171 from upstream llvm trunk (by Michael Zolotukhin):
 
   PR21302. Vectorize only bottom-tested loops.
@@ -16,8 +24,8 @@ Introduced here: http://svnweb.freebsd.o
 
 Index: lib/Transforms/Vectorize/LoopVectorize.cpp
 ===================================================================
---- lib/Transforms/Vectorize/LoopVectorize.cpp	(revision 21)
-+++ lib/Transforms/Vectorize/LoopVectorize.cpp	(revision 22)
+--- lib/Transforms/Vectorize/LoopVectorize.cpp
++++ lib/Transforms/Vectorize/LoopVectorize.cpp
 @@ -2864,6 +2864,14 @@ bool LoopVectorizationLegality::canVectorize() {
    if (!TheLoop->getExitingBlock())
      return false;
@@ -35,11 +43,11 @@ Index: lib/Transforms/Vectorize/LoopVect
          TheLoop->getHeader()->getName() << '\n');
 Index: test/Transforms/LoopVectorize/loop-form.ll
 ===================================================================
---- test/Transforms/LoopVectorize/loop-form.ll	(revision 0)
-+++ test/Transforms/LoopVectorize/loop-form.ll	(revision 22)
+--- test/Transforms/LoopVectorize/loop-form.ll
++++ test/Transforms/LoopVectorize/loop-form.ll
 @@ -0,0 +1,31 @@
 +; RUN: opt -S -loop-vectorize < %s | FileCheck %s
-+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
++target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128"
 +
 +; Check that we vectorize only bottom-tested loops.
 +; This is a reduced testcase from PR21302.
@@ -69,3 +77,453 @@ Index: test/Transforms/LoopVectorize/loo
 +if.end:
 +  ret void
 +}
+Index: test/Transforms/LoopVectorize/runtime-check-address-space.ll
+===================================================================
+--- test/Transforms/LoopVectorize/runtime-check-address-space.ll
++++ test/Transforms/LoopVectorize/runtime-check-address-space.ll
+@@ -31,25 +31,23 @@ define void @foo(i32 addrspace(1)* %a, i32 addrspa
+ ; CHECK: ret
+ 
+ entry:
+-  br label %for.cond
++  %cmp1 = icmp slt i32 0, %n
++  br i1 %cmp1, label %for.body, label %for.end
+ 
+-for.cond:                                         ; preds = %for.body, %entry
+-  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
+-  %cmp = icmp slt i32 %i.0, %n
+-  br i1 %cmp, label %for.body, label %for.end
+-
+-for.body:                                         ; preds = %for.cond
+-  %idxprom = sext i32 %i.0 to i64
++for.body:                                         ; preds = %entry, %for.body
++  %i.02 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
++  %idxprom = sext i32 %i.02 to i64
+   %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %idxprom
+   %0 = load i32 addrspace(1)* %arrayidx, align 4
+   %mul = mul nsw i32 %0, 3
+-  %idxprom1 = sext i32 %i.0 to i64
++  %idxprom1 = sext i32 %i.02 to i64
+   %arrayidx2 = getelementptr inbounds i32 addrspace(1)* %a, i64 %idxprom1
+   store i32 %mul, i32 addrspace(1)* %arrayidx2, align 4
+-  %inc = add nsw i32 %i.0, 1
+-  br label %for.cond
++  %inc = add nsw i32 %i.02, 1
++  %cmp = icmp slt i32 %inc, %n
++  br i1 %cmp, label %for.body, label %for.end
+ 
+-for.end:                                          ; preds = %for.cond
++for.end:                                          ; preds = %for.body, %entry
+   ret void
+ }
+ 
+@@ -60,25 +58,23 @@ define void @bar0(i32* %a, i32 addrspace(1)* %b, i
+ ; CHECK: ret
+ 
+ entry:
+-  br label %for.cond
++  %cmp1 = icmp slt i32 0, %n
++  br i1 %cmp1, label %for.body, label %for.end
+ 
+-for.cond:                                         ; preds = %for.body, %entry
+-  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
+-  %cmp = icmp slt i32 %i.0, %n
+-  br i1 %cmp, label %for.body, label %for.end
+-
+-for.body:                                         ; preds = %for.cond
+-  %idxprom = sext i32 %i.0 to i64
++for.body:                                         ; preds = %entry, %for.body
++  %i.02 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
++  %idxprom = sext i32 %i.02 to i64
+   %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %idxprom
+   %0 = load i32 addrspace(1)* %arrayidx, align 4
+   %mul = mul nsw i32 %0, 3
+-  %idxprom1 = sext i32 %i.0 to i64
++  %idxprom1 = sext i32 %i.02 to i64
+   %arrayidx2 = getelementptr inbounds i32* %a, i64 %idxprom1
+   store i32 %mul, i32* %arrayidx2, align 4
+-  %inc = add nsw i32 %i.0, 1
+-  br label %for.cond
++  %inc = add nsw i32 %i.02, 1
++  %cmp = icmp slt i32 %inc, %n
++  br i1 %cmp, label %for.body, label %for.end
+ 
+-for.end:                                          ; preds = %for.cond
++for.end:                                          ; preds = %for.body, %entry
+   ret void
+ }
+ 
+@@ -89,25 +85,23 @@ define void @bar1(i32 addrspace(1)* %a, i32* %b, i
+ ; CHECK: ret
+ 
+ entry:
+-  br label %for.cond
++  %cmp1 = icmp slt i32 0, %n
++  br i1 %cmp1, label %for.body, label %for.end
+ 
+-for.cond:                                         ; preds = %for.body, %entry
+-  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
+-  %cmp = icmp slt i32 %i.0, %n
+-  br i1 %cmp, label %for.body, label %for.end
+-
+-for.body:                                         ; preds = %for.cond
+-  %idxprom = sext i32 %i.0 to i64
++for.body:                                         ; preds = %entry, %for.body
++  %i.02 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
++  %idxprom = sext i32 %i.02 to i64
+   %arrayidx = getelementptr inbounds i32* %b, i64 %idxprom
+   %0 = load i32* %arrayidx, align 4
+   %mul = mul nsw i32 %0, 3
+-  %idxprom1 = sext i32 %i.0 to i64
++  %idxprom1 = sext i32 %i.02 to i64
+   %arrayidx2 = getelementptr inbounds i32 addrspace(1)* %a, i64 %idxprom1
+   store i32 %mul, i32 addrspace(1)* %arrayidx2, align 4
+-  %inc = add nsw i32 %i.0, 1
+-  br label %for.cond
++  %inc = add nsw i32 %i.02, 1
++  %cmp = icmp slt i32 %inc, %n
++  br i1 %cmp, label %for.body, label %for.end
+ 
+-for.end:                                          ; preds = %for.cond
++for.end:                                          ; preds = %for.body, %entry
+   ret void
+ }
+ 
+@@ -119,25 +113,23 @@ define void @bar2(i32* noalias %a, i32 addrspace(1
+ ; CHECK: ret
+ 
+ entry:
+-  br label %for.cond
++  %cmp1 = icmp slt i32 0, %n
++  br i1 %cmp1, label %for.body, label %for.end
+ 
+-for.cond:                                         ; preds = %for.body, %entry
+-  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
+-  %cmp = icmp slt i32 %i.0, %n
+-  br i1 %cmp, label %for.body, label %for.end
+-
+-for.body:                                         ; preds = %for.cond
+-  %idxprom = sext i32 %i.0 to i64
++for.body:                                         ; preds = %entry, %for.body
++  %i.02 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
++  %idxprom = sext i32 %i.02 to i64
+   %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %idxprom
+   %0 = load i32 addrspace(1)* %arrayidx, align 4
+   %mul = mul nsw i32 %0, 3
+-  %idxprom1 = sext i32 %i.0 to i64
++  %idxprom1 = sext i32 %i.02 to i64
+   %arrayidx2 = getelementptr inbounds i32* %a, i64 %idxprom1
+   store i32 %mul, i32* %arrayidx2, align 4
+-  %inc = add nsw i32 %i.0, 1
+-  br label %for.cond
++  %inc = add nsw i32 %i.02, 1
++  %cmp = icmp slt i32 %inc, %n
++  br i1 %cmp, label %for.body, label %for.end
+ 
+-for.end:                                          ; preds = %for.cond
++for.end:                                          ; preds = %for.body, %entry
+   ret void
+ }
+ 
+@@ -149,25 +141,23 @@ define void @arst0(i32* %b, i32 %n) #0 {
+ ; CHECK: ret
+ 
+ entry:
+-  br label %for.cond
++  %cmp1 = icmp slt i32 0, %n
++  br i1 %cmp1, label %for.body, label %for.end
+ 
+-for.cond:                                         ; preds = %for.body, %entry
+-  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
+-  %cmp = icmp slt i32 %i.0, %n
+-  br i1 %cmp, label %for.body, label %for.end
+-
+-for.body:                                         ; preds = %for.cond
+-  %idxprom = sext i32 %i.0 to i64
++for.body:                                         ; preds = %entry, %for.body
++  %i.02 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
++  %idxprom = sext i32 %i.02 to i64
+   %arrayidx = getelementptr inbounds i32* %b, i64 %idxprom
+   %0 = load i32* %arrayidx, align 4
+   %mul = mul nsw i32 %0, 3
+-  %idxprom1 = sext i32 %i.0 to i64
++  %idxprom1 = sext i32 %i.02 to i64
+   %arrayidx2 = getelementptr inbounds [1024 x i32] addrspace(1)* @g_as1, i64 0, i64 %idxprom1
+   store i32 %mul, i32 addrspace(1)* %arrayidx2, align 4
+-  %inc = add nsw i32 %i.0, 1
+-  br label %for.cond
++  %inc = add nsw i32 %i.02, 1
++  %cmp = icmp slt i32 %inc, %n
++  br i1 %cmp, label %for.body, label %for.end
+ 
+-for.end:                                          ; preds = %for.cond
++for.end:                                          ; preds = %for.body, %entry
+   ret void
+ }
+ 
+@@ -180,25 +170,23 @@ define void @arst1(i32* %b, i32 %n) #0 {
+ ; CHECK: ret
+ 
+ entry:
+-  br label %for.cond
++  %cmp1 = icmp slt i32 0, %n
++  br i1 %cmp1, label %for.body, label %for.end
+ 
+-for.cond:                                         ; preds = %for.body, %entry
+-  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
+-  %cmp = icmp slt i32 %i.0, %n
+-  br i1 %cmp, label %for.body, label %for.end
+-
+-for.body:                                         ; preds = %for.cond
+-  %idxprom = sext i32 %i.0 to i64
++for.body:                                         ; preds = %entry, %for.body
++  %i.02 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
++  %idxprom = sext i32 %i.02 to i64
+   %arrayidx = getelementptr inbounds [1024 x i32] addrspace(1)* @g_as1, i64 0, i64 %idxprom
+   %0 = load i32 addrspace(1)* %arrayidx, align 4
+   %mul = mul nsw i32 %0, 3
+-  %idxprom1 = sext i32 %i.0 to i64
++  %idxprom1 = sext i32 %i.02 to i64
+   %arrayidx2 = getelementptr inbounds i32* %b, i64 %idxprom1
+   store i32 %mul, i32* %arrayidx2, align 4
+-  %inc = add nsw i32 %i.0, 1
+-  br label %for.cond
++  %inc = add nsw i32 %i.02, 1
++  %cmp = icmp slt i32 %inc, %n
++  br i1 %cmp, label %for.body, label %for.end
+ 
+-for.end:                                          ; preds = %for.cond
++for.end:                                          ; preds = %for.body, %entry
+   ret void
+ }
+ 
+@@ -210,25 +198,23 @@ define void @aoeu(i32 %n) #0 {
+ ; CHECK: ret
+ 
+ entry:
+-  br label %for.cond
++  %cmp1 = icmp slt i32 0, %n
++  br i1 %cmp1, label %for.body, label %for.end
+ 
+-for.cond:                                         ; preds = %for.body, %entry
+-  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
+-  %cmp = icmp slt i32 %i.0, %n
+-  br i1 %cmp, label %for.body, label %for.end
+-
+-for.body:                                         ; preds = %for.cond
+-  %idxprom = sext i32 %i.0 to i64
++for.body:                                         ; preds = %entry, %for.body
++  %i.02 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
++  %idxprom = sext i32 %i.02 to i64
+   %arrayidx = getelementptr inbounds [1024 x i32] addrspace(2)* @q_as2, i64 0, i64 %idxprom
+   %0 = load i32 addrspace(2)* %arrayidx, align 4
+   %mul = mul nsw i32 %0, 3
+-  %idxprom1 = sext i32 %i.0 to i64
++  %idxprom1 = sext i32 %i.02 to i64
+   %arrayidx2 = getelementptr inbounds [1024 x i32] addrspace(1)* @g_as1, i64 0, i64 %idxprom1
+   store i32 %mul, i32 addrspace(1)* %arrayidx2, align 4
+-  %inc = add nsw i32 %i.0, 1
+-  br label %for.cond
++  %inc = add nsw i32 %i.02, 1
++  %cmp = icmp slt i32 %inc, %n
++  br i1 %cmp, label %for.body, label %for.end
+ 
+-for.end:                                          ; preds = %for.cond
++for.end:                                          ; preds = %for.body, %entry
+   ret void
+ }
+ 
+Index: test/Transforms/LoopVectorize/runtime-check-readonly-address-space.ll
+===================================================================
+--- test/Transforms/LoopVectorize/runtime-check-readonly-address-space.ll
++++ test/Transforms/LoopVectorize/runtime-check-readonly-address-space.ll
+@@ -8,26 +8,24 @@ define void @add_ints_1_1_1(i32 addrspace(1)* %a,
+ ; CHECK-LABEL: @add_ints_1_1_1(
+ ; CHECK: <4 x i32>
+ ; CHECK: ret
++
+ entry:
+-  br label %for.cond
++  br label %for.body
+ 
+-for.cond:                                         ; preds = %for.body, %entry
+-  %i.0 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
+-  %cmp = icmp ult i64 %i.0, 200
+-  br i1 %cmp, label %for.body, label %for.end
+-
+-for.body:                                         ; preds = %for.cond
+-  %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %i.0
++for.body:                                         ; preds = %entry, %for.body
++  %i.01 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
++  %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %i.01
+   %0 = load i32 addrspace(1)* %arrayidx, align 4
+-  %arrayidx1 = getelementptr inbounds i32 addrspace(1)* %c, i64 %i.0
++  %arrayidx1 = getelementptr inbounds i32 addrspace(1)* %c, i64 %i.01
+   %1 = load i32 addrspace(1)* %arrayidx1, align 4
+   %add = add nsw i32 %0, %1
+-  %arrayidx2 = getelementptr inbounds i32 addrspace(1)* %a, i64 %i.0
++  %arrayidx2 = getelementptr inbounds i32 addrspace(1)* %a, i64 %i.01
+   store i32 %add, i32 addrspace(1)* %arrayidx2, align 4
+-  %inc = add i64 %i.0, 1
+-  br label %for.cond
++  %inc = add i64 %i.01, 1
++  %cmp = icmp ult i64 %inc, 200
++  br i1 %cmp, label %for.body, label %for.end
+ 
+-for.end:                                          ; preds = %for.cond
++for.end:                                          ; preds = %for.body
+   ret void
+ }
+ 
+@@ -35,26 +33,24 @@ define void @add_ints_as_1_0_0(i32 addrspace(1)* %
+ ; CHECK-LABEL: @add_ints_as_1_0_0(
+ ; CHECK-NOT: <4 x i32>
+ ; CHECK: ret
++
+ entry:
+-  br label %for.cond
++  br label %for.body
+ 
+-for.cond:                                         ; preds = %for.body, %entry
+-  %i.0 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
+-  %cmp = icmp ult i64 %i.0, 200
+-  br i1 %cmp, label %for.body, label %for.end
+-
+-for.body:                                         ; preds = %for.cond
+-  %arrayidx = getelementptr inbounds i32* %b, i64 %i.0
++for.body:                                         ; preds = %entry, %for.body
++  %i.01 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
++  %arrayidx = getelementptr inbounds i32* %b, i64 %i.01
+   %0 = load i32* %arrayidx, align 4
+-  %arrayidx1 = getelementptr inbounds i32* %c, i64 %i.0
++  %arrayidx1 = getelementptr inbounds i32* %c, i64 %i.01
+   %1 = load i32* %arrayidx1, align 4
+   %add = add nsw i32 %0, %1
+-  %arrayidx2 = getelementptr inbounds i32 addrspace(1)* %a, i64 %i.0
++  %arrayidx2 = getelementptr inbounds i32 addrspace(1)* %a, i64 %i.01
+   store i32 %add, i32 addrspace(1)* %arrayidx2, align 4
+-  %inc = add i64 %i.0, 1
+-  br label %for.cond
++  %inc = add i64 %i.01, 1
++  %cmp = icmp ult i64 %inc, 200
++  br i1 %cmp, label %for.body, label %for.end
+ 
+-for.end:                                          ; preds = %for.cond
++for.end:                                          ; preds = %for.body
+   ret void
+ }
+ 
+@@ -62,26 +58,24 @@ define void @add_ints_as_0_1_0(i32* %a, i32 addrsp
+ ; CHECK-LABEL: @add_ints_as_0_1_0(
+ ; CHECK-NOT: <4 x i32>
+ ; CHECK: ret
++
+ entry:
+-  br label %for.cond
++  br label %for.body
+ 
+-for.cond:                                         ; preds = %for.body, %entry
+-  %i.0 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
+-  %cmp = icmp ult i64 %i.0, 200
+-  br i1 %cmp, label %for.body, label %for.end
+-
+-for.body:                                         ; preds = %for.cond
+-  %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %i.0
++for.body:                                         ; preds = %entry, %for.body
++  %i.01 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
++  %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %i.01
+   %0 = load i32 addrspace(1)* %arrayidx, align 4
+-  %arrayidx1 = getelementptr inbounds i32* %c, i64 %i.0
++  %arrayidx1 = getelementptr inbounds i32* %c, i64 %i.01
+   %1 = load i32* %arrayidx1, align 4
+   %add = add nsw i32 %0, %1
+-  %arrayidx2 = getelementptr inbounds i32* %a, i64 %i.0
++  %arrayidx2 = getelementptr inbounds i32* %a, i64 %i.01
+   store i32 %add, i32* %arrayidx2, align 4
+-  %inc = add i64 %i.0, 1
+-  br label %for.cond
++  %inc = add i64 %i.01, 1
++  %cmp = icmp ult i64 %inc, 200
++  br i1 %cmp, label %for.body, label %for.end
+ 
+-for.end:                                          ; preds = %for.cond
++for.end:                                          ; preds = %for.body
+   ret void
+ }
+ 
+@@ -89,26 +83,24 @@ define void @add_ints_as_0_1_1(i32* %a, i32 addrsp
+ ; CHECK-LABEL: @add_ints_as_0_1_1(
+ ; CHECK-NOT: <4 x i32>
+ ; CHECK: ret
++
+ entry:
+-  br label %for.cond
++  br label %for.body
+ 
+-for.cond:                                         ; preds = %for.body, %entry
+-  %i.0 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
+-  %cmp = icmp ult i64 %i.0, 200
+-  br i1 %cmp, label %for.body, label %for.end
+-
+-for.body:                                         ; preds = %for.cond
+-  %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %i.0
++for.body:                                         ; preds = %entry, %for.body
++  %i.01 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
++  %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %i.01
+   %0 = load i32 addrspace(1)* %arrayidx, align 4
+-  %arrayidx1 = getelementptr inbounds i32 addrspace(1)* %c, i64 %i.0
++  %arrayidx1 = getelementptr inbounds i32 addrspace(1)* %c, i64 %i.01
+   %1 = load i32 addrspace(1)* %arrayidx1, align 4
+   %add = add nsw i32 %0, %1
+-  %arrayidx2 = getelementptr inbounds i32* %a, i64 %i.0
++  %arrayidx2 = getelementptr inbounds i32* %a, i64 %i.01
+   store i32 %add, i32* %arrayidx2, align 4
+-  %inc = add i64 %i.0, 1
+-  br label %for.cond
++  %inc = add i64 %i.01, 1
++  %cmp = icmp ult i64 %inc, 200
++  br i1 %cmp, label %for.body, label %for.end
+ 
+-for.end:                                          ; preds = %for.cond
++for.end:                                          ; preds = %for.body
+   ret void
+ }
+ 
+@@ -116,26 +108,24 @@ define void @add_ints_as_0_1_2(i32* %a, i32 addrsp
+ ; CHECK-LABEL: @add_ints_as_0_1_2(
+ ; CHECK-NOT: <4 x i32>
+ ; CHECK: ret
++
+ entry:
+-  br label %for.cond
++  br label %for.body
+ 
+-for.cond:                                         ; preds = %for.body, %entry
+-  %i.0 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
+-  %cmp = icmp ult i64 %i.0, 200
+-  br i1 %cmp, label %for.body, label %for.end
+-
+-for.body:                                         ; preds = %for.cond
+-  %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %i.0
++for.body:                                         ; preds = %entry, %for.body
++  %i.01 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
++  %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %i.01
+   %0 = load i32 addrspace(1)* %arrayidx, align 4
+-  %arrayidx1 = getelementptr inbounds i32 addrspace(2)* %c, i64 %i.0
++  %arrayidx1 = getelementptr inbounds i32 addrspace(2)* %c, i64 %i.01
+   %1 = load i32 addrspace(2)* %arrayidx1, align 4
+   %add = add nsw i32 %0, %1
+-  %arrayidx2 = getelementptr inbounds i32* %a, i64 %i.0
++  %arrayidx2 = getelementptr inbounds i32* %a, i64 %i.01
+   store i32 %add, i32* %arrayidx2, align 4
+-  %inc = add i64 %i.0, 1
+-  br label %for.cond
++  %inc = add i64 %i.01, 1
++  %cmp = icmp ult i64 %inc, 200
++  br i1 %cmp, label %for.body, label %for.end
+ 
+-for.end:                                          ; preds = %for.cond
++for.end:                                          ; preds = %for.body
+   ret void
+ }
+ 

Copied and modified: stable/10/contrib/llvm/patches/patch-r275759-clang-r221170-ppc-vaarg.diff (from r275760, head/contrib/llvm/patches/patch-r275759-clang-r221170-ppc-vaarg.diff)
==============================================================================
--- head/contrib/llvm/patches/patch-r275759-clang-r221170-ppc-vaarg.diff	Sun Dec 14 13:40:42 2014	(r275760, copy source)
+++ stable/10/contrib/llvm/patches/patch-r275759-clang-r221170-ppc-vaarg.diff	Sat May 16 22:06:40 2015	(r283015)
@@ -3,6 +3,18 @@ Pull in r221170 from upstream clang trun
   Implement vaarg lowering for ppc32. Lowering of scalars and
   aggregates is supported. Complex numbers are not.
 
+Pull in r221174 from upstream clang trunk (by Roman Divacky):
+
+  Require asserts to unbreak the buildbots.
+
+Pull in r221284 from upstream clang trunk (by Roman Divacky):
+
+  Rewrite the test to not require asserts.
+
+Pull in r221285 from upstream clang trunk (by Roman Divacky):
+
+  Since the file has both ppc and ppc64 tests in it rename it.
+
 This adds va_args support for PowerPC (32 bit) to clang.
 
 Introduced here: http://svnweb.freebsd.org/changeset/base/275759
@@ -136,106 +148,151 @@ Index: tools/clang/test/CodeGen/ppc64-va
 ===================================================================
 --- tools/clang/test/CodeGen/ppc64-varargs-struct.c
 +++ tools/clang/test/CodeGen/ppc64-varargs-struct.c
-@@ -1,5 +1,6 @@
- // REQUIRES: ppc64-registered-target
- // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
+@@ -1,30 +0,0 @@
+-// REQUIRES: ppc64-registered-target
+-// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
+-
+-#include <stdarg.h>
+-
+-struct x {
+-  long a;
+-  double b;
+-};
+-
+-void testva (int n, ...)
+-{
+-  va_list ap;
+-
+-  struct x t = va_arg (ap, struct x);
+-// CHECK: bitcast i8* %{{[a-z.0-9]*}} to %struct.x*
+-// CHECK: bitcast %struct.x* %t to i8*
+-// CHECK: bitcast %struct.x* %{{[0-9]+}} to i8*
+-// CHECK: call void @llvm.memcpy
+-
+-  int v = va_arg (ap, int);
+-// CHECK: ptrtoint i8* %{{[a-z.0-9]*}} to i64
+-// CHECK: add i64 %{{[0-9]+}}, 4
+-// CHECK: inttoptr i64 %{{[0-9]+}} to i8*
+-// CHECK: bitcast i8* %{{[0-9]+}} to i32*
+-
+-  __int128_t u = va_arg (ap, __int128_t);
+-// CHECK: bitcast i8* %{{[a-z.0-9]+}} to i128*
+-// CHECK-NEXT: load i128* %{{[0-9]+}}
+-}
+Index: tools/clang/test/CodeGen/ppc-varargs-struct.c
+===================================================================
+--- tools/clang/test/CodeGen/ppc-varargs-struct.c
++++ tools/clang/test/CodeGen/ppc-varargs-struct.c
+@@ -0,0 +1,112 @@
++// REQUIRES: ppc64-registered-target
++// REQUIRES: asserts
++// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
 +// RUN: %clang_cc1 -triple powerpc-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-PPC
- 
- #include <stdarg.h>
- 
-@@ -17,6 +18,46 @@ void testva (int n, ...)
- // CHECK: bitcast %struct.x* %t to i8*
- // CHECK: bitcast %struct.x* %{{[0-9]+}} to i8*
- // CHECK: call void @llvm.memcpy
-+// CHECK-PPC:  %arraydecay = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i32 0, i32 0
-+// CHECK-PPC-NEXT:  %gprptr = bitcast %struct.__va_list_tag* %arraydecay to i8*
-+// CHECK-PPC-NEXT:  %0 = ptrtoint i8* %gprptr to i32
-+// CHECK-PPC-NEXT:  %1 = add i32 %0, 1
-+// CHECK-PPC-NEXT:  %2 = inttoptr i32 %1 to i8*
-+// CHECK-PPC-NEXT:  %3 = add i32 %1, 3
-+// CHECK-PPC-NEXT:  %4 = inttoptr i32 %3 to i8**
-+// CHECK-PPC-NEXT:  %5 = add i32 %3, 4
-+// CHECK-PPC-NEXT:  %6 = inttoptr i32 %5 to i8**
-+// CHECK-PPC-NEXT:  %gpr = load i8* %gprptr
-+// CHECK-PPC-NEXT:  %fpr = load i8* %2
-+// CHECK-PPC-NEXT:  %overflow_area = load i8** %4
-+// CHECK-PPC-NEXT:  %7 = ptrtoint i8* %overflow_area to i32
-+// CHECK-PPC-NEXT:  %regsave_area = load i8** %6
-+// CHECK-PPC-NEXT:  %8 = ptrtoint i8* %regsave_area to i32
-+// CHECK-PPC-NEXT:  %cond = icmp ult i8 %gpr, 8
-+// CHECK-PPC-NEXT:  %9 = mul i8 %gpr, 4
-+// CHECK-PPC-NEXT:  %10 = sext i8 %9 to i32
-+// CHECK-PPC-NEXT:  %11 = add i32 %8, %10
-+// CHECK-PPC-NEXT:  br i1 %cond, label %using_regs, label %using_overflow
-+//
-+// CHECK-PPC-LABEL:using_regs:                                       ; preds = %entry
-+// CHECK-PPC-NEXT:  %12 = inttoptr i32 %11 to %struct.x*
-+// CHECK-PPC-NEXT:  %13 = add i8 %gpr, 1
-+// CHECK-PPC-NEXT:  store i8 %13, i8* %gprptr
-+// CHECK-PPC-NEXT:  br label %cont
-+//
-+// CHECK-PPC-LABEL:using_overflow:                                   ; preds = %entry
-+// CHECK-PPC-NEXT:  %14 = inttoptr i32 %7 to %struct.x*
-+// CHECK-PPC-NEXT:  %15 = add i32 %7, 4
-+// CHECK-PPC-NEXT:  %16 = inttoptr i32 %15 to i8*
-+// CHECK-PPC-NEXT:  store i8* %16, i8** %4
-+// CHECK-PPC-NEXT:  br label %cont
-+//
-+// CHECK-PPC-LABEL:cont:                                             ; preds = %using_overflow, %using_regs
-+// CHECK-PPC-NEXT:  %vaarg.addr = phi %struct.x* [ %12, %using_regs ], [ %14, %using_overflow ]
-+// CHECK-PPC-NEXT:  %aggrptr = bitcast %struct.x* %vaarg.addr to i8**
-+// CHECK-PPC-NEXT:  %aggr = load i8** %aggrptr
-+// CHECK-PPC-NEXT:  %17 = bitcast %struct.x* %t to i8*
-+// CHECK-PPC-NEXT:  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %17, i8* %aggr, i32 16, i32 8, i1 false)
- 
-   int v = va_arg (ap, int);
- // CHECK: ptrtoint i8* %{{[a-z.0-9]*}} to i64
-@@ -23,8 +64,48 @@ void testva (int n, ...)
- // CHECK: add i64 %{{[0-9]+}}, 4
- // CHECK: inttoptr i64 %{{[0-9]+}} to i8*
- // CHECK: bitcast i8* %{{[0-9]+}} to i32*
-+// CHECK-PPC:  %arraydecay1 = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i32 0, i32 0
-+// CHECK-PPC-NEXT:  %gprptr2 = bitcast %struct.__va_list_tag* %arraydecay1 to i8*
-+// CHECK-PPC-NEXT:  %18 = ptrtoint i8* %gprptr2 to i32
-+// CHECK-PPC-NEXT:  %19 = add i32 %18, 1
-+// CHECK-PPC-NEXT:  %20 = inttoptr i32 %19 to i8*
-+// CHECK-PPC-NEXT:  %21 = add i32 %19, 3
-+// CHECK-PPC-NEXT:  %22 = inttoptr i32 %21 to i8**
-+// CHECK-PPC-NEXT:  %23 = add i32 %21, 4
-+// CHECK-PPC-NEXT:  %24 = inttoptr i32 %23 to i8**
-+// CHECK-PPC-NEXT:  %gpr3 = load i8* %gprptr2
-+// CHECK-PPC-NEXT:  %fpr4 = load i8* %20
-+// CHECK-PPC-NEXT:  %overflow_area5 = load i8** %22
-+// CHECK-PPC-NEXT:  %25 = ptrtoint i8* %overflow_area5 to i32
-+// CHECK-PPC-NEXT:  %regsave_area6 = load i8** %24
-+// CHECK-PPC-NEXT:  %26 = ptrtoint i8* %regsave_area6 to i32
-+// CHECK-PPC-NEXT:  %cond7 = icmp ult i8 %gpr3, 8
-+// CHECK-PPC-NEXT:  %27 = mul i8 %gpr3, 4
-+// CHECK-PPC-NEXT:  %28 = sext i8 %27 to i32
-+// CHECK-PPC-NEXT:  %29 = add i32 %26, %28
-+// CHECK-PPC-NEXT:  br i1 %cond7, label %using_regs8, label %using_overflow9
-+//
-+// CHECK-PPC-LABEL:using_regs8:                                      ; preds = %cont
-+// CHECK-PPC-NEXT:  %30 = inttoptr i32 %29 to i32*
-+// CHECK-PPC-NEXT:  %31 = add i8 %gpr3, 1
-+// CHECK-PPC-NEXT:  store i8 %31, i8* %gprptr2
-+// CHECK-PPC-NEXT:  br label %cont10
-+//
-+// CHECK-PPC-LABEL:using_overflow9:                                  ; preds = %cont
-+// CHECK-PPC-NEXT:  %32 = inttoptr i32 %25 to i32*
-+// CHECK-PPC-NEXT:  %33 = add i32 %25, 4
-+// CHECK-PPC-NEXT:  %34 = inttoptr i32 %33 to i8*
-+// CHECK-PPC-NEXT:  store i8* %34, i8** %22
-+// CHECK-PPC-NEXT:  br label %cont10
-+//
-+// CHECK-PPC-LABEL:cont10:                                           ; preds = %using_overflow9, %using_regs8
-+// CHECK-PPC-NEXT:  %vaarg.addr11 = phi i32* [ %30, %using_regs8 ], [ %32, %using_overflow9 ]
-+// CHECK-PPC-NEXT:  %35 = load i32* %vaarg.addr11
-+// CHECK-PPC-NEXT:  store i32 %35, i32* %v, align 4
- 
++
++#include <stdarg.h>
++
++struct x {
++  long a;
++  double b;
++};
++
++void testva (int n, ...)
++{
++  va_list ap;
++
++  struct x t = va_arg (ap, struct x);
++// CHECK: bitcast i8* %{{[a-z.0-9]*}} to %struct.x*
++// CHECK: bitcast %struct.x* %t to i8*
++// CHECK: bitcast %struct.x* %{{[0-9]+}} to i8*
++// CHECK: call void @llvm.memcpy
++// CHECK-PPC:  [[ARRAYDECAY:%[a-z0-9]+]] = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i32 0, i32 0
++// CHECK-PPC-NEXT:  [[GPRPTR:%[a-z0-9]+]] = bitcast %struct.__va_list_tag* [[ARRAYDECAY]] to i8*
++// CHECK-PPC-NEXT:  [[ZERO:%[0-9]+]] = ptrtoint i8* [[GPRPTR]] to i32
++// CHECK-PPC-NEXT:  [[ONE:%[0-9]+]] = add i32 [[ZERO]], 1
++// CHECK-PPC-NEXT:  [[TWO:%[0-9]+]] = inttoptr i32 [[ONE]] to i8*
++// CHECK-PPC-NEXT:  [[THREE:%[0-9]+]] = add i32 [[ONE]], 3
++// CHECK-PPC-NEXT:  [[FOUR:%[0-9]+]] = inttoptr i32 [[THREE]] to i8**
++// CHECK-PPC-NEXT:  [[FIVE:%[0-9]+]] = add i32 [[THREE]], 4
++// CHECK-PPC-NEXT:  [[SIX:%[0-9]+]] = inttoptr i32 [[FIVE]] to i8**
++// CHECK-PPC-NEXT:  [[GPR:%[a-z0-9]+]] = load i8* [[GPRPTR]]
++// CHECK-PPC-NEXT:  [[FPR:%[a-z0-9]+]] = load i8* [[TWO]] 
++// CHECK-PPC-NEXT:  [[OVERFLOW_AREA:%[a-z_0-9]+]] = load i8** [[FOUR]]
++// CHECK-PPC-NEXT:  [[SEVEN:%[0-9]+]] = ptrtoint i8* [[OVERFLOW_AREA]] to i32
++// CHECK-PPC-NEXT:  [[REGSAVE_AREA:%[a-z_0-9]+]] = load i8** [[SIX]]
++// CHECK-PPC-NEXT:  [[EIGHT:%[0-9]+]] = ptrtoint i8* [[REGSAVE_AREA]] to i32
++// CHECK-PPC-NEXT:  [[COND:%[a-z0-9]+]] = icmp ult i8 [[GPR]], 8
++// CHECK-PPC-NEXT:  [[NINE:%[0-9]+]] = mul i8 [[GPR]], 4
++// CHECK-PPC-NEXT:  [[TEN:%[0-9]+]] = sext i8 [[NINE]] to i32
++// CHECK-PPC-NEXT:  [[ELEVEN:%[0-9]+]] = add i32 [[EIGHT]], [[TEN]]
++// CHECK-PPC-NEXT:  br i1 [[COND]], label [[USING_REGS:%[a-z_0-9]+]], label [[USING_OVERFLOW:%[a-z_0-9]+]]
++//
++// CHECK-PPC1:[[USING_REGS]]
++// CHECK-PPC:  [[TWELVE:%[0-9]+]] = inttoptr i32 [[ELEVEN]] to %struct.x*
++// CHECK-PPC-NEXT:  [[THIRTEEN:%[0-9]+]] = add i8 [[GPR]], 1
++// CHECK-PPC-NEXT:  store i8 [[THIRTEEN]], i8* [[GPRPTR]]
++// CHECK-PPC-NEXT:  br label [[CONT:%[a-z0-9]+]]
++//

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-all mailing list