r271166 - Fix typo.

2016-05-28 Thread Rafael Espindola via cfe-commits
Author: rafael
Date: Sat May 28 22:03:22 2016
New Revision: 271166

URL: http://llvm.org/viewvc/llvm-project?rev=271166=rev
Log:
Fix typo.

Thanks to David Majnemer for noticing.

Modified:
cfe/trunk/include/clang/Driver/CC1Options.td

Modified: cfe/trunk/include/clang/Driver/CC1Options.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=271166=271165=271166=diff
==
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Sat May 28 22:03:22 2016
@@ -144,7 +144,7 @@ def mno_exec_stack : Flag<["-"], "mnoexe
 def massembler_fatal_warnings : Flag<["-"], "massembler-fatal-warnings">,
   HelpText<"Make assembler warnings fatal">;
 def mrelax_relocations : Flag<["--"], "mrelax-relocations">,
-HelpText<"Use relaxabel elf relocations">;
+HelpText<"Use relaxable elf relocations">;
 def compress_debug_sections : Flag<["-"], "compress-debug-sections">,
 HelpText<"Compress DWARF debug sections using zlib">;
 def msave_temp_labels : Flag<["-"], "msave-temp-labels">,


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r271165 - [CodeGen] Use the ArrayRef form CreateShuffleVector instead of building ConstantVectors or ConstantDataVectors and calling the other form.

2016-05-28 Thread Craig Topper via cfe-commits
Author: ctopper
Date: Sat May 28 21:39:30 2016
New Revision: 271165

URL: http://llvm.org/viewvc/llvm-project?rev=271165=rev
Log:
[CodeGen] Use the ArrayRef form CreateShuffleVector instead of building 
ConstantVectors or ConstantDataVectors and calling the other form.

Modified:
cfe/trunk/lib/CodeGen/CGBuiltin.cpp

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=271165=271164=271165=diff
==
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Sat May 28 21:39:30 2016
@@ -3268,14 +3268,13 @@ Value *CodeGenFunction::EmitCommonNeonBu
   case NEON::BI__builtin_neon_vext_v:
   case NEON::BI__builtin_neon_vextq_v: {
 int CV = cast(Ops[2])->getSExtValue();
-SmallVector Indices;
+SmallVector Indices;
 for (unsigned i = 0, e = VTy->getNumElements(); i != e; ++i)
-  Indices.push_back(ConstantInt::get(Int32Ty, i+CV));
+  Indices.push_back(i+CV);
 
 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
-Value *SV = llvm::ConstantVector::get(Indices);
-return Builder.CreateShuffleVector(Ops[0], Ops[1], SV, "vext");
+return Builder.CreateShuffleVector(Ops[0], Ops[1], Indices, "vext");
   }
   case NEON::BI__builtin_neon_vfma_v:
   case NEON::BI__builtin_neon_vfmaq_v: {
@@ -3473,14 +3472,13 @@ Value *CodeGenFunction::EmitCommonNeonBu
 Value *SV = nullptr;
 
 for (unsigned vi = 0; vi != 2; ++vi) {
-  SmallVector Indices;
+  SmallVector Indices;
   for (unsigned i = 0, e = VTy->getNumElements(); i != e; i += 2) {
-Indices.push_back(Builder.getInt32(i+vi));
-Indices.push_back(Builder.getInt32(i+e+vi));
+Indices.push_back(i+vi);
+Indices.push_back(i+e+vi);
   }
   Value *Addr = Builder.CreateConstInBoundsGEP1_32(Ty, Ops[0], vi);
-  SV = llvm::ConstantVector::get(Indices);
-  SV = Builder.CreateShuffleVector(Ops[1], Ops[2], SV, "vtrn");
+  SV = Builder.CreateShuffleVector(Ops[1], Ops[2], Indices, "vtrn");
   SV = Builder.CreateDefaultAlignedStore(SV, Addr);
 }
 return SV;
@@ -3502,13 +3500,12 @@ Value *CodeGenFunction::EmitCommonNeonBu
 Value *SV = nullptr;
 
 for (unsigned vi = 0; vi != 2; ++vi) {
-  SmallVector Indices;
+  SmallVector Indices;
   for (unsigned i = 0, e = VTy->getNumElements(); i != e; ++i)
-Indices.push_back(ConstantInt::get(Int32Ty, 2*i+vi));
+Indices.push_back(2*i+vi);
 
   Value *Addr = Builder.CreateConstInBoundsGEP1_32(Ty, Ops[0], vi);
-  SV = llvm::ConstantVector::get(Indices);
-  SV = Builder.CreateShuffleVector(Ops[1], Ops[2], SV, "vuzp");
+  SV = Builder.CreateShuffleVector(Ops[1], Ops[2], Indices, "vuzp");
   SV = Builder.CreateDefaultAlignedStore(SV, Addr);
 }
 return SV;
@@ -3521,14 +3518,13 @@ Value *CodeGenFunction::EmitCommonNeonBu
 Value *SV = nullptr;
 
 for (unsigned vi = 0; vi != 2; ++vi) {
-  SmallVector Indices;
+  SmallVector Indices;
   for (unsigned i = 0, e = VTy->getNumElements(); i != e; i += 2) {
-Indices.push_back(ConstantInt::get(Int32Ty, (i + vi*e) >> 1));
-Indices.push_back(ConstantInt::get(Int32Ty, ((i + vi*e) >> 1)+e));
+Indices.push_back((i + vi*e) >> 1);
+Indices.push_back(((i + vi*e) >> 1)+e);
   }
   Value *Addr = Builder.CreateConstInBoundsGEP1_32(Ty, Ops[0], vi);
-  SV = llvm::ConstantVector::get(Indices);
-  SV = Builder.CreateShuffleVector(Ops[1], Ops[2], SV, "vzip");
+  SV = Builder.CreateShuffleVector(Ops[1], Ops[2], Indices, "vzip");
   SV = Builder.CreateDefaultAlignedStore(SV, Addr);
 }
 return SV;
@@ -3577,18 +3573,18 @@ static Value *packTBLDVectorList(CodeGen
 TblOps.push_back(ExtOp);
 
   // Build a vector containing sequential number like (0, 1, 2, ..., 15)  
-  SmallVector Indices;
+  SmallVector Indices;
   llvm::VectorType *TblTy = cast(Ops[0]->getType());
   for (unsigned i = 0, e = TblTy->getNumElements(); i != e; ++i) {
-Indices.push_back(ConstantInt::get(CGF.Int32Ty, 2*i));
-Indices.push_back(ConstantInt::get(CGF.Int32Ty, 2*i+1));
+Indices.push_back(2*i);
+Indices.push_back(2*i+1);
   }
-  Value *SV = llvm::ConstantVector::get(Indices);
 
   int PairPos = 0, End = Ops.size() - 1;
   while (PairPos < End) {
 TblOps.push_back(CGF.Builder.CreateShuffleVector(Ops[PairPos],
- Ops[PairPos+1], SV, 
Name));
+ Ops[PairPos+1], Indices,
+ Name));
 PairPos += 2;
   }
 
