r286756 - [X86] Remove extra escaped new lines in intrinsic headers left over from an earlier conversion away from a macro. NFC

2016-11-12 Thread Craig Topper via cfe-commits
Author: ctopper
Date: Sun Nov 13 01:26:31 2016
New Revision: 286756

URL: http://llvm.org/viewvc/llvm-project?rev=286756&view=rev
Log:
[X86] Remove extra escaped new lines in intrinsic headers left over from an 
earlier conversion away from a macro. NFC

Modified:
cfe/trunk/lib/Headers/avx512bwintrin.h
cfe/trunk/lib/Headers/avx512fintrin.h
cfe/trunk/lib/Headers/avx512vlbwintrin.h

Modified: cfe/trunk/lib/Headers/avx512bwintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512bwintrin.h?rev=286756&r1=286755&r2=286756&view=diff
==
--- cfe/trunk/lib/Headers/avx512bwintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512bwintrin.h Sun Nov 13 01:26:31 2016
@@ -1726,16 +1726,16 @@ _mm512_sll_epi16(__m512i __A, __m128i __
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_mask_sll_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m128i __B)
 {
-  return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, \
-  (__v32hi)_mm512_sll_epi16(__A, __B), 
\
+  return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
+  (__v32hi)_mm512_sll_epi16(__A, __B),
   (__v32hi)__W);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_maskz_sll_epi16(__mmask32 __U, __m512i __A, __m128i __B)
 {
-  return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, \
-  (__v32hi)_mm512_sll_epi16(__A, __B), 
\
+  return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
+  (__v32hi)_mm512_sll_epi16(__A, __B),
   (__v32hi)_mm512_setzero_hi());
 }
 
@@ -1748,16 +1748,16 @@ _mm512_slli_epi16(__m512i __A, int __B)
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_mask_slli_epi16(__m512i __W, __mmask32 __U, __m512i __A, int __B)
 {
-  return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, \
- (__v32hi)_mm512_slli_epi16(__A, __B), 
\
+  return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
+ (__v32hi)_mm512_slli_epi16(__A, __B),
  (__v32hi)__W);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_maskz_slli_epi16(__mmask32 __U, __m512i __A, int __B)
 {
-  return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, \
- (__v32hi)_mm512_slli_epi16(__A, __B), 
\
+  return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
+ (__v32hi)_mm512_slli_epi16(__A, __B),
  (__v32hi)_mm512_setzero_hi());
 }
 
@@ -1899,16 +1899,16 @@ _mm512_sra_epi16(__m512i __A, __m128i __
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_mask_sra_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m128i __B)
 {
-  return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, \
-  (__v32hi)_mm512_sra_epi16(__A, __B), 
\
+  return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
+  (__v32hi)_mm512_sra_epi16(__A, __B),
   (__v32hi)__W);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_maskz_sra_epi16(__mmask32 __U, __m512i __A, __m128i __B)
 {
-  return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, \
-  (__v32hi)_mm512_sra_epi16(__A, __B), 
\
+  return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
+  (__v32hi)_mm512_sra_epi16(__A, __B),
   (__v32hi)_mm512_setzero_hi());
 }
 
@@ -1921,16 +1921,16 @@ _mm512_srai_epi16(__m512i __A, int __B)
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_mask_srai_epi16(__m512i __W, __mmask32 __U, __m512i __A, int __B)
 {
-  return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, \
- (__v32hi)_mm512_srai_epi16(__A, __B), 
\
+  return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
+ (__v32hi)_mm512_srai_epi16(__A, __B),
  (__v32hi)__W);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_maskz_srai_epi16(__mmask32 __U, __m512i __A, int __B)
 {
-  return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, \
- (__v32hi)_mm512_srai_epi16(__A, __B), 
\
+  return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U,
+ (__v32hi)_mm512_srai_epi16(__A, __B),
  (__v32hi)_mm512_setzero_hi());
 }
 