@@ -3597,7 +3593,7 @@ static Value *packTBLDVectorList(CodeGen
   if (PairPos == End) {
 

r271163 - Mark test as requiring x86-registered-target.

2016-05-28 Thread Rafael Espindola via cfe-commits
Author: rafael
Date: Sat May 28 21:36:16 2016
New Revision: 271163

URL: http://llvm.org/viewvc/llvm-project?rev=271163=rev
Log:
Mark test as requiring x86-registered-target.

Modified:
cfe/trunk/test/CodeGen/relax.c

Modified: cfe/trunk/test/CodeGen/relax.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/relax.c?rev=271163=271162=271163=diff
==
--- cfe/trunk/test/CodeGen/relax.c (original)
+++ cfe/trunk/test/CodeGen/relax.c Sat May 28 21:36:16 2016
@@ -1,3 +1,4 @@
+// REQUIRES: x86-registered-target
 // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-obj --mrelax-relocations 
%s -mrelocation-model pic -o %t
 // RUN: llvm-readobj -r %t | FileCheck  %s
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r271162 - Handle -Wa,--mrelax-relocations=[no|yes].

2016-05-28 Thread David Majnemer via cfe-commits
On Sat, May 28, 2016 at 7:01 PM, Rafael Espindola via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: rafael
> Date: Sat May 28 21:01:14 2016
> New Revision: 271162
>
> URL: http://llvm.org/viewvc/llvm-project?rev=271162=rev
> Log:
> Handle -Wa,--mrelax-relocations=[no|yes].
>
> Added:
> cfe/trunk/test/CodeGen/relax.c
> cfe/trunk/test/Driver/relax.c
> cfe/trunk/test/Driver/relax.s
> Modified:
> cfe/trunk/include/clang/Driver/CC1Options.td
> cfe/trunk/include/clang/Frontend/CodeGenOptions.def
> cfe/trunk/lib/CodeGen/BackendUtil.cpp
> cfe/trunk/lib/Driver/Tools.cpp
> cfe/trunk/lib/Frontend/CompilerInvocation.cpp
> cfe/trunk/tools/driver/cc1as_main.cpp
>
> Modified: cfe/trunk/include/clang/Driver/CC1Options.td
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=271162=271161=271162=diff
>
> ==
> --- cfe/trunk/include/clang/Driver/CC1Options.td (original)
> +++ cfe/trunk/include/clang/Driver/CC1Options.td Sat May 28 21:01:14 2016
> @@ -143,6 +143,8 @@ def mno_exec_stack : Flag<["-"], "mnoexe
>HelpText<"Mark the file as not needing an executable stack">;
>  def massembler_fatal_warnings : Flag<["-"], "massembler-fatal-warnings">,
>HelpText<"Make assembler warnings fatal">;
> +def mrelax_relocations : Flag<["--"], "mrelax-relocations">,
> +HelpText<"Use relaxabel elf relocations">;
>

relaxable?


>  def compress_debug_sections : Flag<["-"], "compress-debug-sections">,
>  HelpText<"Compress DWARF debug sections using zlib">;
>  def msave_temp_labels : Flag<["-"], "msave-temp-labels">,
>
> Modified: cfe/trunk/include/clang/Frontend/CodeGenOptions.def
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/CodeGenOptions.def?rev=271162=271161=271162=diff
>
> ==
> --- cfe/trunk/include/clang/Frontend/CodeGenOptions.def (original)
> +++ cfe/trunk/include/clang/Frontend/CodeGenOptions.def Sat May 28
> 21:01:14 2016
> @@ -30,6 +30,7 @@ CODEGENOPT(Name, Bits, Default)
>
>  CODEGENOPT(DisableIntegratedAS, 1, 0) ///< -no-integrated-as
>  CODEGENOPT(CompressDebugSections, 1, 0) ///< -Wa,-compress-debug-sections
> +CODEGENOPT(RelaxELFRelocations, 1, 0) ///< -Wa,--mrelax-relocations
>  CODEGENOPT(AsmVerbose, 1, 0) ///< -dA, -fverbose-asm.
>  CODEGENOPT(AssumeSaneOperatorNew , 1, 1) ///< implicit
> __attribute__((malloc)) operator new
>  CODEGENOPT(Autolink  , 1, 1) ///< -fno-autolink
>
> Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=271162=271161=271162=diff
>
> ==
> --- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
> +++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Sat May 28 21:01:14 2016
> @@ -593,6 +593,7 @@ TargetMachine *EmitAssemblyHelper::Creat
>Options.UseInitArray = CodeGenOpts.UseInitArray;
>Options.DisableIntegratedAS = CodeGenOpts.DisableIntegratedAS;
>Options.CompressDebugSections = CodeGenOpts.CompressDebugSections;
> +  Options.RelaxELFRelocations = CodeGenOpts.RelaxELFRelocations;
>
>// Set EABI version.
>Options.EABIVersion =
> llvm::StringSwitch(TargetOpts.EABIVersion)
>
> Modified: cfe/trunk/lib/Driver/Tools.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=271162=271161=271162=diff
>
> ==
> --- cfe/trunk/lib/Driver/Tools.cpp (original)
> +++ cfe/trunk/lib/Driver/Tools.cpp Sat May 28 21:01:14 2016
> @@ -2797,6 +2797,8 @@ static void CollectArgsForIntegratedAsse
>// When using an integrated assembler, translate -Wa, and -Xassembler
>// options.
>bool CompressDebugSections = false;
> +
> +  bool UseRelaxRelocations = false;
>const char *MipsTargetFeature = nullptr;
>for (const Arg *A :
> Args.filtered(options::OPT_Wa_COMMA, options::OPT_Xassembler)) {
> @@ -2872,6 +2874,12 @@ static void CollectArgsForIntegratedAsse
>} else if (Value == "-nocompress-debug-sections" ||
>   Value == "--nocompress-debug-sections") {
>  CompressDebugSections = false;
> +  } else if (Value == "-mrelax-relocations=yes" ||
> + Value == "--mrelax-relocations=yes") {
> +UseRelaxRelocations = true;
> +  } else if (Value == "-mrelax-relocations=no" ||
> + Value == "--mrelax-relocations=no") {
> +UseRelaxRelocations = false;
>} else if (Value.startswith("-I")) {
>  CmdArgs.push_back(Value.data());
>  // We need to consume the next argument if the current arg is a
> plain
> @@ -2903,6 +2911,8 @@ static void CollectArgsForIntegratedAsse
>  else
>D.Diag(diag::warn_debug_compression_unavailable);
>}
> +  if 

r271162 - Handle -Wa,--mrelax-relocations=[no|yes].

2016-05-28 Thread Rafael Espindola via cfe-commits
Author: rafael
Date: Sat May 28 21:01:14 2016
New Revision: 271162

URL: http://llvm.org/viewvc/llvm-project?rev=271162=rev
Log:
Handle -Wa,--mrelax-relocations=[no|yes].

Added:
cfe/trunk/test/CodeGen/relax.c
cfe/trunk/test/Driver/relax.c
cfe/trunk/test/Driver/relax.s
Modified:
cfe/trunk/include/clang/Driver/CC1Options.td
cfe/trunk/include/clang/Frontend/CodeGenOptions.def
cfe/trunk/lib/CodeGen/BackendUtil.cpp
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/tools/driver/cc1as_main.cpp

Modified: cfe/trunk/include/clang/Driver/CC1Options.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=271162=271161=271162=diff
==
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Sat May 28 21:01:14 2016
@@ -143,6 +143,8 @@ def mno_exec_stack : Flag<["-"], "mnoexe
   HelpText<"Mark the file as not needing an executable stack">;
 def massembler_fatal_warnings : Flag<["-"], "massembler-fatal-warnings">,
   HelpText<"Make assembler warnings fatal">;
+def mrelax_relocations : Flag<["--"], "mrelax-relocations">,
+HelpText<"Use relaxabel elf relocations">;
 def compress_debug_sections : Flag<["-"], "compress-debug-sections">,
 HelpText<"Compress DWARF debug sections using zlib">;
 def msave_temp_labels : Flag<["-"], "msave-temp-labels">,

Modified: cfe/trunk/include/clang/Frontend/CodeGenOptions.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/CodeGenOptions.def?rev=271162=271161=271162=diff
==
--- cfe/trunk/include/clang/Frontend/CodeGenOptions.def (original)
+++ cfe/trunk/include/clang/Frontend/CodeGenOptions.def Sat May 28 21:01:14 2016
@@ -30,6 +30,7 @@ CODEGENOPT(Name, Bits, Default)
 
 CODEGENOPT(DisableIntegratedAS, 1, 0) ///< -no-integrated-as
 CODEGENOPT(CompressDebugSections, 1, 0) ///< -Wa,-compress-debug-sections
+CODEGENOPT(RelaxELFRelocations, 1, 0) ///< -Wa,--mrelax-relocations
 CODEGENOPT(AsmVerbose, 1, 0) ///< -dA, -fverbose-asm.
 CODEGENOPT(AssumeSaneOperatorNew , 1, 1) ///< implicit __attribute__((malloc)) 
operator new
 CODEGENOPT(Autolink  , 1, 1) ///< -fno-autolink

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=271162=271161=271162=diff
==
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Sat May 28 21:01:14 2016
@@ -593,6 +593,7 @@ TargetMachine *EmitAssemblyHelper::Creat
   Options.UseInitArray = CodeGenOpts.UseInitArray;
   Options.DisableIntegratedAS = CodeGenOpts.DisableIntegratedAS;
   Options.CompressDebugSections = CodeGenOpts.CompressDebugSections;
+  Options.RelaxELFRelocations = CodeGenOpts.RelaxELFRelocations;
 
   // Set EABI version.
   Options.EABIVersion = llvm::StringSwitch(TargetOpts.EABIVersion)

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=271162=271161=271162=diff
==
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sat May 28 21:01:14 2016
@@ -2797,6 +2797,8 @@ static void CollectArgsForIntegratedAsse
   // When using an integrated assembler, translate -Wa, and -Xassembler
   // options.
   bool CompressDebugSections = false;
+
+  bool UseRelaxRelocations = false;
   const char *MipsTargetFeature = nullptr;
   for (const Arg *A :
Args.filtered(options::OPT_Wa_COMMA, options::OPT_Xassembler)) {
@@ -2872,6 +2874,12 @@ static void CollectArgsForIntegratedAsse
   } else if (Value == "-nocompress-debug-sections" ||
  Value == "--nocompress-debug-sections") {
 CompressDebugSections = false;
+  } else if (Value == "-mrelax-relocations=yes" ||
+ Value == "--mrelax-relocations=yes") {
+UseRelaxRelocations = true;
+  } else if (Value == "-mrelax-relocations=no" ||
+ Value == "--mrelax-relocations=no") {
+UseRelaxRelocations = false;
   } else if (Value.startswith("-I")) {
 CmdArgs.push_back(Value.data());
 // We need to consume the next argument if the current arg is a plain
@@ -2903,6 +2911,8 @@ static void CollectArgsForIntegratedAsse
 else
   D.Diag(diag::warn_debug_compression_unavailable);
   }
+  if (UseRelaxRelocations)
+CmdArgs.push_back("--mrelax-relocations");
   if (MipsTargetFeature != nullptr) {
 CmdArgs.push_back("-target-feature");
 CmdArgs.push_back(MipsTargetFeature);

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: 

Re: [PATCH] D20359: [LLVM][AVX512][Intrinsics] Convert AVX non-temporal store builtins to LLVM-native IR.

2016-05-28 Thread Simon Pilgrim via cfe-commits
RKSimon added a subscriber: RKSimon.
RKSimon added a comment.

Should AVX512 store support (non-temporal or otherwise) be added to 
X86FastISel::X86FastEmitStore ?


http://reviews.llvm.org/D20359



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r271138 - CodeGen: support blocks on COFF targets in DLLs

2016-05-28 Thread Saleem Abdulrasool via cfe-commits
Author: compnerd
Date: Sat May 28 14:41:35 2016
New Revision: 271138

URL: http://llvm.org/viewvc/llvm-project?rev=271138=rev
Log:
CodeGen: support blocks on COFF targets in DLLs

This extends the blocks support to support blocks with a dynamically linked
blocks runtime.  The previous code generation would work only for static builds
of the blocks runtime.  Mark the block "isa" pointers and functions as dllimport
if no explicit declaration marked with __declspec(dllexport) is found.  This
additional check allows for the use of the functionality in the runtime library
if desired.

Added:
cfe/trunk/test/CodeGen/blocks-windows.c
Modified:
cfe/trunk/lib/CodeGen/CGBlocks.cpp

Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=271138=271137=271138=diff
==
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Sat May 28 14:41:35 2016
@@ -2287,9 +2287,35 @@ void CodeGenFunction::enterByrefCleanup(
 /// Adjust the declaration of something from the blocks API.
 static void configureBlocksRuntimeObject(CodeGenModule ,
  llvm::Constant *C) {
-  if (!CGM.getLangOpts().BlocksRuntimeOptional) return;
-
   auto *GV = cast(C->stripPointerCasts());
+
+  if (CGM.getTarget().getTriple().isOSBinFormatCOFF()) {
+IdentifierInfo  = CGM.getContext().Idents.get(C->getName());
+TranslationUnitDecl *TUDecl = CGM.getContext().getTranslationUnitDecl();
+DeclContext *DC = TranslationUnitDecl::castToDeclContext(TUDecl);
+
+assert((isa(C) || isa(C)) &&
+   "expected Function or GlobalValue");
+
+const NamedDecl *ND = nullptr;
+for (const auto  : DC->lookup())
+  if ((ND = dyn_cast(Result)) ||
+  (ND = dyn_cast(Result)))
+break;
+
+// TODO: support static blocks runtime
+if (GV->isDeclaration() && (!ND || !ND->hasAttr())) {
+  GV->setDLLStorageClass(llvm::GlobalValue::DLLImportStorageClass);
+  GV->setLinkage(llvm::GlobalValue::ExternalLinkage);
+} else {
+  GV->setDLLStorageClass(llvm::GlobalValue::DLLExportStorageClass);
+  GV->setLinkage(llvm::GlobalValue::ExternalLinkage);
+}
+  }
+
+  if (!CGM.getLangOpts().BlocksRuntimeOptional)
+return;
+
   if (GV->isDeclaration() && GV->hasExternalLinkage())
 GV->setLinkage(llvm::GlobalValue::ExternalWeakLinkage);
 }
@@ -2337,5 +2363,5 @@ llvm::Constant *CodeGenModule::getNSConc
Int8PtrTy->getPointerTo(),
nullptr);
   configureBlocksRuntimeObject(*this, NSConcreteStackBlock);
-  return NSConcreteStackBlock;  
+  return NSConcreteStackBlock;
 }

Added: cfe/trunk/test/CodeGen/blocks-windows.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/blocks-windows.c?rev=271138=auto
==
--- cfe/trunk/test/CodeGen/blocks-windows.c (added)
+++ cfe/trunk/test/CodeGen/blocks-windows.c Sat May 28 14:41:35 2016
@@ -0,0 +1,76 @@
+// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec 
-DBLOCKS_IN_BLOCKS_DECL -S -emit-llvm %s -o - | FileCheck %s -check-prefix 
CHECK-BLOCKS-IN-BLOCKS-DECL
+// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec 
-DBLOCKS_IN_BLOCKS_DEFN -S -emit-llvm %s -o - | FileCheck %s -check-prefix 
CHECK-BLOCKS-IN-BLOCKS-DEFN
+// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec -S -emit-llvm 
%s -o - | FileCheck %s -check-prefix CHECK-BLOCKS-NOT-IN-BLOCKS
+// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec 
-DBLOCKS_NOT_IN_BLOCKS_EXTERN -S -emit-llvm %s -o - | FileCheck %s 
-check-prefix CHECK-BLOCKS-NOT-IN-BLOCKS-EXTERN
+// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec 
-DBLCOKS_NOT_IN_BLOCKS_EXTERN_DLLIMPORT -S -emit-llvm %s -o - | FileCheck %s 
-check-prefix CHECK-BLOCKS-NOT-IN-BLOCKS-EXTERN-DLLIMPORT
+// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec 
-DBLCOKS_NOT_IN_BLOCKS_DLLIMPORT -S -emit-llvm %s -o - | FileCheck %s 
-check-prefix CHECK-BLOCKS-NOT-IN-BLOCKS-DLLIMPORT
+
+// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec 
-DBLOCKS_IN_BLOCKS_DECL -Os -S -emit-llvm %s -o - | FileCheck %s -check-prefix 
CHECK-BLOCKS-IN-BLOCKS-DECL
+// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec 
-DBLOCKS_IN_BLOCKS_DEFN -Os -S -emit-llvm %s -o - | FileCheck %s -check-prefix 
CHECK-BLOCKS-IN-BLOCKS-DEFN
+// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec -Os -S 
-emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-BLOCKS-NOT-IN-BLOCKS
+// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec 
-DBLOCKS_NOT_IN_BLOCKS_EXTERN -Os -S -emit-llvm %s -o - | FileCheck %s 
-check-prefix CHECK-BLOCKS-NOT-IN-BLOCKS-EXTERN
+// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec 

[PATCH] D20773: [Sema] Fix incorrect enum token namespace

2016-05-28 Thread Etienne Bergeron via cfe-commits
etienneb created this revision.
etienneb added a reviewer: rsmith.
etienneb added a subscriber: cfe-commits.

This patch fix the scoping of enum literal. They were not resolving
to the right type.

It was not causing any problem as one is a copy of the other one.

The literal in the switch are resolving to Sema.h:5527
```
  enum AccessResult {
AR_accessible,
AR_inaccessible,
AR_dependent,
AR_delayed
  };
```

Instead of SemaAccess.cpp:27
```
/// A copy of Sema's enum without AR_delayed.
enum AccessResult {
  AR_accessible,
  AR_inaccessible,
  AR_dependent
};
```

This issue was found by a new clang-tidy check (still on-going).

http://reviews.llvm.org/D20773

Files:
  lib/Sema/SemaAccess.cpp

Index: lib/Sema/SemaAccess.cpp
===
--- lib/Sema/SemaAccess.cpp
+++ lib/Sema/SemaAccess.cpp
@@ -1766,9 +1766,9 @@
   // while the ParsingDeclarator is active.
   EffectiveContext EC(CurContext);
   switch (CheckEffectiveAccess(*this, EC, target->getLocation(), entity)) {
-  case AR_accessible: return Sema::AR_accessible;
-  case AR_inaccessible: return Sema::AR_inaccessible;
-  case AR_dependent: return Sema::AR_dependent;
+  case ::AR_accessible: return Sema::AR_accessible;
+  case ::AR_inaccessible: return Sema::AR_inaccessible;
+  case ::AR_dependent: return Sema::AR_dependent;
   }
   llvm_unreachable("invalid access result");
 }


Index: lib/Sema/SemaAccess.cpp
===
--- lib/Sema/SemaAccess.cpp
+++ lib/Sema/SemaAccess.cpp
@@ -1766,9 +1766,9 @@
   // while the ParsingDeclarator is active.
   EffectiveContext EC(CurContext);
   switch (CheckEffectiveAccess(*this, EC, target->getLocation(), entity)) {
-  case AR_accessible: return Sema::AR_accessible;
-  case AR_inaccessible: return Sema::AR_inaccessible;
-  case AR_dependent: return Sema::AR_dependent;
+  case ::AR_accessible: return Sema::AR_accessible;
+  case ::AR_inaccessible: return Sema::AR_inaccessible;
+  case ::AR_dependent: return Sema::AR_dependent;
   }
   llvm_unreachable("invalid access result");
 }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r271134 - [AVX512] Add masked v16i32 and v8i64 unaligned store tests.

2016-05-28 Thread Craig Topper via cfe-commits
Author: ctopper
Date: Sat May 28 13:59:06 2016
New Revision: 271134

URL: http://llvm.org/viewvc/llvm-project?rev=271134=rev
Log:
[AVX512] Add masked v16i32 and v8i64 unaligned store tests.

Modified:
cfe/trunk/test/CodeGen/avx512f-builtins.c

Modified: cfe/trunk/test/CodeGen/avx512f-builtins.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512f-builtins.c?rev=271134=271133=271134=diff
==
--- cfe/trunk/test/CodeGen/avx512f-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512f-builtins.c Sat May 28 13:59:06 2016
@@ -196,6 +196,18 @@ void test_mm512_mask_store_pd(void *p, _
   _mm512_mask_store_pd(p, m, a);
 }
 
+void test_mm512_mask_storeu_epi32(void *__P, __mmask16 __U, __m512i __A) {
+  // CHECK-LABEL: @test_mm512_mask_storeu_epi32
+  // CHECK: @llvm.x86.avx512.mask.storeu.d.512
+  return _mm512_mask_storeu_epi32(__P, __U, __A); 
+}
+
+void test_mm512_mask_storeu_epi64(void *__P, __mmask8 __U, __m512i __A) {
+  // CHECK-LABEL: @test_mm512_mask_storeu_epi64
+  // CHECK: @llvm.x86.avx512.mask.storeu.q.512
+  return _mm512_mask_storeu_epi64(__P, __U, __A); 
+}
+
 __m512i test_mm512_loadu_si512 (void *__P)
 {
   // CHECK-LABEL: @test_mm512_loadu_si512 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D20772: Automatically detect export lists for OS X.

2016-05-28 Thread Eric Fiselier via cfe-commits
EricWF created this revision.
EricWF added reviewers: mclow.lists, bcraig, dexonsmith.
EricWF added a subscriber: cfe-commits.

Libc++ reexports symbols from the system libc++abi using 
-reexport_symbols_list. This can cause a linker failure if the list contains 
symbols not defined in the system libc++abi.
This patch attempts to detect the OS X version and use it to determine the 
correct symbol list. 

It's my understanding that `lib/libc++abi2.exp` should be used on 10.9 and 
greater. Otherwise 'lib/libc++abi.exp' should be used

This fixes PR25666 (https://llvm.org/bugs/show_bug.cgi?id=25666)

http://reviews.llvm.org/D20772

Files:
  lib/CMakeLists.txt

Index: lib/CMakeLists.txt
===
--- lib/CMakeLists.txt
+++ lib/CMakeLists.txt
@@ -88,7 +88,21 @@
 if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
 LIBCXX_CXX_ABI_LIBNAME STREQUAL "none"))
   if (NOT DEFINED LIBCXX_LIBCPPABI_VERSION)