@@ -1943,16 +1943,16 @@ _mm512_srl_epi16(__m512i __A, __m128i __
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_mask_srl_epi16(__m512i __W, __

r286757 - [AVX-512] Replace masked dword and qword variable shift builtins with unmasked builtins and a select.

2016-11-12 Thread Craig Topper via cfe-commits
Author: ctopper
Date: Sun Nov 13 01:26:34 2016
New Revision: 286757

URL: http://llvm.org/viewvc/llvm-project?rev=286757&view=rev
Log:
[AVX-512] Replace masked dword and qword variable shift builtins with unmasked 
builtins and a select.

This is part of a set of changes to allow InstCombine in the backend to 
optimize variable shifts without having to know about masking.

Modified:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/lib/Headers/avx512fintrin.h
cfe/trunk/lib/Headers/avx512vlintrin.h
cfe/trunk/test/CodeGen/avx512f-builtins.c
cfe/trunk/test/CodeGen/avx512vl-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=286757&r1=286756&r2=286757&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Sun Nov 13 01:26:34 2016
@@ -1373,8 +1373,8 @@ TARGET_BUILTIN(__builtin_ia32_psrlqi512,
 TARGET_BUILTIN(__builtin_ia32_psrav32hi_mask, 
"V32sV32sV32sV32sUi","","avx512bw")
 TARGET_BUILTIN(__builtin_ia32_psrav16hi_mask, 
"V16sV16sV16sV16sUs","","avx512bw,avx512vl")
 TARGET_BUILTIN(__builtin_ia32_psrav8hi_mask, 
"V8sV8sV8sV8sUc","","avx512bw,avx512vl")
-TARGET_BUILTIN(__builtin_ia32_psravq128_mask, 
"V2LLiV2LLiV2LLiV2LLiUc","","avx512vl")
-TARGET_BUILTIN(__builtin_ia32_psravq256_mask, 
"V4LLiV4LLiV4LLiV4LLiUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_psravq128, "V2LLiV2LLiV2LLi","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_psravq256, "V4LLiV4LLiV4LLi","","avx512vl")
 TARGET_BUILTIN(__builtin_ia32_psraw512, "V32sV32sV8s","","avx512bw")
 TARGET_BUILTIN(__builtin_ia32_psrawi512, "V32sV32si","","avx512bw")
 TARGET_BUILTIN(__builtin_ia32_psrlw512, "V32sV32sV8s","","avx512bw")
@@ -1547,16 +1547,16 @@ TARGET_BUILTIN(__builtin_ia32_psraqi128,
 TARGET_BUILTIN(__builtin_ia32_psraqi256, "V4LLiV4LLii","","avx512vl")
 TARGET_BUILTIN(__builtin_ia32_pslld512, "V16iV16iV4i","","avx512f")
 TARGET_BUILTIN(__builtin_ia32_psllq512, "V8LLiV8LLiV2LLi","","avx512f")
-TARGET_BUILTIN(__builtin_ia32_psllv16si_mask, 
"V16iV16iV16iV16iUs","","avx512f")
-TARGET_BUILTIN(__builtin_ia32_psllv8di_mask, 
"V8LLiV8LLiV8LLiV8LLiUc","","avx512f")
+TARGET_BUILTIN(__builtin_ia32_psllv16si, "V16iV16iV16i","","avx512f")
+TARGET_BUILTIN(__builtin_ia32_psllv8di, "V8LLiV8LLiV8LLi","","avx512f")
 TARGET_BUILTIN(__builtin_ia32_psrad512, "V16iV16iV4i","","avx512f")
 TARGET_BUILTIN(__builtin_ia32_psraq512, "V8LLiV8LLiV2LLi","","avx512f")
-TARGET_BUILTIN(__builtin_ia32_psrav16si_mask, 
"V16iV16iV16iV16iUs","","avx512f")
-TARGET_BUILTIN(__builtin_ia32_psrav8di_mask, 
"V8LLiV8LLiV8LLiV8LLiUc","","avx512f")
+TARGET_BUILTIN(__builtin_ia32_psrav16si, "V16iV16iV16i","","avx512f")
+TARGET_BUILTIN(__builtin_ia32_psrav8di, "V8LLiV8LLiV8LLi","","avx512f")
 TARGET_BUILTIN(__builtin_ia32_psrld512, "V16iV16iV4i","","avx512f")
 TARGET_BUILTIN(__builtin_ia32_psrlq512, "V8LLiV8LLiV2LLi","","avx512f")
-TARGET_BUILTIN(__builtin_ia32_psrlv16si_mask, 
"V16iV16iV16iV16iUs","","avx512f")
-TARGET_BUILTIN(__builtin_ia32_psrlv8di_mask, 
"V8LLiV8LLiV8LLiV8LLiUc","","avx512f")
+TARGET_BUILTIN(__builtin_ia32_psrlv16si, "V16iV16iV16i","","avx512f")
+TARGET_BUILTIN(__builtin_ia32_psrlv8di, "V8LLiV8LLiV8LLi","","avx512f")
 TARGET_BUILTIN(__builtin_ia32_pternlogd512_mask, 
"V16iV16iV16iV16iIiUs","","avx512f")
 TARGET_BUILTIN(__builtin_ia32_pternlogd512_maskz, 
"V16iV16iV16iV16iIiUs","","avx512f")
 TARGET_BUILTIN(__builtin_ia32_pternlogq512_mask, 
"V8LLiV8LLiV8LLiV8LLiIiUc","","avx512f")

Modified: cfe/trunk/lib/Headers/avx512fintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512fintrin.h?rev=286757&r1=286756&r2=286757&view=diff
==
--- cfe/trunk/lib/Headers/avx512fintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512fintrin.h Sun Nov 13 01:26:34 2016
@@ -6060,61 +6060,47 @@ _mm512_maskz_sll_epi64(__mmask8 __U, __m
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_sllv_epi32 (__m512i __X, __m512i __Y)
+_mm512_sllv_epi32(__m512i __X, __m512i __Y)
 {
-  return (__m512i) __builtin_ia32_psllv16si_mask ((__v16si) __X,
-  (__v16si) __Y,
-  (__v16si)
-  _mm512_setzero_si512 (),
-  (__mmask16) -1);
+  return (__m512i)__builtin_ia32_psllv16si((__v16si)__X, (__v16si)__Y);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
-_mm512_mask_sllv_epi32 (__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y)
+_mm512_mask_sllv_epi32(__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y)
 {
-  return (__m512i) __builtin_ia32_psllv16si_mask ((__v16si) __X,
-  (__v16si) __Y,
-  (__v16si) __W,
-  (__mmask16) __U);
+  return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
+   (__v16si)_mm512_sllv_epi32(__X

[PATCH] D26546: [PPC] Add vec_insert4b/vec_extract4b to altivec.h

2016-11-12 Thread Kit Barton via cfe-commits
kbarton added inline comments.



Comment at: lib/Headers/altivec.h:12014
+#define vec_insert4b(__a, __b, __c) \
+  ((vector unsigned char)__builtin_vsx_xxinsertw((__a), (__b), (__c) & 0xF))
+#endif

nemanjai wrote:
> As far as I can tell by looking at this patch and the corresponding back end 
> patch, the `__a` argument will have a word inserted into it and it will be 
> returned.
> 
> Is that the semantics that the ABI specifies (I can't seem to make sense of 
> the description).
> 
> ```
> vector unsigned int a = { 0x, 0xBB, 0xCC, 0xDD };
> vector unsigned char b = (vector unsigned char) 0xFF;
> vector unsigned char c = vec_insert4b(a, b, 4);
> // Do we expect vector c to be:
> // { 0xAA, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xCC, 0xCC, 0xCC, 
> 0xDD, 0xDD, 0xDD, 0xDD }
> ```
I think the current version of the ABI document has an error in it. The 
description of the vec_insert4b is identical to the vec_extract4b, so I expect 
it was copy/pasted in error. I think we need to open up an (internal) bug 
against the ABI and wait for clarification to complete this. 


Repository:
  rL LLVM

https://reviews.llvm.org/D26546



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


r286752 - Bitcode: Change module reader functions to return an llvm::Expected.

2016-11-12 Thread Peter Collingbourne via cfe-commits
Author: pcc
Date: Sun Nov 13 01:00:17 2016
New Revision: 286752

URL: http://llvm.org/viewvc/llvm-project?rev=286752&view=rev
Log:
Bitcode: Change module reader functions to return an llvm::Expected.

Differential Revision: https://reviews.llvm.org/D26562

Modified:
cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
cfe/trunk/lib/CodeGen/CodeGenAction.cpp

Modified: cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp?rev=286752&r1=286751&r2=286752&view=diff
==
--- cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp Sun Nov 13 01:00:17 2016
@@ -3012,7 +3012,8 @@ void CGOpenMPRuntime::loadOffloadInfoMet
 return;
 
   llvm::LLVMContext C;
-  auto ME = llvm::parseBitcodeFile(Buf.get()->getMemBufferRef(), C);
+  auto ME = expectedToErrorOrAndEmitErrors(
+  C, llvm::parseBitcodeFile(Buf.get()->getMemBufferRef(), C));
 
   if (ME.getError())
 return;

Modified: cfe/trunk/lib/CodeGen/CodeGenAction.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenAction.cpp?rev=286752&r1=286751&r2=286752&view=diff
==
--- cfe/trunk/lib/CodeGen/CodeGenAction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenAction.cpp Sun Nov 13 01:00:17 2016
@@ -771,11 +771,13 @@ CodeGenAction::CreateASTConsumer(Compile
 return nullptr;
   }
 
-  ErrorOr> ModuleOrErr =
+  Expected> ModuleOrErr =
   getOwningLazyBitcodeModule(std::move(*BCBuf), *VMContext);
-  if (std::error_code EC = ModuleOrErr.getError()) {
-CI.getDiagnostics().Report(diag::err_cannot_open_file) << LinkBCFile
-   << EC.message();
+  if (!ModuleOrErr) {
+handleAllErrors(ModuleOrErr.takeError(), [&](ErrorInfoBase &EIB) {
+  CI.getDiagnostics().Report(diag::err_cannot_open_file)
+  << LinkBCFile << EIB.message();
+});
 LinkModules.clear();
 return nullptr;
   }


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


[PATCH] D23493: Fix PR28366: Teach the const-expression evaluator to be more fault tolerant with non-const enclosing local variables, or otherwise fold them if const.

2016-11-12 Thread Faisal Vali via cfe-commits
faisalv closed this revision.
faisalv added a comment.

Fixed by commit: r286748
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20161107/176865.html
Thanks for the review!


https://reviews.llvm.org/D23493



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


r286748 - Fix PR28366: Handle variables from enclosing local scopes more gracefully during constant expression evaluation.

2016-11-12 Thread Faisal Vali via cfe-commits
Author: faisalv
Date: Sun Nov 13 00:09:16 2016
New Revision: 286748

URL: http://llvm.org/viewvc/llvm-project?rev=286748&view=rev
Log:
Fix PR28366: Handle variables from enclosing local scopes more gracefully 
during constant expression evaluation.

Only look for a variable's value in the constant expression evaluation 
activation frame, if the variable was indeed declared in that frame, otherwise 
it might be a constant expression and be usable within a nested local scope or 
emit an error.


void f(char c) { 
  struct X {
static constexpr char f() { 
  return c; // error gracefully here as opposed to crashing.
}
  };
  int I = X::f();
}


Modified:
cfe/trunk/lib/AST/ExprConstant.cpp
cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp
cfe/trunk/test/SemaCXX/cxx1z-constexpr-lambdas.cpp

Modified: cfe/trunk/lib/AST/ExprConstant.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprConstant.cpp?rev=286748&r1=286747&r2=286748&view=diff
==
--- cfe/trunk/lib/AST/ExprConstant.cpp (original)
+++ cfe/trunk/lib/AST/ExprConstant.cpp Sun Nov 13 00:09:16 2016
@@ -4803,10 +4803,21 @@ bool LValueExprEvaluator::VisitDeclRefEx
   return Error(E);
 }
 
+
 bool LValueExprEvaluator::VisitVarDecl(const Expr *E, const VarDecl *VD) {
   CallStackFrame *Frame = nullptr;
-  if (VD->hasLocalStorage() && Info.CurrentCall->Index > 1)
-Frame = Info.CurrentCall;
+  if (VD->hasLocalStorage() && Info.CurrentCall->Index > 1) {
+// Only if a local variable was declared in the function currently being
+// evaluated, do we expect to be able to find its value in the current
+// frame. (Otherwise it was likely declared in an enclosing context and
+// could either have a valid evaluatable value (for e.g. a constexpr
+// variable) or be ill-formed (and trigger an appropriate evaluation
+// diagnostic)).
+if (Info.CurrentCall->Callee &&
+Info.CurrentCall->Callee->Equals(VD->getDeclContext())) {
+  Frame = Info.CurrentCall;
+}
+  }
 
   if (!VD->getType()->isReferenceType()) {
 if (Frame) {

Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=286748&r1=286747&r2=286748&view=diff
==
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Sun Nov 13 00:09:16 2016
@@ -188,7 +188,7 @@ static void instantiateDependentEnableIf
 
   SmallVector Diags;
   if (A->getCond()->isValueDependent() && !Cond->isValueDependent() &&
-  !Expr::isPotentialConstantExprUnevaluated(Cond, cast(Tmpl),
+  !Expr::isPotentialConstantExprUnevaluated(Cond, cast(New),
 Diags)) {
 S.Diag(A->getLocation(), diag::err_enable_if_never_constant_expr);
 for (int I = 0, N = Diags.size(); I != N; ++I)

Modified: cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp?rev=286748&r1=286747&r2=286748&view=diff
==
--- cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp (original)
+++ cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp Sun Nov 13 00:09:16 
2016
@@ -2066,3 +2066,33 @@ namespace InheritedCtor {
   constexpr Z z(1);
   static_assert(z.w == 1 && z.x == 2 && z.y == 3 && z.z == 4, "");
 }
+
+
+namespace PR28366 {
+namespace ns1 {
+
+void f(char c) { //expected-note2{{declared here}}
+  struct X {
+static constexpr char f() { //expected-error{{never produces a constant 
expression}}
+  return c; //expected-error{{reference to local}} 
expected-note{{non-const variable}}
+}
+  };
+  int I = X::f();
+}
+
+void g() {
+  const int c = 'c';
+  static const int d = 'd';
+  struct X {
+static constexpr int f() {
+  return c + d;
+}
+  };
+  static_assert(X::f() == 'c' + 'd',"");
+}
+
+
+} // end ns1
+
+} //end ns PR28366
+

Modified: cfe/trunk/test/SemaCXX/cxx1z-constexpr-lambdas.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx1z-constexpr-lambdas.cpp?rev=286748&r1=286747&r2=286748&view=diff
==
--- cfe/trunk/test/SemaCXX/cxx1z-constexpr-lambdas.cpp (original)
+++ cfe/trunk/test/SemaCXX/cxx1z-constexpr-lambdas.cpp Sun Nov 13 00:09:16 2016
@@ -46,5 +46,17 @@ namespace ns3 {
 
 } // end ns test_constexpr_call
 
-#endif // ndef CPP14_AND_EARLIER
+namespace test_captureless_lambda {
+void f() {
+  const char c = 'c';
+  auto L = [] { return c; };
+  constexpr char C = L();
+}
+  
+void f(char c) { //expected-note{{declared here}}
+  auto L = [] { return c; }; //expected-error{{cann

[PATCH] D26196: Add support for non-zero null pointer for C and OpenCL

2016-11-12 Thread Yaxun Liu via cfe-commits
yaxunl added a comment.

>> It seems the casting from a pointer to different address space is not 
>> affected by this change. When a null pointer is casted to different address 
>> space, it is casted the same way as an ordinary pointer, e.g. by 
>> addrspacecast.
> 
> You mean, the code-generation for that knows about your special null pointer 
> representation?  That is confusing.

Do you mean if a null pointer in one address space is casted to another address 
space, we should use the specific null pointer representation in the new 
address space, instead of a simple addrspacecast?


https://reviews.llvm.org/D26196



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


[PATCH] D26196: Add support for non-zero null pointer for C and OpenCL

2016-11-12 Thread Yaxun Liu via cfe-commits
yaxunl added a comment.

>> It seems the casting from a pointer to different address space is not 
>> affected by this change. When a null pointer is casted to different address 
>> space, it is casted the same way as an ordinary pointer, e.g. by 
>> addrspacecast.
> 
> You mean, the code-generation for that knows about your special null pointer 
> representation?  That is confusing.

The null pointer is represented in a new way, but the new representation has 
the same type as before. For example, a null pointer in addr space 0 used to be 
`i8 *null`, now it becomes `addrspacecast i8 addrspace(4)* null to i8*`. It is 
still of type i8*, so nothing is changed about casting a pointer to a different 
address space.


https://reviews.llvm.org/D26196



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


[PATCH] D26476: [AMDGPU] Add support for f16 builtin functions for VI+

2016-11-12 Thread Konstantin Zhuravlyov via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL286741: [AMDGPU] Add f16 builtin functions (VI+) (authored 
by kzhuravl).

Changed prior to commit:
  https://reviews.llvm.org/D26476?vs=77654&id=77732#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26476

Files:
  cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def
  cfe/trunk/lib/CodeGen/CGBuiltin.cpp
  cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-error.cl
  cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl
  cfe/trunk/test/SemaOpenCL/builtins-amdgcn-error-f16.cl
  cfe/trunk/test/SemaOpenCL/builtins-amdgcn-error.cl

Index: cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def
===
--- cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def
+++ cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def
@@ -84,6 +84,16 @@
 // VI+ only builtins.
 //===--===//
 
+TARGET_BUILTIN(__builtin_amdgcn_div_fixuph, "", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_rcph, "hh", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_rsqh, "hh", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_sinh, "hh", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_cosh, "hh", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_ldexph, "hhi", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_frexp_manth, "hh", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_frexp_exph, "ih", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_fracth, "hh", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_classh, "bhi", "nc", "16-bit-insts")
 TARGET_BUILTIN(__builtin_amdgcn_s_memrealtime, "LUi", "n", "s-memrealtime")
 
 //===--===//
Index: cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl
===
--- cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl
+++ cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl
@@ -1,8 +1,79 @@
 // REQUIRES: amdgpu-registered-target
 // RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu tonga -S -emit-llvm -o - %s | FileCheck %s
 
+#pragma OPENCL EXTENSION cl_khr_fp16 : enable
+
 typedef unsigned long ulong;
 
+// CHECK-LABEL: @test_div_fixup_f16
+// CHECK: call half @llvm.amdgcn.div.fixup.f16
+void test_div_fixup_f16(global half* out, half a, half b, half c)
+{
+  *out = __builtin_amdgcn_div_fixuph(a, b, c);
+}
+
+// CHECK-LABEL: @test_rcp_f16
+// CHECK: call half @llvm.amdgcn.rcp.f16
+void test_rcp_f16(global half* out, half a)
+{
+  *out = __builtin_amdgcn_rcph(a);
+}
+
+// CHECK-LABEL: @test_rsq_f16
+// CHECK: call half @llvm.amdgcn.rsq.f16
+void test_rsq_f16(global half* out, half a)
+{
+  *out = __builtin_amdgcn_rsqh(a);
+}
+
+// CHECK-LABEL: @test_sin_f16
+// CHECK: call half @llvm.amdgcn.sin.f16
+void test_sin_f16(global half* out, half a)
+{
+  *out = __builtin_amdgcn_sinh(a);
+}
+
+// CHECK-LABEL: @test_cos_f16
+// CHECK: call half @llvm.amdgcn.cos.f16
+void test_cos_f16(global half* out, half a)
+{
+  *out = __builtin_amdgcn_cosh(a);
+}
+
+// CHECK-LABEL: @test_ldexp_f16
+// CHECK: call half @llvm.amdgcn.ldexp.f16
+void test_ldexp_f16(global half* out, half a, int b)
+{
+  *out = __builtin_amdgcn_ldexph(a, b);
+}
+
+// CHECK-LABEL: @test_frexp_mant_f16
+// CHECK: call half @llvm.amdgcn.frexp.mant.f16
+void test_frexp_mant_f16(global half* out, half a)
+{
+  *out = __builtin_amdgcn_frexp_manth(a);
+}
+
+// CHECK-LABEL: @test_frexp_exp_f16
+// CHECK: call i32 @llvm.amdgcn.frexp.exp.f16
+void test_frexp_exp_f16(global short* out, half a)
+{
+  *out = __builtin_amdgcn_frexp_exph(a);
+}
+
+// CHECK-LABEL: @test_fract_f16
+// CHECK: call half @llvm.amdgcn.fract.f16
+void test_fract_f16(global half* out, half a)
+{
+  *out = __builtin_amdgcn_fracth(a);
+}
+
+// CHECK-LABEL: @test_class_f16
+// CHECK: call i1 @llvm.amdgcn.class.f16
+void test_class_f16(global half* out, half a, int b)
+{
+  *out = __builtin_amdgcn_classh(a, b);
+}
 
 // CHECK-LABEL: @test_s_memrealtime
 // CHECK: call i64 @llvm.amdgcn.s.memrealtime()
Index: cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-error.cl
===
--- cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-error.cl
+++ cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-error.cl
@@ -1,64 +0,0 @@
-// REQUIRES: amdgpu-registered-target
-// RUN: %clang_cc1 -triple amdgcn-unknown-amdhsa -target-cpu tahiti -verify -S -o - %s
-
-// FIXME: We only get one error if the functions are the other order in the
-// file.
-
-#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-typedef unsigned long ulong;
-typedef unsigned int uint;
-
-ulong test_s_memrealtime()
-{
-  return __builtin_amdgcn_s_memrealtime(); // expected-error {{'__builtin_amdgcn_s_memrealtime' needs target feature s-memrealtime}}
-}
-
-void test_s_sleep(int x)
-{
-  __builtin_amdgcn_s_sleep(x); // expected-erro

r286741 - [AMDGPU] Add f16 builtin functions (VI+)

2016-11-12 Thread Konstantin Zhuravlyov via cfe-commits
Author: kzhuravl
Date: Sat Nov 12 20:37:05 2016
New Revision: 286741

URL: http://llvm.org/viewvc/llvm-project?rev=286741&view=rev
Log:
[AMDGPU] Add f16 builtin functions (VI+)

Differential Revision: https://reviews.llvm.org/D26476

Added:
cfe/trunk/test/SemaOpenCL/builtins-amdgcn-error-f16.cl
cfe/trunk/test/SemaOpenCL/builtins-amdgcn-error.cl
Removed:
cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-error.cl
Modified:
cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl

Modified: cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def?rev=286741&r1=286740&r2=286741&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def Sat Nov 12 20:37:05 2016
@@ -84,6 +84,16 @@ BUILTIN(__builtin_amdgcn_ds_swizzle, "ii
 // VI+ only builtins.
 
//===--===//
 
+TARGET_BUILTIN(__builtin_amdgcn_div_fixuph, "", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_rcph, "hh", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_rsqh, "hh", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_sinh, "hh", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_cosh, "hh", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_ldexph, "hhi", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_frexp_manth, "hh", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_frexp_exph, "ih", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_fracth, "hh", "nc", "16-bit-insts")
+TARGET_BUILTIN(__builtin_amdgcn_classh, "bhi", "nc", "16-bit-insts")
 TARGET_BUILTIN(__builtin_amdgcn_s_memrealtime, "LUi", "n", "s-memrealtime")
 
 
//===--===//

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=286741&r1=286740&r2=286741&view=diff
==
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Sat Nov 12 20:37:05 2016
@@ -8190,38 +8190,45 @@ Value *CodeGenFunction::EmitAMDGPUBuilti
 return emitBinaryBuiltin(*this, E, Intrinsic::amdgcn_ds_swizzle);
   case AMDGPU::BI__builtin_amdgcn_div_fixup:
   case AMDGPU::BI__builtin_amdgcn_div_fixupf:
+  case AMDGPU::BI__builtin_amdgcn_div_fixuph:
 return emitTernaryBuiltin(*this, E, Intrinsic::amdgcn_div_fixup);
   case AMDGPU::BI__builtin_amdgcn_trig_preop:
   case AMDGPU::BI__builtin_amdgcn_trig_preopf:
 return emitFPIntBuiltin(*this, E, Intrinsic::amdgcn_trig_preop);
   case AMDGPU::BI__builtin_amdgcn_rcp:
   case AMDGPU::BI__builtin_amdgcn_rcpf:
+  case AMDGPU::BI__builtin_amdgcn_rcph:
 return emitUnaryBuiltin(*this, E, Intrinsic::amdgcn_rcp);
   case AMDGPU::BI__builtin_amdgcn_rsq:
   case AMDGPU::BI__builtin_amdgcn_rsqf:
+  case AMDGPU::BI__builtin_amdgcn_rsqh:
 return emitUnaryBuiltin(*this, E, Intrinsic::amdgcn_rsq);
   case AMDGPU::BI__builtin_amdgcn_rsq_clamp:
   case AMDGPU::BI__builtin_amdgcn_rsq_clampf:
 return emitUnaryBuiltin(*this, E, Intrinsic::amdgcn_rsq_clamp);
   case AMDGPU::BI__builtin_amdgcn_sinf:
+  case AMDGPU::BI__builtin_amdgcn_sinh:
 return emitUnaryBuiltin(*this, E, Intrinsic::amdgcn_sin);
   case AMDGPU::BI__builtin_amdgcn_cosf:
+  case AMDGPU::BI__builtin_amdgcn_cosh:
 return emitUnaryBuiltin(*this, E, Intrinsic::amdgcn_cos);
   case AMDGPU::BI__builtin_amdgcn_log_clampf:
 return emitUnaryBuiltin(*this, E, Intrinsic::amdgcn_log_clamp);
   case AMDGPU::BI__builtin_amdgcn_ldexp:
   case AMDGPU::BI__builtin_amdgcn_ldexpf:
+  case AMDGPU::BI__builtin_amdgcn_ldexph:
 return emitFPIntBuiltin(*this, E, Intrinsic::amdgcn_ldexp);
   case AMDGPU::BI__builtin_amdgcn_frexp_mant:
-  case AMDGPU::BI__builtin_amdgcn_frexp_mantf: {
+  case AMDGPU::BI__builtin_amdgcn_frexp_mantf:
+  case AMDGPU::BI__builtin_amdgcn_frexp_manth:
 return emitUnaryBuiltin(*this, E, Intrinsic::amdgcn_frexp_mant);
-  }
   case AMDGPU::BI__builtin_amdgcn_frexp_exp:
-  case AMDGPU::BI__builtin_amdgcn_frexp_expf: {
+  case AMDGPU::BI__builtin_amdgcn_frexp_expf:
+  case AMDGPU::BI__builtin_amdgcn_frexp_exph:
 return emitUnaryBuiltin(*this, E, Intrinsic::amdgcn_frexp_exp);
-  }
   case AMDGPU::BI__builtin_amdgcn_fract:
   case AMDGPU::BI__builtin_amdgcn_fractf:
+  case AMDGPU::BI__builtin_amdgcn_fracth:
 return emitUnaryBuiltin(*this, E, Intrinsic::amdgcn_fract);
   case AMDGPU::BI__builtin_amdgcn_lerp:
 return emitTernaryBuiltin(*this, E, Intrinsic::amdgcn_lerp);
@@ -8235,6 +8242,7 @@ Value *CodeGenFunction::EmitAMDGPUBuilti
 return emitTernaryBuiltin(*this, E, Intrinsic::amdgcn_fcmp);
   case AMDGP

r286738 - [AVX-512] Add returns to shift intrinsics that converted from macros in r286714.

2016-11-12 Thread Craig Topper via cfe-commits
Author: ctopper
Date: Sat Nov 12 18:35:01 2016
New Revision: 286738

URL: http://llvm.org/viewvc/llvm-project?rev=286738&view=rev
Log:
[AVX-512] Add returns to shift intrinsics that converted from macros in r286714.

Modified:
cfe/trunk/lib/Headers/avx512bwintrin.h

Modified: cfe/trunk/lib/Headers/avx512bwintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512bwintrin.h?rev=286738&r1=286737&r2=286738&view=diff
==
--- cfe/trunk/lib/Headers/avx512bwintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512bwintrin.h Sat Nov 12 18:35:01 2016
@@ -1742,7 +1742,7 @@ _mm512_maskz_sll_epi16(__mmask32 __U, __
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_slli_epi16(__m512i __A, int __B)
 {
-  (__m512i)__builtin_ia32_psllwi512((__v32hi)__A, __B);
+  return (__m512i)__builtin_ia32_psllwi512((__v32hi)__A, __B);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
@@ -1915,7 +1915,7 @@ _mm512_maskz_sra_epi16(__mmask32 __U, __
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_srai_epi16(__m512i __A, int __B)
 {
-  (__m512i)__builtin_ia32_psrawi512((__v32hi)__A, __B);
+  return (__m512i)__builtin_ia32_psrawi512((__v32hi)__A, __B);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
@@ -1959,7 +1959,7 @@ _mm512_maskz_srl_epi16(__mmask32 __U, __
 static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_srli_epi16(__m512i __A, int __B)
 {
-  (__m512i)__builtin_ia32_psrlwi512((__v32hi)__A, __B);
+  return (__m512i)__builtin_ia32_psrlwi512((__v32hi)__A, __B);
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS


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


r286736 - Revert r286735 due to test failure

2016-11-12 Thread Brad Smith via cfe-commits
Author: brad
Date: Sat Nov 12 18:16:21 2016
New Revision: 286736

URL: http://llvm.org/viewvc/llvm-project?rev=286736&view=rev
Log:
Revert r286735 due to test failure

Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/openbsd.c

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=286736&r1=286735&r2=286736&view=diff
==
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sat Nov 12 18:16:21 2016
@@ -8822,10 +8822,6 @@ void openbsd::Linker::ConstructJob(Compi
   if (Args.hasArg(options::OPT_pg))
 CmdArgs.push_back(
 Args.MakeArgString(getToolChain().GetFilePath("gcrt0.o")));
-  else if (Args.hasArg(options::OPT_static) &&
-   !Args.hasArg(options::OPT_nopie))
-CmdArgs.push_back(
-Args.MakeArgString(getToolChain().GetFilePath("rcrt0.o")));
   else
 CmdArgs.push_back(
 Args.MakeArgString(getToolChain().GetFilePath("crt0.o")));

Modified: cfe/trunk/test/Driver/openbsd.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/openbsd.c?rev=286736&r1=286735&r2=286736&view=diff
==
--- cfe/trunk/test/Driver/openbsd.c (original)
+++ cfe/trunk/test/Driver/openbsd.c Sat Nov 12 18:16:21 2016
@@ -67,26 +67,3 @@
 // CHECK-MIPS64-PIC: as{{.*}}" "-mabi" "64" "-EB" "-KPIC"
 // CHECK-MIPS64EL: as{{.*}}" "-mabi" "64" "-EL"
 // CHECK-MIPS64EL-PIC: as{{.*}}" "-mabi" "64" "-EL" "-KPIC"
-
-// Check linking against correct startup code when (not) using PIE
-// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -### 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK-PIE %s
-// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -fno-pie %s 
-### 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK-PIE %s
-// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static %s -### 
2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK-STATIC-PIE %s
-// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static -fno-pie 
%s -### 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK-STATIC-PIE %s
-// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -nopie %s -### 
2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK-NOPIE %s
-// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -fno-pie -nopie 
%s -### 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK-NOPIE %s
-// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static -nopie 
%s -### 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK-NOPIE %s
-// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -fno-pie -static 
-nopie %s -### 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK-NOPIE %s
-// CHECK-PIE: "{{.*}}crt0.o"
-// CHECK-PIE-NOT: "-nopie"
-// CHECK-STATIC-PIE: "{{.*}}rcrt0.o"
-// CHECK-STATIC-PIE-NOT: "-nopie"
-// CHECK-NOPIE: "-nopie" {{.*}}"${{.*}}crt0.o"


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


RE: r286714 - [AVX-512] Convert the rest of the masked shift by immediate and by single element builtins over to the newly added unmasked builtins and a select.

2016-11-12 Thread Yung, Douglas via cfe-commits
Hi Craig,

One of our internal tests noticed a potential issue with your change that I 
wanted to see if you were aware of in the file avx512bwintrin.h.

Specifically, you converted _mm512_slli_epi16, _mm512_srai_epi16, 
_mm512_srli_epi16 from macros into actual functions, but the functions don't 
return anything despite having a non-void return type. I suspect this is a typo 
and that you meant to return the value computed?

For example, here is the implementation of _mm512_slli_epi16 as of r286713:

#define _mm512_slli_epi16(A, B) __extension__ ({ \
  (__m512i)__builtin_ia32_psllwi512_mask((__v32hi)(__m512i)(A), (int)(B), \
 (__v32hi)_mm512_setzero_hi(), \
 (__mmask32)-1); })

New implementation as of r286714:

static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_slli_epi16(__m512i __A, int __B)
{
  (__m512i)__builtin_ia32_psllwi512((__v32hi)__A, __B);
}

The implementations of _mm512_srai_epi16 and _mm512_srli_epi16 are similar. Was 
this intentional?

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf
> Of Craig Topper via cfe-commits
> Sent: Friday, November 11, 2016 23:17
> To: cfe-commits@lists.llvm.org
> Subject: r286714 - [AVX-512] Convert the rest of the masked shift by
> immediate and by single element builtins over to the newly added
> unmasked builtins and a select.
> 
> Author: ctopper
> Date: Sat Nov 12 01:16:59 2016
> New Revision: 286714
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=286714&view=rev
> Log:
> [AVX-512] Convert the rest of the masked shift by immediate and by
> single element builtins over to the newly added unmasked builtins and a
> select.
> 
> This should also fix PR30691 since the new builtins are handled like
> the legacy builtins in the backend.
> 
> Modified:
> cfe/trunk/include/clang/Basic/BuiltinsX86.def
> cfe/trunk/lib/Headers/avx512bwintrin.h
> cfe/trunk/lib/Headers/avx512fintrin.h
> cfe/trunk/lib/Headers/avx512vlintrin.h
> cfe/trunk/lib/Sema/SemaChecking.cpp
> cfe/trunk/test/CodeGen/avx512bw-builtins.c
> cfe/trunk/test/CodeGen/avx512f-builtins.c
> cfe/trunk/test/CodeGen/avx512vl-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=286714&r1=286
> 713&r2=286714&view=diff
> ===
> ===
> --- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
> +++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Sat Nov 12 01:16:59
> 2016
> @@ -1359,26 +1359,26 @@ TARGET_BUILTIN(__builtin_ia32_prorvd256_
>  TARGET_BUILTIN(__builtin_ia32_prorvq128_mask,
> "V2LLiV2LLiV2LLiV2LLiUc","","avx512vl")
>  TARGET_BUILTIN(__builtin_ia32_prorvq256_mask,
> "V4LLiV4LLiV4LLiV4LLiUc","","avx512vl")
>  TARGET_BUILTIN(__builtin_ia32_psllv32hi_mask,
> "V32sV32sV32sV32sUi","","avx512bw")
> -TARGET_BUILTIN(__builtin_ia32_psllw512_mask,
> "V32sV32sV8sV32sUi","","avx512bw")
> -TARGET_BUILTIN(__builtin_ia32_psllwi512_mask,
> "V32sV32sIiV32sUi","","avx512bw")
> +TARGET_BUILTIN(__builtin_ia32_psllw512, "V32sV32sV8s","","avx512bw")
> +TARGET_BUILTIN(__builtin_ia32_psllwi512, "V32sV32si","","avx512bw")
>  TARGET_BUILTIN(__builtin_ia32_psllv16hi_mask,
> "V16sV16sV16sV16sUs","","avx512bw,avx512vl")
>  TARGET_BUILTIN(__builtin_ia32_psllv8hi_mask,
> "V8sV8sV8sV8sUc","","avx512bw,avx512vl")
> -TARGET_BUILTIN(__builtin_ia32_pslldi512_mask,
> "V16iV16iIiV16iUs","","avx512f")
> -TARGET_BUILTIN(__builtin_ia32_psllqi512_mask,
> "V8LLiV8LLiIiV8LLiUc","","avx512f")
> +TARGET_BUILTIN(__builtin_ia32_pslldi512, "V16iV16ii","","avx512f")
> +TARGET_BUILTIN(__builtin_ia32_psllqi512, "V8LLiV8LLii","","avx512f")
>  TARGET_BUILTIN(__builtin_ia32_psrlv32hi_mask,
> "V32sV32sV32sV32sUi","","avx512bw")
>  TARGET_BUILTIN(__builtin_ia32_psrlv16hi_mask,
> "V16sV16sV16sV16sUs","","avx512bw,avx512vl")
>  TARGET_BUILTIN(__builtin_ia32_psrlv8hi_mask,
> "V8sV8sV8sV8sUc","","avx512bw,avx512vl")
> -TARGET_BUILTIN(__builtin_ia32_psrldi512_mask,
> "V16iV16iIiV16iUs","","avx512f")
> -TARGET_BUILTIN(__builtin_ia32_psrlqi512_mask,
> "V8LLiV8LLiIiV8LLiUc","","avx512f")
> +TARGET_BUILTIN(__builtin_ia32_psrldi512, "V16iV16ii","","avx512f")
> +TARGET_BUILTIN(__builtin_ia32_psrlqi512, "V8LLiV8LLii","","avx512f")
>  TARGET_BUILTIN(__builtin_ia32_psrav32hi_mask,
> "V32sV32sV32sV32sUi","","avx512bw")
>  TARGET_BUILTIN(__builtin_ia32_psrav16hi_mask,
> "V16sV16sV16sV16sUs","","avx512bw,avx512vl")
>  TARGET_BUILTIN(__builtin_ia32_psrav8hi_mask,
> "V8sV8sV8sV8sUc","","avx512bw,avx512vl")
>  TARGET_BUILTIN(__builtin_ia32_psravq128_mask,
> "V2LLiV2LLiV2LLiV2LLiUc","","avx512vl")
>  TARGET_BUILTIN(__builtin_ia32_psravq256_mask,
> "V4LLiV4LLiV4LLiV4LLiUc","","avx512vl")
> -TARGET_BUILTIN(__builtin_ia32_psraw512_mask,
> "V32sV32sV8sV32sUi","","avx512bw")
> -TARGET_BUILTIN(__builtin_ia32_psrawi512_mask,
>

r286735 - Link static PIE programs against rcrt0.o on OpenBSD

2016-11-12 Thread Brad Smith via cfe-commits
Author: brad
Date: Sat Nov 12 17:52:03 2016
New Revision: 286735

URL: http://llvm.org/viewvc/llvm-project?rev=286735&view=rev
Log:
Link static PIE programs against rcrt0.o on OpenBSD

Patch by Stefan Kempf.

Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/openbsd.c

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=286735&r1=286734&r2=286735&view=diff
==
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sat Nov 12 17:52:03 2016
@@ -8822,6 +8822,10 @@ void openbsd::Linker::ConstructJob(Compi
   if (Args.hasArg(options::OPT_pg))
 CmdArgs.push_back(
 Args.MakeArgString(getToolChain().GetFilePath("gcrt0.o")));
+  else if (Args.hasArg(options::OPT_static) &&
+   !Args.hasArg(options::OPT_nopie))
+CmdArgs.push_back(
+Args.MakeArgString(getToolChain().GetFilePath("rcrt0.o")));
   else
 CmdArgs.push_back(
 Args.MakeArgString(getToolChain().GetFilePath("crt0.o")));

Modified: cfe/trunk/test/Driver/openbsd.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/openbsd.c?rev=286735&r1=286734&r2=286735&view=diff
==
--- cfe/trunk/test/Driver/openbsd.c (original)
+++ cfe/trunk/test/Driver/openbsd.c Sat Nov 12 17:52:03 2016
@@ -67,3 +67,26 @@
 // CHECK-MIPS64-PIC: as{{.*}}" "-mabi" "64" "-EB" "-KPIC"
 // CHECK-MIPS64EL: as{{.*}}" "-mabi" "64" "-EL"
 // CHECK-MIPS64EL-PIC: as{{.*}}" "-mabi" "64" "-EL" "-KPIC"
+
+// Check linking against correct startup code when (not) using PIE
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -### 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK-PIE %s
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -fno-pie %s 
-### 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK-PIE %s
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static %s -### 
2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK-STATIC-PIE %s
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static -fno-pie 
%s -### 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK-STATIC-PIE %s
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -nopie %s -### 
2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK-NOPIE %s
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -fno-pie -nopie 
%s -### 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK-NOPIE %s
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static -nopie 
%s -### 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK-NOPIE %s
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -fno-pie -static 
-nopie %s -### 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK-NOPIE %s
+// CHECK-PIE: "{{.*}}crt0.o"
+// CHECK-PIE-NOT: "-nopie"
+// CHECK-STATIC-PIE: "{{.*}}rcrt0.o"
+// CHECK-STATIC-PIE-NOT: "-nopie"
+// CHECK-NOPIE: "-nopie" {{.*}}"${{.*}}crt0.o"


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


[PATCH] D26019: [AVX-512] Use scalar vfmsub/vfnmsub mask3 intrinsics instead of inverting the mask argument of a vfmadd intrinsic.

2016-11-12 Thread Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL286733: [AVX-512] Use scalar vfmsub/vfnmsub mask3 intrinsics 
instead of inverting theā€¦ (authored by ctopper).

Changed prior to commit:
  https://reviews.llvm.org/D26019?vs=75978&id=77729#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26019

Files:
  cfe/trunk/include/clang/Basic/BuiltinsX86.def
  cfe/trunk/lib/Headers/avx512fintrin.h
  cfe/trunk/test/CodeGen/avx512f-builtins.c

Index: cfe/trunk/include/clang/Basic/BuiltinsX86.def
===
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def
@@ -1743,6 +1743,10 @@
 TARGET_BUILTIN(__builtin_ia32_vfmaddsd3_mask,  "V2dV2dV2dV2dUcIi", "", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_vfmaddsd3_maskz, "V2dV2dV2dV2dUcIi", "", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_vfmaddsd3_mask3, "V2dV2dV2dV2dUcIi", "", "avx512f")
+TARGET_BUILTIN(__builtin_ia32_vfmsubsd3_mask3, "V2dV2dV2dV2dUcIi", "", "avx512f")
+TARGET_BUILTIN(__builtin_ia32_vfmsubss3_mask3, "V4fV4fV4fV4fUcIi", "", "avx512f")
+TARGET_BUILTIN(__builtin_ia32_vfnmsubsd3_mask3, "V2dV2dV2dV2dUcIi", "", "avx512f")
+TARGET_BUILTIN(__builtin_ia32_vfnmsubss3_mask3, "V4fV4fV4fV4fUcIi", "", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_permvarhi512_mask, "V32sV32sV32sV32sUi","","avx512bw")
 TARGET_BUILTIN(__builtin_ia32_permvardf512_mask, "V8dV8dV8LLiV8dUc","","avx512f")
 TARGET_BUILTIN(__builtin_ia32_permvardi512_mask, "V8LLiV8LLiV8LLiV8LLiUc","","avx512f")
Index: cfe/trunk/test/CodeGen/avx512f-builtins.c
===
--- cfe/trunk/test/CodeGen/avx512f-builtins.c
+++ cfe/trunk/test/CodeGen/avx512f-builtins.c
@@ -5813,13 +5813,13 @@
 
 __m128 test_mm_mask3_fmsub_ss(__m128 __W, __m128 __X, __m128 __Y, __mmask8 __U){
   // CHECK-LABEL: @test_mm_mask3_fmsub_ss
-  // CHECK: @llvm.x86.avx512.mask3.vfmadd.ss
+  // CHECK: @llvm.x86.avx512.mask3.vfmsub.ss
   return _mm_mask3_fmsub_ss(__W, __X, __Y, __U);
 }
 
 __m128 test_mm_mask3_fmsub_round_ss(__m128 __W, __m128 __X, __m128 __Y, __mmask8 __U){
   // CHECK-LABEL: @test_mm_mask3_fmsub_round_ss
-  // CHECK: @llvm.x86.avx512.mask3.vfmadd.ss
+  // CHECK: @llvm.x86.avx512.mask3.vfmsub.ss
   return _mm_mask3_fmsub_round_ss(__W, __X, __Y, __U, _MM_FROUND_CUR_DIRECTION);
 }
 
@@ -5885,13 +5885,13 @@
 
 __m128 test_mm_mask3_fnmsub_ss(__m128 __W, __m128 __X, __m128 __Y, __mmask8 __U){
   // CHECK-LABEL: @test_mm_mask3_fnmsub_ss
-  // CHECK: @llvm.x86.avx512.mask3.vfmadd.ss
+  // CHECK: @llvm.x86.avx512.mask3.vfnmsub.ss
   return _mm_mask3_fnmsub_ss(__W, __X, __Y, __U);
 }
 
 __m128 test_mm_mask3_fnmsub_round_ss(__m128 __W, __m128 __X, __m128 __Y, __mmask8 __U){
   // CHECK-LABEL: @test_mm_mask3_fnmsub_round_ss
-  // CHECK: @llvm.x86.avx512.mask3.vfmadd.ss
+  // CHECK: @llvm.x86.avx512.mask3.vfnmsub.ss
   return _mm_mask3_fnmsub_round_ss(__W, __X, __Y, __U, _MM_FROUND_CUR_DIRECTION);
 }
 
@@ -5957,13 +5957,13 @@
 
 __m128d test_mm_mask3_fmsub_sd(__m128d __W, __m128d __X, __m128d __Y, __mmask8 __U){
   // CHECK-LABEL: @test_mm_mask3_fmsub_sd
-  // CHECK: @llvm.x86.avx512.mask3.vfmadd.sd
+  // CHECK: @llvm.x86.avx512.mask3.vfmsub.sd
   return _mm_mask3_fmsub_sd(__W, __X, __Y, __U);
 }
 
 __m128d test_mm_mask3_fmsub_round_sd(__m128d __W, __m128d __X, __m128d __Y, __mmask8 __U){
   // CHECK-LABEL: @test_mm_mask3_fmsub_round_sd
-  // CHECK: @llvm.x86.avx512.mask3.vfmadd.sd
+  // CHECK: @llvm.x86.avx512.mask3.vfmsub.sd
   return _mm_mask3_fmsub_round_sd(__W, __X, __Y, __U, _MM_FROUND_CUR_DIRECTION);
 }
 
@@ -6029,13 +6029,13 @@
 
 __m128d test_mm_mask3_fnmsub_sd(__m128d __W, __m128d __X, __m128d __Y, __mmask8 __U){
   // CHECK-LABEL: @test_mm_mask3_fnmsub_sd
-  // CHECK: @llvm.x86.avx512.mask3.vfmadd.sd
+  // CHECK: @llvm.x86.avx512.mask3.vfnmsub.sd
   return _mm_mask3_fnmsub_sd(__W, __X, __Y, __U);
 }
 
 __m128d test_mm_mask3_fnmsub_round_sd(__m128d __W, __m128d __X, __m128d __Y, __mmask8 __U){
   // CHECK-LABEL: @test_mm_mask3_fnmsub_round_sd
-  // CHECK: @llvm.x86.avx512.mask3.vfmadd.sd
+  // CHECK: @llvm.x86.avx512.mask3.vfnmsub.sd
   return _mm_mask3_fnmsub_round_sd(__W, __X, __Y, __U, _MM_FROUND_CUR_DIRECTION);
 }
 
Index: cfe/trunk/lib/Headers/avx512fintrin.h
===
--- cfe/trunk/lib/Headers/avx512fintrin.h
+++ cfe/trunk/lib/Headers/avx512fintrin.h
@@ -8470,17 +8470,17 @@
 static __inline__ __m128 __DEFAULT_FN_ATTRS
 _mm_mask3_fmsub_ss (__m128 __W, __m128 __X, __m128 __Y, __mmask8 __U)
 {
- return (__m128) __builtin_ia32_vfmaddss3_mask3 ((__v4sf) __W,
+ return (__m128) __builtin_ia32_vfmsubss3_mask3 ((__v4sf) __W,
   (__v4sf) __X,
-  -(__v4sf) __Y,
+  (__v4sf) __Y,
   (__mmask8) __U,
   _MM_FROUND_CUR_DIRECTION);
 }
 
 #define _mm_mask3_fmsub_round_ss(W, X, Y, U, R) __extension__ ({\
-  (__m128)__builtin_ia32_vfmaddss3_mask3((__v4sf)(__

r286733 - [AVX-512] Use scalar vfmsub/vfnmsub mask3 intrinsics instead of inverting the mask argument of a vfmadd intrinsic.

2016-11-12 Thread Craig Topper via cfe-commits
Author: ctopper
Date: Sat Nov 12 17:24:34 2016
New Revision: 286733

URL: http://llvm.org/viewvc/llvm-project?rev=286733&view=rev
Log:
[AVX-512] Use scalar vfmsub/vfnmsub mask3 intrinsics instead of inverting the 
mask argument of a vfmadd intrinsic.

Summary: Inverting the mask argument does not reflect the intended semantics of 
the intrinsic.

Reviewers: igorb, delena

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D26019

Modified:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/lib/Headers/avx512fintrin.h
cfe/trunk/test/CodeGen/avx512f-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=286733&r1=286732&r2=286733&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Sat Nov 12 17:24:34 2016
@@ -1743,6 +1743,10 @@ TARGET_BUILTIN(__builtin_ia32_vfmaddss3_
 TARGET_BUILTIN(__builtin_ia32_vfmaddsd3_mask,  "V2dV2dV2dV2dUcIi", "", 
"avx512f")
 TARGET_BUILTIN(__builtin_ia32_vfmaddsd3_maskz, "V2dV2dV2dV2dUcIi", "", 
"avx512f")
 TARGET_BUILTIN(__builtin_ia32_vfmaddsd3_mask3, "V2dV2dV2dV2dUcIi", "", 
"avx512f")
+TARGET_BUILTIN(__builtin_ia32_vfmsubsd3_mask3, "V2dV2dV2dV2dUcIi", "", 
"avx512f")
+TARGET_BUILTIN(__builtin_ia32_vfmsubss3_mask3, "V4fV4fV4fV4fUcIi", "", 
"avx512f")
+TARGET_BUILTIN(__builtin_ia32_vfnmsubsd3_mask3, "V2dV2dV2dV2dUcIi", "", 
"avx512f")
+TARGET_BUILTIN(__builtin_ia32_vfnmsubss3_mask3, "V4fV4fV4fV4fUcIi", "", 
"avx512f")
 TARGET_BUILTIN(__builtin_ia32_permvarhi512_mask, 
"V32sV32sV32sV32sUi","","avx512bw")
 TARGET_BUILTIN(__builtin_ia32_permvardf512_mask, 
"V8dV8dV8LLiV8dUc","","avx512f")
 TARGET_BUILTIN(__builtin_ia32_permvardi512_mask, 
"V8LLiV8LLiV8LLiV8LLiUc","","avx512f")

Modified: cfe/trunk/lib/Headers/avx512fintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512fintrin.h?rev=286733&r1=286732&r2=286733&view=diff
==
--- cfe/trunk/lib/Headers/avx512fintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512fintrin.h Sat Nov 12 17:24:34 2016
@@ -8470,17 +8470,17 @@ _mm_maskz_fmsub_ss (__mmask8 __U, __m128
 static __inline__ __m128 __DEFAULT_FN_ATTRS
 _mm_mask3_fmsub_ss (__m128 __W, __m128 __X, __m128 __Y, __mmask8 __U)
 {
- return (__m128) __builtin_ia32_vfmaddss3_mask3 ((__v4sf) __W,
+ return (__m128) __builtin_ia32_vfmsubss3_mask3 ((__v4sf) __W,
   (__v4sf) __X,
-  -(__v4sf) __Y,
+  (__v4sf) __Y,
   (__mmask8) __U,
   _MM_FROUND_CUR_DIRECTION);
 }
 
 #define _mm_mask3_fmsub_round_ss(W, X, Y, U, R) __extension__ ({\
-  (__m128)__builtin_ia32_vfmaddss3_mask3((__v4sf)(__m128)(W), \
+  (__m128)__builtin_ia32_vfmsubss3_mask3((__v4sf)(__m128)(W), \
  (__v4sf)(__m128)(X), \
- -(__v4sf)(__m128)(Y), (__mmask8)(U), \
+ (__v4sf)(__m128)(Y), (__mmask8)(U), \
  (int)(R)); })
 
 static __inline__ __m128 __DEFAULT_FN_ATTRS
@@ -8566,17 +8566,17 @@ _mm_maskz_fnmsub_ss (__mmask8 __U, __m12
 static __inline__ __m128 __DEFAULT_FN_ATTRS
 _mm_mask3_fnmsub_ss (__m128 __W, __m128 __X, __m128 __Y, __mmask8 __U)
 {
- return (__m128) __builtin_ia32_vfmaddss3_mask3 (-(__v4sf) __W,
+ return (__m128) __builtin_ia32_vfnmsubss3_mask3 ((__v4sf) __W,
   (__v4sf) __X,
-  -(__v4sf) __Y,
+  (__v4sf) __Y,
   (__mmask8) __U,
   _MM_FROUND_CUR_DIRECTION);
 }
 
 #define _mm_mask3_fnmsub_round_ss(W, X, Y, U, R) __extension__({\
-  (__m128)__builtin_ia32_vfmaddss3_mask3(-(__v4sf)(__m128)(W), \
+  (__m128)__builtin_ia32_vfnmsubss3_mask3((__v4sf)(__m128)(W), \
  (__v4sf)(__m128)(X), \
- -(__v4sf)(__m128)(Y), (__mmask8)(U), \
+ (__v4sf)(__m128)(Y), (__mmask8)(U), \
  (int)(R)); })
 
 static __inline__ __m128d __DEFAULT_FN_ATTRS
@@ -8662,17 +8662,17 @@ _mm_maskz_fmsub_sd (__mmask8 __U, __m128
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_mask3_fmsub_sd (__m128d __W, __m128d __X, __m128d __Y, __mmask8 __U)
 {
- return (__m128d) __builtin_ia32_vfmaddsd3_mask3 ((__v2df) __W,
+ return (__m128d) __builtin_ia32_vfmsubsd3_mask3 ((__v2df) __W,
   (__v2df) __X,
-  -(__v2df) __Y,
+  (__v2df) __Y,
   (__mmask8) __U,
   _MM_FROUND_CUR_DIRECTION);
 }
 
 #define _mm_mask3_fmsub_round_sd(W, X, Y, U, R) __extension__ ({\
-  (__m128d)__builtin_ia32_vfmaddsd3_mask3((__v2df)(__m128d)(W), \
+  (__m128d)__builtin_ia32_vfmsubsd3_mask3((__v2df)(__m128d)(W), \
   (__v2df)(__m128d)(X), \
-  

[PATCH] D26196: Add support for non-zero null pointer for C and OpenCL

2016-11-12 Thread John McCall via cfe-commits
rjmccall added a comment.

In https://reviews.llvm.org/D26196#592823, @yaxunl wrote:

> Hi John,
>
> It seems the casting from a pointer to different address space is not 
> affected by this change. When a null pointer is casted to different address 
> space, it is casted the same way as an ordinary pointer, e.g. by 
> addrspacecast.


You mean, the code-generation for that knows about your special null pointer 
representation?  That is confusing.


https://reviews.llvm.org/D26196



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


[PATCH] D26582: [clang-tidy] Handle template instantiations in modenize-use-default check

2016-11-12 Thread Malcolm Parsons via cfe-commits
malcolm.parsons created this revision.
malcolm.parsons added reviewers: aaron.ballman, alexfh.
malcolm.parsons added a subscriber: cfe-commits.

Duplicate fixes were being created for explicit template instantiations
of out-of-line constructors or destructors.

Fixes PR30921.


https://reviews.llvm.org/D26582

Files:
  clang-tidy/modernize/UseDefaultCheck.cpp
  test/clang-tidy/modernize-use-default.cpp


Index: test/clang-tidy/modernize-use-default.cpp
===
--- test/clang-tidy/modernize-use-default.cpp
+++ test/clang-tidy/modernize-use-default.cpp
@@ -124,6 +124,26 @@
   // CHECK-FIXES: ~Temp() = default;
 };
 
+// Class template out of line with explicit instantiation.
+template 
+class TempODef {
+public:
+  TempODef();
+  ~TempODef();
+};
+
+template 
+TempODef::TempODef() {}
+// CHECK-MESSAGES: :[[@LINE-2]]:1: warning: use '= default'
+// CHECK-FIXES: TempODef::TempODef() = default;
+template 
+TempODef::~TempODef() {}
+// CHECK-MESSAGES: :[[@LINE-2]]:1: warning: use '= default'
+// CHECK-FIXES: TempODef::~TempODef() = default;
+
+template class TempODef;
+template class TempODef;
+
 // Non user-provided constructor/destructor.
 struct Imp {
   int Int;
Index: clang-tidy/modernize/UseDefaultCheck.cpp
===
--- clang-tidy/modernize/UseDefaultCheck.cpp
+++ clang-tidy/modernize/UseDefaultCheck.cpp
@@ -241,6 +241,7 @@
   if (SpecialFunctionDecl->isDeleted() ||
   SpecialFunctionDecl->isExplicitlyDefaulted() ||
   SpecialFunctionDecl->isLateTemplateParsed() ||
+  SpecialFunctionDecl->isTemplateInstantiation() ||
   !SpecialFunctionDecl->isUserProvided() || 
!SpecialFunctionDecl->hasBody())
 return;
 


Index: test/clang-tidy/modernize-use-default.cpp
===
--- test/clang-tidy/modernize-use-default.cpp
+++ test/clang-tidy/modernize-use-default.cpp
@@ -124,6 +124,26 @@
   // CHECK-FIXES: ~Temp() = default;
 };
 
+// Class template out of line with explicit instantiation.
+template 
+class TempODef {
+public:
+  TempODef();
+  ~TempODef();
+};
+
+template 
+TempODef::TempODef() {}
+// CHECK-MESSAGES: :[[@LINE-2]]:1: warning: use '= default'
+// CHECK-FIXES: TempODef::TempODef() = default;
+template 
+TempODef::~TempODef() {}
+// CHECK-MESSAGES: :[[@LINE-2]]:1: warning: use '= default'
+// CHECK-FIXES: TempODef::~TempODef() = default;
+
+template class TempODef;
+template class TempODef;
+
 // Non user-provided constructor/destructor.
 struct Imp {
   int Int;
Index: clang-tidy/modernize/UseDefaultCheck.cpp
===
--- clang-tidy/modernize/UseDefaultCheck.cpp
+++ clang-tidy/modernize/UseDefaultCheck.cpp
@@ -241,6 +241,7 @@
   if (SpecialFunctionDecl->isDeleted() ||
   SpecialFunctionDecl->isExplicitlyDefaulted() ||
   SpecialFunctionDecl->isLateTemplateParsed() ||
+  SpecialFunctionDecl->isTemplateInstantiation() ||
   !SpecialFunctionDecl->isUserProvided() || !SpecialFunctionDecl->hasBody())
 return;
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D26435: Use unique_ptr for cached tokens for default arguments in C++.

2016-11-12 Thread Malcolm Parsons via cfe-commits
malcolm.parsons requested changes to this revision.
malcolm.parsons added a comment.
This revision now requires changes to proceed.

  Expected Passes: 4977
  Expected Failures  : 18
  Unsupported Tests  : 25
  Unexpected Failures: 5037

Needs more work?


https://reviews.llvm.org/D26435



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


[PATCH] D25816: Use descriptive message if list initializer is incorrectly parenthesized.

2016-11-12 Thread Serge Pavlov via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL286721: Use descriptive message if list initializer is 
incorrectly parenthesized. (authored by sepavloff).

Changed prior to commit:
  https://reviews.llvm.org/D25816?vs=75404&id=77725#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D25816

Files:
  cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
  cfe/trunk/include/clang/Sema/Sema.h
  cfe/trunk/lib/Sema/SemaDecl.cpp
  cfe/trunk/lib/Sema/SemaExprCXX.cpp
  cfe/trunk/test/SemaCXX/cxx0x-initializer-references.cpp
  cfe/trunk/test/SemaCXX/cxx0x-initializer-scalars.cpp

Index: cfe/trunk/test/SemaCXX/cxx0x-initializer-references.cpp
===
--- cfe/trunk/test/SemaCXX/cxx0x-initializer-references.cpp
+++ cfe/trunk/test/SemaCXX/cxx0x-initializer-references.cpp
@@ -72,10 +72,9 @@
   }
 
   void edge_cases() {
-// FIXME: very poor error message
-int const &b({0}); // expected-error {{could not bind}}
+int const &b({0}); // expected-error {{list-initializer for non-class type 'const int &' must not be parenthesized}}
+const int (&arr)[3] ({1, 2, 3}); // expected-error {{list-initializer for non-class type 'const int (&)[3]' must not be parenthesized}}
   }
-
 }
 
 namespace PR12182 {
Index: cfe/trunk/test/SemaCXX/cxx0x-initializer-scalars.cpp
===
--- cfe/trunk/test/SemaCXX/cxx0x-initializer-scalars.cpp
+++ cfe/trunk/test/SemaCXX/cxx0x-initializer-scalars.cpp
@@ -91,10 +91,23 @@
   }
 
   void edge_cases() {
-// FIXME: very poor error message
-int a({0}); // expected-error {{cannot initialize}}
-(void) int({0}); // expected-error {{functional-style cast}}
-new int({0});  // expected-error {{cannot initialize}}
+int a({0}); // expected-error {{list-initializer for non-class type 'int' must not be parenthesized}}
+(void) int({0}); // expected-error {{list-initializer for non-class type 'int' must not be parenthesized}}
+new int({0});  // expected-error {{list-initializer for non-class type 'int' must not be parenthesized}}
+
+int *b({0});  // expected-error {{list-initializer for non-class type 'int *' must not be parenthesized}}
+typedef int *intptr;
+int *c = intptr({0});  // expected-error {{list-initializer for non-class type 'intptr' (aka 'int *') must not be parenthesized}}
+  }
+
+  template void dependent_edge_cases() {
+T a({0});
+(void) T({0});
+new T({0});
+
+T *b({0});
+typedef T *tptr;
+T *c = tptr({0});
   }
 
   void default_argument(int i = {}) {
Index: cfe/trunk/lib/Sema/SemaExprCXX.cpp
===
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp
@@ -1221,6 +1221,17 @@
   if (!TInfo)
 TInfo = Context.getTrivialTypeSourceInfo(Ty, SourceLocation());
 
+  // Handle errors like: int({0})
+  if (exprs.size() == 1 && !canInitializeWithParenthesizedList(Ty) &&
+  LParenLoc.isValid() && RParenLoc.isValid())
+if (auto IList = dyn_cast(exprs[0])) {
+  Diag(TInfo->getTypeLoc().getLocStart(), diag::err_list_init_in_parens)
+  << Ty << IList->getSourceRange()
+  << FixItHint::CreateRemoval(LParenLoc)
+  << FixItHint::CreateRemoval(RParenLoc);
+  LParenLoc = RParenLoc = SourceLocation();
+}
+
   auto Result = BuildCXXTypeConstructExpr(TInfo, LParenLoc, exprs, RParenLoc);
   // Avoid creating a non-type-dependent expression that contains typos.
   // Non-type-dependent expressions are liable to be discarded without
@@ -1562,8 +1573,20 @@
 return ExprError();
 
   SourceRange DirectInitRange;
-  if (ParenListExpr *List = dyn_cast_or_null(Initializer))
+  if (ParenListExpr *List = dyn_cast_or_null(Initializer)) {
 DirectInitRange = List->getSourceRange();
+// Handle errors like: new int a({0})
+if (List->getNumExprs() == 1 &&
+!canInitializeWithParenthesizedList(AllocType))
+  if (auto IList = dyn_cast(List->getExpr(0))) {
+Diag(TInfo->getTypeLoc().getLocStart(), diag::err_list_init_in_parens)
+<< AllocType << List->getSourceRange()
+<< FixItHint::CreateRemoval(List->getLocStart())
+<< FixItHint::CreateRemoval(List->getLocEnd());
+DirectInitRange = SourceRange();
+Initializer = IList;
+  }
+  }
 
   return BuildCXXNew(SourceRange(StartLoc, D.getLocEnd()), UseGlobal,
  PlacementLParen,
Index: cfe/trunk/lib/Sema/SemaDecl.cpp
===
--- cfe/trunk/lib/Sema/SemaDecl.cpp
+++ cfe/trunk/lib/Sema/SemaDecl.cpp
@@ -9865,6 +9865,18 @@
   // Perform the initialization.
   ParenListExpr *CXXDirectInit = dyn_cast(Init);
   if (!VDecl->isInvalidDecl()) {
+// Handle errors like: int a({0})
+if (CXXDirectInit && CXXDirectInit->getNumExprs() == 1 &&
+!canInitializeWithPa

r286721 - Use descriptive message if list initializer is incorrectly parenthesized.

2016-11-12 Thread Serge Pavlov via cfe-commits
Author: sepavloff
Date: Sat Nov 12 09:38:55 2016
New Revision: 286721

URL: http://llvm.org/viewvc/llvm-project?rev=286721&view=rev
Log:
Use descriptive message if list initializer is incorrectly parenthesized.

If initializer contains parentheses around braced list where it is not allowed,
as in construct int({0}), clang issued message like `functional-style cast
from 'void' to 'int' is not allowed`, which does not help much. Both gcc and
msvc issue message `list-initializer for non-class type must not be
parenthesized`, which is more descriptive. This change implements similar
message for clang.

Differential Revision: https://reviews.llvm.org/D25816

Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/lib/Sema/SemaExprCXX.cpp
cfe/trunk/test/SemaCXX/cxx0x-initializer-references.cpp
cfe/trunk/test/SemaCXX/cxx0x-initializer-scalars.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=286721&r1=286720&r2=286721&view=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Sat Nov 12 09:38:55 
2016
@@ -1780,6 +1780,8 @@ def note_uninit_fixit_remove_cond : Note
   "remove the %select{'%1' if its condition|condition if it}0 "
   "is always %select{false|true}2">;
 def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
+def err_list_init_in_parens : Error<"list-initializer for non-class type %0 "
+  "must not be parenthesized">;
 
 def warn_unsequenced_mod_mod : Warning<
   "multiple unsequenced modifications to %0">, InGroup;

Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=286721&r1=286720&r2=286721&view=diff
==
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Sat Nov 12 09:38:55 2016
@@ -1796,6 +1796,8 @@ public:
 bool TypeMayContainAuto);
   void ActOnUninitializedDecl(Decl *dcl, bool TypeMayContainAuto);
   void ActOnInitializerError(Decl *Dcl);
+  bool canInitializeWithParenthesizedList(QualType TargetType);
+
   void ActOnPureSpecifier(Decl *D, SourceLocation PureSpecLoc);
   void ActOnCXXForRangeDecl(Decl *D);
   StmtResult ActOnCXXForRangeIdentifier(Scope *S, SourceLocation IdentLoc,

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=286721&r1=286720&r2=286721&view=diff
==
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Sat Nov 12 09:38:55 2016
@@ -9865,6 +9865,18 @@ void Sema::AddInitializerToDecl(Decl *Re
   // Perform the initialization.
   ParenListExpr *CXXDirectInit = dyn_cast(Init);
   if (!VDecl->isInvalidDecl()) {
+// Handle errors like: int a({0})
+if (CXXDirectInit && CXXDirectInit->getNumExprs() == 1 &&
+!canInitializeWithParenthesizedList(VDecl->getType()))
+  if (auto IList = dyn_cast(CXXDirectInit->getExpr(0))) {
+Diag(VDecl->getLocation(), diag::err_list_init_in_parens)
+<< VDecl->getType() << CXXDirectInit->getSourceRange()
+<< FixItHint::CreateRemoval(CXXDirectInit->getLocStart())
+<< FixItHint::CreateRemoval(CXXDirectInit->getLocEnd());
+Init = IList;
+CXXDirectInit = nullptr;
+  }
+
 InitializedEntity Entity = InitializedEntity::InitializeVariable(VDecl);
 InitializationKind Kind =
 DirectInit
@@ -10171,6 +10183,18 @@ void Sema::ActOnInitializerError(Decl *D
   // though.
 }
 
+/// Checks if an object of the given type can be initialized with parenthesized
+/// init-list.
+///
+/// \param TargetType Type of object being initialized.
+///
+/// The function is used to detect wrong initializations, such as 'int({0})'.
+///
+bool Sema::canInitializeWithParenthesizedList(QualType TargetType) {
+  return TargetType->isDependentType() || TargetType->isRecordType() ||
+ TargetType->getContainedAutoType();
+}
+
 void Sema::ActOnUninitializedDecl(Decl *RealDecl,
   bool TypeMayContainAuto) {
   // If there is no declaration, there was an error parsing it. Just ignore it.

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=286721&r1=286720&r2=286721&view=diff
==
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Sat Nov 12 09:38:55 2016
@@ -1221,6 +1221,17 @@ Sema::ActOnCXXType

[PATCH] D24639: [Sema] Warn when returning a lambda that captures a local variable by reference

2016-11-12 Thread Erik Pilkington via cfe-commits
erik.pilkington added inline comments.



Comment at: test/SemaCXX/cxx1y-generic-lambdas-capturing.cpp:185
   f(y, d);
-  f(z, d);
+  f(z, d); // expected-warning {{address of stack memory associated 
with local variable 'z' returned}}
   decltype(a) A = a;

rsmith wrote:
> This diagnostic looks like it'll be confusing. Can you add a note pointing at 
> the `return` statement in question (we're warning about the one on line 179, 
> I assume)?
OK, in the new patch we emit the warning at the 'return', and a note at the 
capture location.



Comment at: test/SemaCXX/cxx1y-init-captures.cpp:123-124
   };
-  return M;
+  // FIXME: We shouldn't emit this warning here.
+  return M; // expected-warning{{stack memory}}
 };

rsmith wrote:
> Do you know why this happens? It looks like `EvalVal` should bail out on the 
> `DeclRefExpr` in the init-capture, because it 
> `refersToEnclosingVariableOrCapture`.
For some reason `refersToEnclosingVariableOrCapture` isn't set here, which 
seems like a bug to me. The new patch works around this by warning only if the 
variable that we're capturing is declared in the same context as the return 
statement.


https://reviews.llvm.org/D24639



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


[PATCH] D24639: [Sema] Warn when returning a lambda that captures a local variable by reference

2016-11-12 Thread Erik Pilkington via cfe-commits
erik.pilkington updated this revision to Diff 77717.
erik.pilkington added a comment.

This new patch rewrites the check to just use the captures in the lambda's 
CXXRecordDecl, instead of searching through the returned expression to find the 
LambdaExpr.
Thanks!


https://reviews.llvm.org/D24639

Files:
  include/clang/AST/LambdaCapture.h
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/Sema/SemaChecking.cpp
  test/SemaCXX/cxx1y-generic-lambdas-capturing.cpp
  test/SemaCXX/return-lambda-stack-addr.cpp

Index: test/SemaCXX/return-lambda-stack-addr.cpp
===
--- test/SemaCXX/return-lambda-stack-addr.cpp
+++ test/SemaCXX/return-lambda-stack-addr.cpp
@@ -0,0 +1,127 @@
+// RUN: %clang_cc1 -std=c++14 -verify -fsyntax-only %s
+
+auto basic() {
+  int local;
+
+  return [&]() { // expected-warning{{reference to stack memory associated with local variable 'local' returned through lambda capture}}
+(void)local; // expected-note{{capturing reference to local variable 'local' in lambda here}}
+  };
+}
+
+auto extern_lambda() {
+  return basic(); // no warn
+}
+
+auto by_copy() {
+  int local;
+
+  return [=]() {
+(void)local; // no warning
+  };
+}
+
+auto nested() {
+  int local;
+
+  return [=] {
+return [&]() { (void)local; }; // no warning
+  };
+}
+
+auto nested2() {
+  int local;
+
+  return [&] { // expected-warning{{reference to stack memory associated with local variable 'local' returned through lambda capture}}
+(void)[=] {
+  (void)local; // expected-note{{capturing reference to local variable 'local' in lambda here}}
+};
+  };
+}
+
+auto nested3() {
+  int local;
+  return [&] { // expected-warning{{reference to stack memory associated with local variable 'local' returned through lambda capture}}
+return [&] {
+  (void)local; // expected-note{{capturing reference to local variable 'local' in lambda here}}
+};
+  };
+}
+
+auto nested4() {
+  int local;
+  (void)[&] {
+return [&] { (void)local; }; // no warn
+  };
+}
+
+auto lambda = [] {
+  int local;
+  return [&] { return local; }; // expected-warning{{reference to stack memory associated with local variable 'local' returned through lambda capture}} expected-note{{capturing reference to local variable 'local' in lambda here}}
+};
+
+auto ref_copy() {
+  int x;
+  int &y = x;
+
+  return [=] { (void)y; }; // no warn
+}
+
+auto ref_ref() {
+  int x;
+  int &y = x;
+  return [&] { (void)y; }; // expected-warning{{reference to stack memory associated with local variable 'x' returned through lambda capture}} expected-note{{capturing reference to local}}
+}
+
+auto ref_ref_ok(int &r) {
+  int &y = r;
+  return [&] { return y; }; // no warning
+}
+
+auto &return_ref() {
+  auto lam = [] {};
+  return lam; // expected-warning{{reference to stack memory}}
+}
+
+auto param(int p) {
+  return [&] { (void)p; }; // expected-warning{{reference to stack memory associated with local variable 'p' returned}} expected-note{{capturing reference to local}}
+}
+
+auto return_var() {
+  int local;
+  auto lam = [&local] {}; // expected-note 2 {{capturing reference to local variable 'local' in lambda here}}
+
+  auto &lam_ref = lam;
+
+  if (0)
+return lam; // expected-warning{{reference to stack memory associated with local variable 'local' returned}}
+  else
+return lam_ref; // expected-warning{{reference to stack memory associated with local variable 'local' returned}}
+}
+
+auto return_ptr_in_var_warn() {
+  int local;
+  auto lam = [ptr = &local]{}; // expected-note{{capturing address of local variable 'local' in lambda here}}
+  return lam; // expected-warning{{address of stack memory associated with local variable 'local' returned through lambda capture}}
+}
+
+auto return_ptr_warn() {
+  int local;
+  return [ptr = &local]{}; // expected-warning{{address of stack memory associated with local variable 'local' returned through lambda capture}} expected-note{{capturing address of local variable 'local' in lambda here}}
+}
+
+auto mutable_lambda_warn() {
+  int local;
+  auto mut = [&local]() mutable {}; // expected-note{{capturing reference to local variable 'local' in lambda here}}
+  return mut; // expected-warning{{reference to stack memory associated with local variable 'local' returned through lambda capture}}
+}
+
+auto mutable_lambda_warn2() {
+  int local;
+  return [cap = &local]() mutable {}; // expected-warning{{address of stack memory associated with local variable 'local' returned through lambda capture}} expected-note{{capturing address of local variable 'local' in lambda here}}
+}
+
+auto mutable_lambda_no_warn() {
+  int local;
+  auto mut = [cap = &local]() mutable {};
+  return mut; // no warning
+}
Index: test/SemaCXX/cxx1y-generic-lambdas-capturing.cpp
===
--- test/SemaCXX/cxx1y-generic-lambdas-capturing.cpp
+++ test/SemaCXX/cxx1y-generic-lambdas-capturing.cpp
@@ -176,20 +176,20 @

r286718 - As we released 3.9, from the 4.0 release notes, points to version 3.9 instead of 3.8

2016-11-12 Thread Sylvestre Ledru via cfe-commits
Author: sylvestre
Date: Sat Nov 12 04:38:18 2016
New Revision: 286718

URL: http://llvm.org/viewvc/llvm-project?rev=286718&view=rev
Log:
As we released 3.9, from the 4.0 release notes, points to version 3.9 instead 
of 3.8

Modified:
cfe/trunk/docs/ReleaseNotes.rst

Modified: cfe/trunk/docs/ReleaseNotes.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=286718&r1=286717&r2=286718&view=diff
==
--- cfe/trunk/docs/ReleaseNotes.rst (original)
+++ cfe/trunk/docs/ReleaseNotes.rst Sat Nov 12 04:38:18 2016
@@ -11,8 +11,8 @@ Written by the `LLVM Team `_.
+   prefer the `Clang 3.9 Release Notes
+   `_.
 
 Introduction
 
@@ -121,7 +121,7 @@ OpenMP Support in Clang
 Internal API Changes
 
 
-These are major API changes that have happened since the 3.8 release of
+These are major API changes that have happened since the 3.9 release of
 Clang. If upgrading an external codebase that uses Clang as a library,
 this section should help get you past the largest hurdles of upgrading.
 


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


r286717 - Add the new option -Og in the release notes. See r286602 for more information

2016-11-12 Thread Sylvestre Ledru via cfe-commits
Author: sylvestre
Date: Sat Nov 12 04:37:17 2016
New Revision: 286717

URL: http://llvm.org/viewvc/llvm-project?rev=286717&view=rev
Log:
Add the new option -Og in the release notes. See r286602 for more information

Modified:
cfe/trunk/docs/ReleaseNotes.rst

Modified: cfe/trunk/docs/ReleaseNotes.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=286717&r1=286716&r2=286717&view=diff
==
--- cfe/trunk/docs/ReleaseNotes.rst (original)
+++ cfe/trunk/docs/ReleaseNotes.rst Sat Nov 12 04:37:17 2016
@@ -57,8 +57,12 @@ Improvements to Clang's diagnostics
 New Compiler Flags
 --
 
-The option 
+The option -Og has been added to optimize the debugging experience.
+For now, this option is exactly the same as -O1. However, in the future,
+some other optimizations might be enabled or disabled.
+
 
+The option 
 
 New Pragmas in Clang
 ---


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


r286716 - Add support of the next Ubuntu (17.04 - Zesty Zapus)

2016-11-12 Thread Sylvestre Ledru via cfe-commits
Author: sylvestre
Date: Sat Nov 12 03:26:30 2016
New Revision: 286716

URL: http://llvm.org/viewvc/llvm-project?rev=286716&view=rev
Log:
Add support of the next Ubuntu (17.04 - Zesty Zapus)


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=286716&r1=286715&r2=286716&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Sat Nov 12 03:26:30 2016
@@ -3865,6 +3865,7 @@ enum Distro {
   UbuntuWily,
   UbuntuXenial,
   UbuntuYakkety,
+  UbuntuZesty,
   UnknownDistro
 };
 
@@ -3879,7 +3880,7 @@ static bool IsDebian(enum Distro Distro)
 }
 
 static bool IsUbuntu(enum Distro Distro) {
-  return Distro >= UbuntuHardy && Distro <= UbuntuYakkety;
+  return Distro >= UbuntuHardy && Distro <= UbuntuZesty;
 }
 
 static Distro DetectDistro(vfs::FileSystem &VFS) {
@@ -3911,6 +3912,7 @@ static Distro DetectDistro(vfs::FileSyst
   .Case("wily", UbuntuWily)
   .Case("xenial", UbuntuXenial)
   .Case("yakkety", UbuntuYakkety)
+  .Case("zesty", UbuntuZesty)
   .Default(UnknownDistro);
 if (Version != UnknownDistro)
   return Version;


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


[PATCH] D24082: [CMake] Fix libc++abi arm build w/o libunwind.

2016-11-12 Thread Eric Fiselier via cfe-commits
EricWF accepted this revision.
EricWF added a comment.
This revision is now accepted and ready to land.

Nope LGTM.


https://reviews.llvm.org/D24082



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