-set(LIBCXX_LIBCPPABI_VERSION "2")
+set(LIBCXX_LIBCPPABI_VERSION "2") # Default value
+execute_process(
+  COMMAND xcrun --show-sdk-version
+  OUTPUT_VARIABLE sdk_ver
+  RESULT_VARIABLE res
+  OUTPUT_STRIP_TRAILING_WHITESPACE)
+if (res EQUAL 0)
+  message(STATUS "Found SDK version ${sdk_ver}")
+  string(REPLACE "10." "" sdk_ver "${sdk_ver}")
+  if (sdk_ver LESS 9)
+set(LIBCXX_LIBCPPABI_VERSION "")
+  else()
+set(LIBCXX_LIBCPPABI_VERSION "2")
+  endif()
+endif()
   endif()
 
   if ( CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.6" )


Index: lib/CMakeLists.txt
===
--- lib/CMakeLists.txt
+++ lib/CMakeLists.txt
@@ -88,7 +88,21 @@
 if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
 LIBCXX_CXX_ABI_LIBNAME STREQUAL "none"))
   if (NOT DEFINED LIBCXX_LIBCPPABI_VERSION)
-set(LIBCXX_LIBCPPABI_VERSION "2")
+set(LIBCXX_LIBCPPABI_VERSION "2") # Default value
+execute_process(
+  COMMAND xcrun --show-sdk-version
+  OUTPUT_VARIABLE sdk_ver
+  RESULT_VARIABLE res
+  OUTPUT_STRIP_TRAILING_WHITESPACE)
+if (res EQUAL 0)
+  message(STATUS "Found SDK version ${sdk_ver}")
+  string(REPLACE "10." "" sdk_ver "${sdk_ver}")
+  if (sdk_ver LESS 9)
+set(LIBCXX_LIBCPPABI_VERSION "")
+  else()
+set(LIBCXX_LIBCPPABI_VERSION "2")
+  endif()
+endif()
   endif()
 
   if ( CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.6" )
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r271110 - [driver][mips] Fix local variable naming. NFC

2016-05-28 Thread Simon Atanasyan via cfe-commits
Author: atanasyan
Date: Sat May 28 04:44:15 2016
New Revision: 271110

URL: http://llvm.org/viewvc/llvm-project?rev=271110=rev
Log:
[driver][mips] Fix local variable naming. NFC

Modified:
cfe/trunk/lib/Driver/ToolChains.cpp

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=271110=271109=271110=diff
==
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Sat May 28 04:44:15 2016
@@ -2262,9 +2262,9 @@ static bool findMIPSMultilibs(const Driv
   TargetTriple.getOS() == llvm::Triple::Linux &&
   TargetTriple.getEnvironment() == llvm::Triple::GNU) {
 // Select mips-mti-linux-gnu toolchain.
-for (auto candidate : {, }) {
-  if (candidate->select(Flags, Result.SelectedMultilib)) {
-Result.Multilibs = *candidate;
+for (auto Candidate : {, }) {
+  if (Candidate->select(Flags, Result.SelectedMultilib)) {
+Result.Multilibs = *Candidate;
 return true;
   }
 }
@@ -2275,9 +2275,9 @@ static bool findMIPSMultilibs(const Driv
   TargetTriple.getOS() == llvm::Triple::Linux &&
   TargetTriple.getEnvironment() == llvm::Triple::GNU) {
 // Select mips-img-linux-gnu toolchain.
-for (auto candidate : {, }) {
-  if (candidate->select(Flags, Result.SelectedMultilib)) {
-Result.Multilibs = *candidate;
+for (auto Candidate : {, }) {
+  if (Candidate->select(Flags, Result.SelectedMultilib)) {
+Result.Multilibs = *Candidate;
 return true;
   }
 }


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20684: [X86][SSE] Replace VPMOVSX and (V)PMOVZX integer extension intrinsics with generic IR (clang)

2016-05-28 Thread Simon Pilgrim via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL271106: [X86][SSE] Replace VPMOVSX and (V)PMOVZX integer 
extension intrinsics with… (authored by RKSimon).

Changed prior to commit:
  http://reviews.llvm.org/D20684?vs=58626=58884#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D20684

Files:
  cfe/trunk/include/clang/Basic/BuiltinsX86.def
  cfe/trunk/lib/Headers/avx2intrin.h
  cfe/trunk/lib/Headers/smmintrin.h
  cfe/trunk/test/CodeGen/avx2-builtins.c
  cfe/trunk/test/CodeGen/builtins-x86.c
  cfe/trunk/test/CodeGen/sse41-builtins.c

Index: cfe/trunk/include/clang/Basic/BuiltinsX86.def
===
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def
@@ -382,12 +382,6 @@
 TARGET_BUILTIN(__builtin_ia32_pminsd128, "V4iV4iV4i", "", "sse4.1")
 TARGET_BUILTIN(__builtin_ia32_pminud128, "V4iV4iV4i", "", "sse4.1")
 TARGET_BUILTIN(__builtin_ia32_pminuw128, "V8sV8sV8s", "", "sse4.1")
-TARGET_BUILTIN(__builtin_ia32_pmovzxbd128, "V4iV16c", "", "sse4.1")
-TARGET_BUILTIN(__builtin_ia32_pmovzxbq128, "V2LLiV16c", "", "sse4.1")
-TARGET_BUILTIN(__builtin_ia32_pmovzxbw128, "V8sV16c", "", "sse4.1")
-TARGET_BUILTIN(__builtin_ia32_pmovzxdq128, "V2LLiV4i", "", "sse4.1")
-TARGET_BUILTIN(__builtin_ia32_pmovzxwd128, "V4iV8s", "", "sse4.1")
-TARGET_BUILTIN(__builtin_ia32_pmovzxwq128, "V2LLiV8s", "", "sse4.1")
 TARGET_BUILTIN(__builtin_ia32_pmuldq128, "V2LLiV4iV4i", "", "sse4.1")
 TARGET_BUILTIN(__builtin_ia32_pmulld128, "V4iV4iV4i", "", "sse4.1")
 TARGET_BUILTIN(__builtin_ia32_roundps, "V4fV4fIi", "", "sse4.1")
@@ -558,18 +552,6 @@
 TARGET_BUILTIN(__builtin_ia32_pminsw256, "V16sV16sV16s", "", "avx2")
 TARGET_BUILTIN(__builtin_ia32_pminsd256, "V8iV8iV8i", "", "avx2")
 TARGET_BUILTIN(__builtin_ia32_pmovmskb256, "iV32c", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovsxbw256, "V16sV16c", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovsxbd256, "V8iV16c", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovsxbq256, "V4LLiV16c", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovsxwd256, "V8iV8s", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovsxwq256, "V4LLiV8s", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovsxdq256, "V4LLiV4i", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovzxbw256, "V16sV16c", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovzxbd256, "V8iV16c", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovzxbq256, "V4LLiV16c", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovzxwd256, "V8iV8s", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovzxwq256, "V4LLiV8s", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovzxdq256, "V4LLiV4i", "", "avx2")
 TARGET_BUILTIN(__builtin_ia32_pmuldq256, "V4LLiV8iV8i", "", "avx2")
 TARGET_BUILTIN(__builtin_ia32_pmulhrsw256, "V16sV16sV16s", "", "avx2")
 TARGET_BUILTIN(__builtin_ia32_pmulhuw256, "V16sV16sV16s", "", "avx2")
Index: cfe/trunk/test/CodeGen/sse41-builtins.c
===
--- cfe/trunk/test/CodeGen/sse41-builtins.c
+++ cfe/trunk/test/CodeGen/sse41-builtins.c
@@ -119,37 +119,43 @@
 
 __m128i test_mm_cvtepu8_epi16(__m128i a) {
   // CHECK-LABEL: test_mm_cvtepu8_epi16
-  // CHECK: call <8 x i16> @llvm.x86.sse41.pmovzxbw(<16 x i8> {{.*}})
+  // CHECK: shufflevector <16 x i8> {{.*}}, <16 x i8> {{.*}}, <8 x i32> 
+  // CHECK: zext <8 x i8> {{.*}} to <8 x i16>
   return _mm_cvtepu8_epi16(a);
 }
 
 __m128i test_mm_cvtepu8_epi32(__m128i a) {
   // CHECK-LABEL: test_mm_cvtepu8_epi32
-  // CHECK: call <4 x i32> @llvm.x86.sse41.pmovzxbd(<16 x i8> {{.*}})
+  // CHECK: shufflevector <16 x i8> {{.*}}, <16 x i8> {{.*}}, <4 x i32> 
+  // CHECK: zext <4 x i8> {{.*}} to <4 x i32>
   return _mm_cvtepu8_epi32(a);
 }
 
 __m128i test_mm_cvtepu8_epi64(__m128i a) {
   // CHECK-LABEL: test_mm_cvtepu8_epi64
-  // CHECK: call <2 x i64> @llvm.x86.sse41.pmovzxbq(<16 x i8> {{.*}})
+  // CHECK: shufflevector <16 x i8> {{.*}}, <16 x i8> {{.*}}, <2 x i32> 
+  // CHECK: zext <2 x i8> {{.*}} to <2 x i64>
   return _mm_cvtepu8_epi64(a);
 }
 
 __m128i test_mm_cvtepu16_epi32(__m128i a) {
   // CHECK-LABEL: test_mm_cvtepu16_epi32
-  // CHECK: call <4 x i32> @llvm.x86.sse41.pmovzxwd(<8 x i16> {{.*}})
+  // CHECK: shufflevector <8 x i16> {{.*}}, <8 x i16> {{.*}}, <4 x i32> 
+  // CHECK: zext <4 x i16> {{.*}} to <4 x i32>
   return _mm_cvtepu16_epi32(a);
 }
 
 __m128i test_mm_cvtepu16_epi64(__m128i a) {
   // CHECK-LABEL: test_mm_cvtepu16_epi64
-  // CHECK: call <2 x i64> @llvm.x86.sse41.pmovzxwq(<8 x i16> {{.*}})
+  // CHECK: shufflevector <8 x i16> {{.*}}, <8 x i16> {{.*}}, <2 x i32> 
+  // CHECK: zext <2 x i16> {{.*}} to <2 x i64>
   return _mm_cvtepu16_epi64(a);
 }
 
 __m128i test_mm_cvtepu32_epi64(__m128i a) {
   // CHECK-LABEL: test_mm_cvtepu32_epi64
-  // CHECK: call <2 x i64> @llvm.x86.sse41.pmovzxdq(<4 x i32> {{.*}})
+  // CHECK: shufflevector <4 x i32> {{.*}}, <4 x i32> {{.*}}, <2 x i32> 
+  // CHECK: zext <2 x i32> {{.*}} to <2 x i64>
   

r271106 - [X86][SSE] Replace VPMOVSX and (V)PMOVZX integer extension intrinsics with generic IR (clang)

2016-05-28 Thread Simon Pilgrim via cfe-commits
Author: rksimon
Date: Sat May 28 03:12:45 2016
New Revision: 271106

URL: http://llvm.org/viewvc/llvm-project?rev=271106=rev
Log:
[X86][SSE] Replace VPMOVSX and (V)PMOVZX integer extension intrinsics with 
generic IR (clang)

The VPMOVSX and (V)PMOVZX sign/zero extension intrinsics can be safely 
represented as generic __builtin_convertvector calls instead of x86 intrinsics.

This patch removes the clang builtins and their use in the sse2/avx headers - a 
companion patch will remove/auto-upgrade the llvm intrinsics.

Note: We already did this for SSE41 PMOVSX sometime ago.

Differential Revision: http://reviews.llvm.org/D20684

Modified:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/lib/Headers/avx2intrin.h
cfe/trunk/lib/Headers/smmintrin.h
cfe/trunk/test/CodeGen/avx2-builtins.c
cfe/trunk/test/CodeGen/builtins-x86.c
cfe/trunk/test/CodeGen/sse41-builtins.c

Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=271106=271105=271106=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Sat May 28 03:12:45 2016
@@ -382,12 +382,6 @@ TARGET_BUILTIN(__builtin_ia32_pminsb128,
 TARGET_BUILTIN(__builtin_ia32_pminsd128, "V4iV4iV4i", "", "sse4.1")
 TARGET_BUILTIN(__builtin_ia32_pminud128, "V4iV4iV4i", "", "sse4.1")
 TARGET_BUILTIN(__builtin_ia32_pminuw128, "V8sV8sV8s", "", "sse4.1")
-TARGET_BUILTIN(__builtin_ia32_pmovzxbd128, "V4iV16c", "", "sse4.1")
-TARGET_BUILTIN(__builtin_ia32_pmovzxbq128, "V2LLiV16c", "", "sse4.1")
-TARGET_BUILTIN(__builtin_ia32_pmovzxbw128, "V8sV16c", "", "sse4.1")
-TARGET_BUILTIN(__builtin_ia32_pmovzxdq128, "V2LLiV4i", "", "sse4.1")
-TARGET_BUILTIN(__builtin_ia32_pmovzxwd128, "V4iV8s", "", "sse4.1")
-TARGET_BUILTIN(__builtin_ia32_pmovzxwq128, "V2LLiV8s", "", "sse4.1")
 TARGET_BUILTIN(__builtin_ia32_pmuldq128, "V2LLiV4iV4i", "", "sse4.1")
 TARGET_BUILTIN(__builtin_ia32_pmulld128, "V4iV4iV4i", "", "sse4.1")
 TARGET_BUILTIN(__builtin_ia32_roundps, "V4fV4fIi", "", "sse4.1")
@@ -558,18 +552,6 @@ TARGET_BUILTIN(__builtin_ia32_pminsb256,
 TARGET_BUILTIN(__builtin_ia32_pminsw256, "V16sV16sV16s", "", "avx2")
 TARGET_BUILTIN(__builtin_ia32_pminsd256, "V8iV8iV8i", "", "avx2")
 TARGET_BUILTIN(__builtin_ia32_pmovmskb256, "iV32c", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovsxbw256, "V16sV16c", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovsxbd256, "V8iV16c", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovsxbq256, "V4LLiV16c", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovsxwd256, "V8iV8s", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovsxwq256, "V4LLiV8s", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovsxdq256, "V4LLiV4i", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovzxbw256, "V16sV16c", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovzxbd256, "V8iV16c", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovzxbq256, "V4LLiV16c", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovzxwd256, "V8iV8s", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovzxwq256, "V4LLiV8s", "", "avx2")
-TARGET_BUILTIN(__builtin_ia32_pmovzxdq256, "V4LLiV4i", "", "avx2")
 TARGET_BUILTIN(__builtin_ia32_pmuldq256, "V4LLiV8iV8i", "", "avx2")
 TARGET_BUILTIN(__builtin_ia32_pmulhrsw256, "V16sV16sV16s", "", "avx2")
 TARGET_BUILTIN(__builtin_ia32_pmulhuw256, "V16sV16sV16s", "", "avx2")

Modified: cfe/trunk/lib/Headers/avx2intrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx2intrin.h?rev=271106=271105=271106=diff
==
--- cfe/trunk/lib/Headers/avx2intrin.h (original)
+++ cfe/trunk/lib/Headers/avx2intrin.h Sat May 28 03:12:45 2016
@@ -360,73 +360,85 @@ _mm256_movemask_epi8(__m256i __a)
 static __inline__ __m256i __DEFAULT_FN_ATTRS
 _mm256_cvtepi8_epi16(__m128i __V)
 {
-  return (__m256i)__builtin_ia32_pmovsxbw256((__v16qi)__V);
+  /* This function always performs a signed extension, but __v16qi is a char
+ which may be signed or unsigned, so use __v16qs. */
+  return (__m256i)__builtin_convertvector((__v16qs)__V, __v16hi);
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS
 _mm256_cvtepi8_epi32(__m128i __V)
 {
-  return (__m256i)__builtin_ia32_pmovsxbd256((__v16qi)__V);
+  /* This function always performs a signed extension, but __v16qi is a char
+ which may be signed or unsigned, so use __v16qs. */
+  return 
(__m256i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__V, 
(__v16qs)__V, 0, 1, 2, 3, 4, 5, 6, 7), __v8si);
 }
 
 static __inline__ __m256i __DEFAULT_FN_ATTRS
 _mm256_cvtepi8_epi64(__m128i __V)
 {
-  return (__m256i)__builtin_ia32_pmovsxbq256((__v16qi)__V);
+  /* This function always performs a signed extension, but __v16qi is a char
+ which may be signed or unsigned, so use __v16qs. */
+  return 

Re: [libcxx] r271060 - Tolerate incorrect return type for 'isinf' and 'isnan' in tests.

2016-05-28 Thread Richard Smith via cfe-commits
On 28 May 2016 12:58 a.m., "Eric Fiselier via cfe-commits" <
cfe-commits@lists.llvm.org> wrote:
>
> I think that would be a possibility. However IMO such a change has little
value. Unlike other uses of `_LIBCPP_PREFERRED_OVERLOAD`, which fix const
correctness issue, I don't think the int vs bool return type distinction as
that important. Perhaps I"m just being ignorant?

I don't think it's likely to be particularly important, but it seems pretty
easy for us to fix with the techniques we're using elsewhere.

> /Eric
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libcxx] r271060 - Tolerate incorrect return type for 'isinf' and 'isnan' in tests.

2016-05-28 Thread Eric Fiselier via cfe-commits
I think that would be a possibility. However IMO such a change has little
value. Unlike other uses of `_LIBCPP_PREFERRED_OVERLOAD`, which fix const
correctness issue, I don't think the int vs bool return type distinction as
that important. Perhaps I"m just being ignorant?

/Eric
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libcxx] r271060 - Tolerate incorrect return type for 'isinf' and 'isnan' in tests.

2016-05-28 Thread Richard Smith via cfe-commits
Could we use __LIBCPP_PREFERRED_OVERLOAD to get this working even with
older glibc (and recent clang)?

On 27 May 2016 3:26 p.m., "Eric Fiselier via cfe-commits" <
cfe-commits@lists.llvm.org> wrote:

> Author: ericwf
> Date: Fri May 27 17:19:53 2016
> New Revision: 271060
>
> URL: http://llvm.org/viewvc/llvm-project?rev=271060=rev
> Log:
> Tolerate incorrect return type for 'isinf' and 'isnan' in tests.
>
> Summary:
> GLIBC recently removed the incorrect `int isinf(double)` and `int
> isnan(double)` overloads in C++11 and greater. This causes previously
> `XFAIL: linux`  tests to start passing.
>
> Since there is no longer a way to 'XFAIL' the tests I choose to simply
> tolerate this bug.
>
> See https://sourceware.org/bugzilla/show_bug.cgi?id=19439
>
>
> Reviewers: rsmith, mclow.lists, EricWF
>
> Subscribers: jroelofs, cfe-commits
>
> Differential Revision: http://reviews.llvm.org/D19835
>
> Removed:
> libcxx/trunk/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp
> libcxx/trunk/test/std/depr/depr.c.headers/math_h_isnan.pass.cpp
> libcxx/trunk/test/std/numerics/c.math/cmath_isinf.pass.cpp
> libcxx/trunk/test/std/numerics/c.math/cmath_isnan.pass.cpp
> Modified:
> libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp
> libcxx/trunk/test/std/numerics/c.math/cmath.pass.cpp
>
> Modified: libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp?rev=271060=271059=271060=diff
>
> ==
> --- libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp (original)
> +++ libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp Fri May 27
> 17:19:53 2016
> @@ -9,9 +9,6 @@
>
>  // 
>
> -// NOTE: isinf and isnan are tested separately because they are expected
> to fail
> -// on linux. We don't want their expected failure to hide other failures
> in this file.
> -
>  #include 
>  #include 
>  #include 
> @@ -631,6 +628,29 @@ void test_isgreaterequal()
>  assert(isgreaterequal(-1.0, 0.F) == false);
>  }
>
> +void test_isinf()
> +{
> +#ifdef isinf
> +#error isinf defined
> +#endif
> +static_assert((std::is_same::value),
> "");
> +
> +typedef decltype(isinf((double)0)) DoubleRetType;
> +#ifndef __linux__
> +static_assert((std::is_same::value), "");
> +#else
> +// GLIBC < 2.26 defines 'isinf(double)' with a return type of 'int' in
> +// all C++ dialects. The test should tolerate this.
> +// See: https://sourceware.org/bugzilla/show_bug.cgi?id=19439
> +static_assert((std::is_same::value
> +|| std::is_same::value), "");
> +#endif
> +
> +static_assert((std::is_same::value), "");
> +static_assert((std::is_same bool>::value), "");
> +assert(isinf(-1.0) == false);
> +}
> +
>  void test_isless()
>  {
>  #ifdef isless
> @@ -688,6 +708,29 @@ void test_islessgreater()
>  assert(islessgreater(-1.0, 0.F) == true);
>  }
>
> +void test_isnan()
> +{
> +#ifdef isnan
> +#error isnan defined
> +#endif
> +static_assert((std::is_same::value),
> "");
> +
> +typedef decltype(isnan((double)0)) DoubleRetType;
> +#ifndef __linux__
> +static_assert((std::is_same::value), "");
> +#else
> +// GLIBC < 2.26 defines 'isnan(double)' with a return type of 'int' in
> +// all C++ dialects. The test should tolerate this.
> +// See: https://sourceware.org/bugzilla/show_bug.cgi?id=19439
> +static_assert((std::is_same::value
> +|| std::is_same::value), "");
> +#endif
> +
> +static_assert((std::is_same::value), "");
> +static_assert((std::is_same bool>::value), "");
> +assert(isnan(-1.0) == false);
> +}
> +
>  void test_isunordered()
>  {
>  #ifdef isunordered
> @@ -1443,9 +1486,11 @@ int main()
>  test_isnormal();
>  test_isgreater();
>  test_isgreaterequal();
> +test_isinf();
>  test_isless();
>  test_islessequal();
>  test_islessgreater();
> +test_isnan();
>  test_isunordered();
>  test_acosh();
>  test_asinh();
>
> Removed: libcxx/trunk/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp?rev=271059=auto
>
> ==
> --- libcxx/trunk/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp
> (original)
> +++ libcxx/trunk/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp
> (removed)
> @@ -1,30 +0,0 @@
>
> -//===--===//
> -//
> -// The 

Re: [PATCH] D20766: [clang-tidy] Fix script adding new clang-tidy check

2016-05-28 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

LG


http://reviews.llvm.org/D20766



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D20767: [ASTMatchers] Add support of hasCondition for SwitchStmt.

2016-05-28 Thread Etienne Bergeron via cfe-commits
etienneb created this revision.
etienneb added reviewers: aaron.ballman, sbenza.
etienneb added a subscriber: cfe-commits.
Herald added a subscriber: klimek.

The switch statement could be added to the hasCondition matcher.

Example:
```
clang-query> match switchStmt(hasCondition(ignoringImpCasts(declRefExpr(
```

Output:
```
Match #1:

Binding for "root":
SwitchStmt 0x2f9b528 
|-<<>>
|-ImplicitCastExpr 0x2f9b510  'int' 
| `-ImplicitCastExpr 0x2f9b4f8  'enum Color' 
|   `-DeclRefExpr 0x2f9b4d0  'enum Color' lvalue Var 0x2f9a118 'C' 
'enum Color'
`-CompoundStmt 0x2f9b610 
  |-CaseStmt 0x2f9b578 
  | |-ImplicitCastExpr 0x2f9b638  'int' 
  | | `-DeclRefExpr 0x2f9b550  'enum Size' EnumConstant 0x2f99e40 
'Small' 'enum Size'
  | |-<<>>
  | `-ReturnStmt 0x2f9b5d0 
  |   `-IntegerLiteral 0x2f9b5b0  'int' 1
  `-DefaultStmt 0x2f9b5f0 
`-BreakStmt 0x2f9b5e8 

1 match.
```

http://reviews.llvm.org/D20767

Files:
  docs/LibASTMatchersReference.html
  include/clang/ASTMatchers/ASTMatchers.h
  unittests/ASTMatchers/ASTMatchersTraversalTest.cpp

Index: unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
===
--- unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
+++ unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
@@ -958,6 +958,28 @@
   callee(cxxMethodDecl(hasName("x";
 }
 
+TEST(Matcher, HasCondition) {
+  StatementMatcher IfStmt =
+ifStmt(hasCondition(cxxBoolLiteral(equals(true;
+  EXPECT_TRUE(matches("void x() { if (true) {} }", IfStmt));
+  EXPECT_TRUE(notMatches("void x() { if (false) {} }", IfStmt));
+
+  StatementMatcher ForStmt =
+forStmt(hasCondition(cxxBoolLiteral(equals(true;
+  EXPECT_TRUE(matches("void x() { for (;true;) {} }", ForStmt));
+  EXPECT_TRUE(notMatches("void x() { for (;false;) {} }", ForStmt));
+
+  StatementMatcher WhileStmt =
+whileStmt(hasCondition(cxxBoolLiteral(equals(true;
+  EXPECT_TRUE(matches("void x() { while (true) {} }", WhileStmt));
+  EXPECT_TRUE(notMatches("void x() { while (false) {} }", WhileStmt));
+
+  StatementMatcher SwitchStmt =
+switchStmt(hasCondition(integerLiteral(equals(42;
+  EXPECT_TRUE(matches("void x() { switch (42) {case 42:;} }", SwitchStmt));
+  EXPECT_TRUE(notMatches("void x() { switch (43) {case 43:;} }", SwitchStmt));
+}
+
 TEST(For, ForLoopInternals) {
   EXPECT_TRUE(matches("void f(){ int i; for (; i < 3 ; ); }",
   forStmt(hasCondition(anything();
Index: include/clang/ASTMatchers/ASTMatchers.h
===
--- include/clang/ASTMatchers/ASTMatchers.h
+++ include/clang/ASTMatchers/ASTMatchers.h
@@ -3299,16 +3299,16 @@
 }
 
 /// \brief Matches the condition expression of an if statement, for loop,
-/// or conditional operator.
+/// switch statement or conditional operator.
 ///
 /// Example matches true (matcher = hasCondition(cxxBoolLiteral(equals(true
 /// \code
 ///   if (true) {}
 /// \endcode
 AST_POLYMORPHIC_MATCHER_P(
 hasCondition,
 AST_POLYMORPHIC_SUPPORTED_TYPES(IfStmt, ForStmt, WhileStmt, DoStmt,
-AbstractConditionalOperator),
+SwitchStmt, AbstractConditionalOperator),
 internal::Matcher, InnerMatcher) {
   const Expr *const Condition = Node.getCond();
   return (Condition != nullptr &&
Index: docs/LibASTMatchersReference.html
===
--- docs/LibASTMatchersReference.html
+++ docs/LibASTMatchersReference.html
@@ -3536,9 +3536,9 @@
 
 
 
-Matcherhttp://clang.llvm.org/doxygen/classclang_1_1AbstractConditionalOperator.html;>AbstractConditionalOperatorhasConditionMatcherhttp://clang.llvm.org/doxygen/classclang_1_1Expr.html;>Expr InnerMatcher
-Matches the condition expression of an if statement, for loop,
-or conditional operator.
+Matcherhttp://clang.llvm.org/doxygen/classclang_1_1AbstractConditionalOperator.html;>AbstractConditionalOperatorhasConditionMatcherhttp://clang.llvm.org/doxygen/classclang_1_1Expr.html;>Expr InnerMatcher
+Matches the condition expression of an if statement, for loop,
+switch statement or conditional operator.
 
 Example matches true (matcher = hasCondition(cxxBoolLiteral(equals(true
   if (true) {}
@@ -4293,7 +4293,7 @@
 
 Matcherhttp://clang.llvm.org/doxygen/classclang_1_1DoStmt.html;>DoStmthasConditionMatcherhttp://clang.llvm.org/doxygen/classclang_1_1Expr.html;>Expr InnerMatcher
 Matches the condition expression of an if statement, for loop,
-or conditional operator.
+switch statement or conditional operator.
 
 Example matches true (matcher = hasCondition(cxxBoolLiteral(equals(true
   if (true) {}
@@ -4476,7 +4476,7 @@
 
 Matcherhttp://clang.llvm.org/doxygen/classclang_1_1ForStmt.html;>ForStmthasConditionMatcherhttp://clang.llvm.org/doxygen/classclang_1_1Expr.html;>Expr InnerMatcher
 Matches the