r332817 - Print the qualified name when dumping deserialized decls.
Author: vvassilev Date: Sun May 20 02:38:52 2018 New Revision: 332817 URL: http://llvm.org/viewvc/llvm-project?rev=332817&view=rev Log: Print the qualified name when dumping deserialized decls. This is useful to understand and debug the lazy template specializations used in the pch and modules. Differential Revision: https://reviews.llvm.org/D41785 Modified: cfe/trunk/lib/Frontend/FrontendAction.cpp Modified: cfe/trunk/lib/Frontend/FrontendAction.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FrontendAction.cpp?rev=332817&r1=332816&r2=332817&view=diff == --- cfe/trunk/lib/Frontend/FrontendAction.cpp (original) +++ cfe/trunk/lib/Frontend/FrontendAction.cpp Sun May 20 02:38:52 2018 @@ -88,8 +88,10 @@ public: void DeclRead(serialization::DeclID ID, const Decl *D) override { llvm::outs() << "PCH DECL: " << D->getDeclKindName(); -if (const NamedDecl *ND = dyn_cast(D)) - llvm::outs() << " - " << *ND; +if (const NamedDecl *ND = dyn_cast(D)) { + llvm::outs() << " - "; + ND->printQualifiedName(llvm::outs()); +} llvm::outs() << "\n"; DelegatingDeserializationListener::DeclRead(ID, D); ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D41785: Print the qualified name when dumping deserialized decls.
This revision was automatically updated to reflect the committed changes. Closed by commit rL332817: Print the qualified name when dumping deserialized decls. (authored by vvassilev, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D41785?vs=128791&id=147706#toc Repository: rL LLVM https://reviews.llvm.org/D41785 Files: cfe/trunk/lib/Frontend/FrontendAction.cpp Index: cfe/trunk/lib/Frontend/FrontendAction.cpp === --- cfe/trunk/lib/Frontend/FrontendAction.cpp +++ cfe/trunk/lib/Frontend/FrontendAction.cpp @@ -88,8 +88,10 @@ void DeclRead(serialization::DeclID ID, const Decl *D) override { llvm::outs() << "PCH DECL: " << D->getDeclKindName(); -if (const NamedDecl *ND = dyn_cast(D)) - llvm::outs() << " - " << *ND; +if (const NamedDecl *ND = dyn_cast(D)) { + llvm::outs() << " - "; + ND->printQualifiedName(llvm::outs()); +} llvm::outs() << "\n"; DelegatingDeserializationListener::DeclRead(ID, D); Index: cfe/trunk/lib/Frontend/FrontendAction.cpp === --- cfe/trunk/lib/Frontend/FrontendAction.cpp +++ cfe/trunk/lib/Frontend/FrontendAction.cpp @@ -88,8 +88,10 @@ void DeclRead(serialization::DeclID ID, const Decl *D) override { llvm::outs() << "PCH DECL: " << D->getDeclKindName(); -if (const NamedDecl *ND = dyn_cast(D)) - llvm::outs() << " - " << *ND; +if (const NamedDecl *ND = dyn_cast(D)) { + llvm::outs() << " - "; + ND->printQualifiedName(llvm::outs()); +} llvm::outs() << "\n"; DelegatingDeserializationListener::DeclRead(ID, D); ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libcxx] r332818 - Deduction guides for list
Author: marshall Date: Sun May 20 07:05:31 2018 New Revision: 332818 URL: http://llvm.org/viewvc/llvm-project?rev=332818&view=rev Log: Deduction guides for list Added: libcxx/trunk/test/std/containers/sequences/list/list.cons/deduct.fail.cpp libcxx/trunk/test/std/containers/sequences/list/list.cons/deduct.pass.cpp Modified: libcxx/trunk/include/list Modified: libcxx/trunk/include/list URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/list?rev=332818&r1=332817&r2=332818&view=diff == --- libcxx/trunk/include/list (original) +++ libcxx/trunk/include/list Sun May 20 07:05:31 2018 @@ -147,6 +147,11 @@ public: void reverse() noexcept; }; + +template ::value_type>> +list(InputIterator, InputIterator, Allocator = Allocator()) +-> list::value_type, Allocator>; // C++17 + template bool operator==(const list& x, const list& y); template @@ -527,11 +532,12 @@ class __list_imp { __list_imp(const __list_imp&); __list_imp& operator=(const __list_imp&); -protected: -typedef _Tp value_type; +public: typedef _Alloc allocator_type; typedef allocator_traits __alloc_traits; typedef typename __alloc_traits::size_type size_type; +protected: +typedef _Tp value_type; typedef typename __alloc_traits::void_pointer __void_pointer; typedef __list_iterator iterator; typedef __list_const_iterator const_iterator; @@ -1106,6 +1112,22 @@ private: void __move_assign(list& __c, false_type); }; +#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES +template::value_type>, + class = typename enable_if<__is_allocator<_Alloc>::value, void>::type + > +list(_InputIterator, _InputIterator) + -> list::value_type, _Alloc>; + +template::value, void>::type + > +list(_InputIterator, _InputIterator, _Alloc) + -> list::value_type, _Alloc>; +#endif + // Link in nodes [__f, __l] just prior to __p template inline Added: libcxx/trunk/test/std/containers/sequences/list/list.cons/deduct.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/list/list.cons/deduct.fail.cpp?rev=332818&view=auto == --- libcxx/trunk/test/std/containers/sequences/list/list.cons/deduct.fail.cpp (added) +++ libcxx/trunk/test/std/containers/sequences/list/list.cons/deduct.fail.cpp Sun May 20 07:05:31 2018 @@ -0,0 +1,42 @@ +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: libcpp-no-deduction-guides + + +// template ::value_type>> +//list(InputIterator, InputIterator, Allocator = Allocator()) +//-> list::value_type, Allocator>; +// + + +#include +#include +#include +#include +#include // INT_MAX + +struct A {}; + +int main() +{ +// Test the explicit deduction guides + +// Test the implicit deduction guides +{ +// list (allocator &) +std::list lst((std::allocator())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'list'}} +// Note: The extra parens are necessary, since otherwise clang decides it is a function declaration. +// Also, we can't use {} instead of parens, because that constructs a +// deque, allocator>> +} + +} Added: libcxx/trunk/test/std/containers/sequences/list/list.cons/deduct.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/list/list.cons/deduct.pass.cpp?rev=332818&view=auto == --- libcxx/trunk/test/std/containers/sequences/list/list.cons/deduct.pass.cpp (added) +++ libcxx/trunk/test/std/containers/sequences/list/list.cons/deduct.pass.cpp Sun May 20 07:05:31 2018 @@ -0,0 +1,103 @@ +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: libcpp-no-deduction-guides + + +// template ::value_type>> +//list(InputIterator, InputIterator, Allocator = Allocator()) +//-
[PATCH] D47118: [modules] Print input files when -module-file-info file switch is passed.
v.g.vassilev created this revision. v.g.vassilev added reviewers: rsmith, bruno, teemperor. This patch improves traceability of duplicated header files which end up in multiple pcms. Repository: rC Clang https://reviews.llvm.org/D47118 Files: lib/Frontend/FrontendActions.cpp test/Modules/module_file_info.m Index: test/Modules/module_file_info.m === --- test/Modules/module_file_info.m +++ test/Modules/module_file_info.m @@ -43,6 +43,16 @@ // CHECK: Predefined macros: // CHECK: -DBLARG // CHECK: -DWIBBLE=WOBBLE +// CHECK: Input file: {{.*}}DependsOnModulePrivate.h +// CHECK-NEXT: Input file: {{.*}}Other.h +// CHECK-NEXT: Input file: {{.*}}SubFramework.h +// CHECK-NEXT: Input file: {{.*}}not_coroutines.h +// CHECK-NEXT: Input file: {{.*}}not_cxx.h +// CHECK-NEXT: Input file: {{.*}}other.h +// CHECK-NEXT: Input file: {{.*}}module.map +// CHECK-NEXT: Input file: {{.*}}DependsOnModule.h +// CHECK-NEXT: Input file: {{.*}}module_private.map +// CHECK-NEXT: Input file: {{.*}}module.map // CHECK: Diagnostic options: // CHECK: IgnoreWarnings: Yes Index: lib/Frontend/FrontendActions.cpp === --- lib/Frontend/FrontendActions.cpp +++ lib/Frontend/FrontendActions.cpp @@ -560,6 +560,45 @@ Out << "\n"; } + +/// Tells the \c ASTReaderListener that we want to receive the +/// input files of the AST file via \c visitInputFile. +bool needsInputFileVisitation() override { return true; } + +/// Tells the \c ASTReaderListener that we want to receive the +/// input files of the AST file via \c visitInputFile. +bool needsSystemInputFileVisitation() override { return true; } + +/// Indicates that the AST file contains particular input file. +/// +/// \returns true to continue receiving the next input file, false to stop. +bool visitInputFile(StringRef Filename, bool isSystem, +bool isOverridden, bool isExplicitModule) override { + + Out.indent(2) << "Input file: " << Filename; + + if (isSystem || isOverridden || isExplicitModule) { +Out << " ["; +if (isSystem) { + Out << "System"; + if (isOverridden || isExplicitModule) +Out << ", "; +} +if (isOverridden) { + Out << "Overridden"; + if (isExplicitModule) +Out << ", "; +} +if (isExplicitModule) + Out << "ExplicitModule"; + +Out << "]"; + } + + Out << "\n"; + + return true; +} #undef DUMP_BOOLEAN }; } Index: test/Modules/module_file_info.m === --- test/Modules/module_file_info.m +++ test/Modules/module_file_info.m @@ -43,6 +43,16 @@ // CHECK: Predefined macros: // CHECK: -DBLARG // CHECK: -DWIBBLE=WOBBLE +// CHECK: Input file: {{.*}}DependsOnModulePrivate.h +// CHECK-NEXT: Input file: {{.*}}Other.h +// CHECK-NEXT: Input file: {{.*}}SubFramework.h +// CHECK-NEXT: Input file: {{.*}}not_coroutines.h +// CHECK-NEXT: Input file: {{.*}}not_cxx.h +// CHECK-NEXT: Input file: {{.*}}other.h +// CHECK-NEXT: Input file: {{.*}}module.map +// CHECK-NEXT: Input file: {{.*}}DependsOnModule.h +// CHECK-NEXT: Input file: {{.*}}module_private.map +// CHECK-NEXT: Input file: {{.*}}module.map // CHECK: Diagnostic options: // CHECK: IgnoreWarnings: Yes Index: lib/Frontend/FrontendActions.cpp === --- lib/Frontend/FrontendActions.cpp +++ lib/Frontend/FrontendActions.cpp @@ -560,6 +560,45 @@ Out << "\n"; } + +/// Tells the \c ASTReaderListener that we want to receive the +/// input files of the AST file via \c visitInputFile. +bool needsInputFileVisitation() override { return true; } + +/// Tells the \c ASTReaderListener that we want to receive the +/// input files of the AST file via \c visitInputFile. +bool needsSystemInputFileVisitation() override { return true; } + +/// Indicates that the AST file contains particular input file. +/// +/// \returns true to continue receiving the next input file, false to stop. +bool visitInputFile(StringRef Filename, bool isSystem, +bool isOverridden, bool isExplicitModule) override { + + Out.indent(2) << "Input file: " << Filename; + + if (isSystem || isOverridden || isExplicitModule) { +Out << " ["; +if (isSystem) { + Out << "System"; + if (isOverridden || isExplicitModule) +Out << ", "; +} +if (isOverridden) { + Out << "Overridden"; + if (isExplicitModule) +Out << ", "; +} +if (isExplicitModule) + Out << "ExplicitModule"; + +Out << "]"; + } + + Out << "\n"; + + return true; +} #undef DUMP_BOOLEAN }; } _
[PATCH] D46052: GNUstep Objective-C ABI version 2
theraven marked 3 inline comments as done. theraven added inline comments. Comment at: lib/CodeGen/CGObjCGNU.cpp:439 + ArrayRef IvarOffsets, + ArrayRef IvarAlign, + ArrayRef IvarOwnership); rjmccall wrote: > theraven wrote: > > DHowett-MSFT wrote: > > > While we're here, is there value in storing the ivar size in layout as > > > well, so that the runtime doesn't need to calculate it from the distance > > > to the next ivar/end of the instance? > > Normally the runtime calculates it from the type encoding, if it's > > required. I agree that it might be nice to have though. Do you have > > strong feelings about needing it in the 2.0 ABI? The looser coupling means > > that it would be easy to add in the 2.1 ABI if we want it later. Are you > > seeing cases where the runtime is calculating it incorrectly because of > > insufficient information in the type encoding, or where calculating it is > > causing performance problems? > The distance between ivar offsets wouldn't be correct anyway because of > alignment padding. A set-ivar function might be able to get away with > copying too many bytes from an input buffer (although I wouldn't recommend > it!), but a get-ivar function definitely should not copy too many bytes into > an output buffer. > > And all that's assuming that the runtime promises not to reorder ivars > dynamically. I don't know what the GNU runtime says about that. (Static > reordering is fine, since the runtime can reasonably demand that the compiler > emit ivars in layout order.) The runtime was calculating the size from the type encoding (which can also be wrong in a few cases, such as packed structures). I agree it makes sense to add the size though, and have done.. Comment at: lib/CodeGen/CGObjCGNU.cpp:1172 +if (isWeak) { + // Placeholder for the real symbol. + ClassSymbol->setInitializer(new llvm::GlobalVariable(TheModule, rjmccall wrote: > I would suggest clarifying in what sense this is a placeholder. Does the > runtime recognize it specially? If so, how? Is it replaced statically by a > later pass in IRGen? This comment was inherited from the old version and is actually nonsense now. I have replaced it with one that actually makes sense. Repository: rC Clang https://reviews.llvm.org/D46052 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D44931: [WebAssembly] Use Windows EH instructions for Wasm EH
majnemer added inline comments. Comment at: lib/CodeGen/CGException.cpp:1173 +cast(CatchStartBlock->getFirstNonPHI()); +CurrentFuncletPad = CPI; + } aheejin wrote: > majnemer wrote: > > Hmm, why is this done? Won't RestoreCurrentFuncletPad undo this? > Isn't `RestoreCurrentFuncletPad` outside of `if > (EHPersonality::get(*this).isWasmPersonality())`? Isn't this supposed to stay > until this function finishes? Ah, true! Nevermind! Comment at: lib/CodeGen/CGException.cpp:1241-1245 +while (llvm::TerminatorInst *TI = RethrowBlock->getTerminator()) { + llvm::BranchInst *BI = cast(TI); + assert(BI->isConditional()); + RethrowBlock = BI->getSuccessor(1); +} aheejin wrote: > aheejin wrote: > > majnemer wrote: > > > This seems pretty fragile, why is this guaranteed to work? Could we > > > maintain a map from CatchSwitchInst to catch-all block? > > The function call sequence here is `CodeGenFunction::ExitCXXTryStmt` -> > > `emitCatchDispatchBlock` (static) -> `emitWasmCatchDispatchBlock` (static) > > and `emitCatchDispatchBlock` also has other callers, so it is a little > > cumbersome to pass a map to those functions to be filled in. (We have to > > make a parameter that's only gonna be used for wasm to both > > `emitCatchDispatchBlock` and `emitWasmCatchDispatchBlock`) > > > > The other way is also change those static `emit` functions into > > `CodeGenFunction` class's member functions and make the map as a member > > variable. > > > > But first, in which case do you think this will be fragile? > > `emitWasmCatchDispatchBlock` follows the structure of the landingpad model, > > so for a C++ code like this > > ``` > > try { > > ... > > } catch (int) { > > ... > > } catch (float) { > > ... > > } > > ``` > > the BB structure that starts from wasm's `catch.start` block will look like > > ``` > > catch.dispatch: ; preds = %entry > > %0 = catchswitch within none [label %catch.start] unwind to caller > > > > catch.start: ; preds = %catch.dispatch > > %1 = catchpad within %0 [i8* bitcast (i8** @_ZTIi to i8*), i8* bitcast > > (i8** @_ZTIf to i8*)] > > %2 = call i8* @llvm.wasm.get.exception() > > %3 = call i32 @llvm.wasm.get.ehselector() > > %4 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)) #2 > > %matches = icmp eq i32 %3, %4 > > br i1 %matches, label %catch12, label %catch.fallthrough > > > > catch12: ; preds = %catch.start > > body of catch (int) > > > > catch.fallthrough:; preds = %catch.start > > %8 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIf to i8*)) #2 > > %matches1 = icmp eq i32 %3, %8 > > br i1 %matches1, label %catch, label %rethrow > > > > catch:; preds = > > %catch.fallthrough > > body of catch (float) > > > > rethrow: ; preds = > > %catch.fallthrough > > call void @__cxa_rethrow() #5 [ "funclet"(token %1) ] > > unreachable > > ``` > > > > So to me it looks like, no matter how the bodies of `catch (int)` or `catch > > (float)` are complicated, there should always be blocks like `catch.start` > > and `catch.fallthrough`, which compares typeids and divide control flow > > depending on the typeid comparison. I could very well be mistaken, so > > please let me know if so. > Oh and the `RethrowBlock` in the code is not the same as the `catch_all` > block... cleanuppads will be `catch_all` blocks in wasm, and catchpads will > be `catch `. That `RethrowBlock` belongs to `catch ` block, and is > entered when the current exception caught is a C++ exception but does not > match any of the catch clauses, so it can be rethrown to the enclosing scope. I guess I'm worried that we could have emitted statements inside the catch(int) and catch(float) blocks and we'd either run into a terminator which isn't a BranchInst. If we could not emit any statements yet, then I think this is OK... Repository: rC Clang https://reviews.llvm.org/D44931 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D44607: Recompute invalidated iterator in insertTargetAndModeArgs
raj.khem added a comment. Can this be backported to release_60 branch too please ? Repository: rL LLVM https://reviews.llvm.org/D44607 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r332821 - Sema: diagnose invalid catch parameter in ObjC
Author: compnerd Date: Sun May 20 12:26:44 2018 New Revision: 332821 URL: http://llvm.org/viewvc/llvm-project?rev=332821&view=rev Log: Sema: diagnose invalid catch parameter in ObjC Ensure that the type being used has an associated interface when declaring the parameter for `@catch`. Resolves PR37384! Added: cfe/trunk/test/SemaObjC/catch-invalid.m Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=332821&r1=332820&r2=332821&view=diff == --- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original) +++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Sun May 20 12:26:44 2018 @@ -4838,12 +4838,17 @@ VarDecl *Sema::BuildObjCExceptionDecl(Ty // Don't do any further checking. } else if (T->isDependentType()) { // Okay: we don't know what this type will instantiate to. - } else if (!T->isObjCObjectPointerType()) { -Invalid = true; -Diag(IdLoc ,diag::err_catch_param_not_objc_type); } else if (T->isObjCQualifiedIdType()) { Invalid = true; Diag(IdLoc, diag::err_illegal_qualifiers_on_catch_parm); + } else if (T->isObjCIdType()) { +// Okay: we don't know what this type will instantiate to. + } else if (!T->isObjCObjectPointerType()) { +Invalid = true; +Diag(IdLoc, diag::err_catch_param_not_objc_type); + } else if (!T->getAs()->getInterfaceType()) { +Invalid = true; +Diag(IdLoc, diag::err_catch_param_not_objc_type); } VarDecl *New = VarDecl::Create(Context, CurContext, StartLoc, IdLoc, Id, Added: cfe/trunk/test/SemaObjC/catch-invalid.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/catch-invalid.m?rev=332821&view=auto == --- cfe/trunk/test/SemaObjC/catch-invalid.m (added) +++ cfe/trunk/test/SemaObjC/catch-invalid.m Sun May 20 12:26:44 2018 @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -triple thumbv7-unknown-windows-msvc -fobjc-exceptions -fobjc-runtime=ios -verify %s + +extern void g(void); +void f() { + @try { +g(); + } @catch (Class c) { // expected-error{{@catch parameter is not a pointer to an interface type}} + } +} ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D47122: [clang-tidy] SimplifyBoolenExpr doesn't add parens if unary negotiation is of ExprWithCleanups type
zinovy.nis created this revision. zinovy.nis added reviewers: alexfh, aaron.ballman. zinovy.nis added a project: clang-tools-extra. Herald added subscribers: cfe-commits, xazax.hun. using A = std::string; bool foo(A &s) { A S; if (GetValue(s) && S != (A)s) return false; return true; } is fixed into (w/o this patch) ... return !GetValue(s) && S != (A)s; // negotiation affects first operand only } instead of (with this patch) ... return !(GetValue(s) && S != (A)s); // note parens for the whole expression } Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47122 Files: clang-tidy/readability/SimplifyBooleanExprCheck.cpp test/clang-tidy/readability-simplify-bool-expr.cpp Index: test/clang-tidy/readability-simplify-bool-expr.cpp === --- test/clang-tidy/readability-simplify-bool-expr.cpp +++ test/clang-tidy/readability-simplify-bool-expr.cpp @@ -938,3 +938,15 @@ } // CHECK-MESSAGES: :[[@LINE-5]]:12: warning: {{.*}} in conditional return // CHECK-FIXES: return p->m != 0;{{$}} + +bool operator!=(const A&, const A&) { return false; } +extern bool GetValue(A s); +bool expr_with_cleanups(A &s) { + A S; + if (GetValue(s) && S != (A)s) +return false; + + return true; +} +// CHECK-MESSAGES: :[[@LINE-4]]:12: warning: {{.*}} in conditional return +// CHECK-FIXES: !(GetValue(s) && S != (A)s);{{$}} Index: clang-tidy/readability/SimplifyBooleanExprCheck.cpp === --- clang-tidy/readability/SimplifyBooleanExprCheck.cpp +++ clang-tidy/readability/SimplifyBooleanExprCheck.cpp @@ -75,6 +75,8 @@ bool needsParensAfterUnaryNegation(const Expr *E) { E = E->IgnoreImpCasts(); + if (auto *EC = dyn_cast(E)) +E = EC->getSubExpr(); if (isa(E) || isa(E)) return true; Index: test/clang-tidy/readability-simplify-bool-expr.cpp === --- test/clang-tidy/readability-simplify-bool-expr.cpp +++ test/clang-tidy/readability-simplify-bool-expr.cpp @@ -938,3 +938,15 @@ } // CHECK-MESSAGES: :[[@LINE-5]]:12: warning: {{.*}} in conditional return // CHECK-FIXES: return p->m != 0;{{$}} + +bool operator!=(const A&, const A&) { return false; } +extern bool GetValue(A s); +bool expr_with_cleanups(A &s) { + A S; + if (GetValue(s) && S != (A)s) +return false; + + return true; +} +// CHECK-MESSAGES: :[[@LINE-4]]:12: warning: {{.*}} in conditional return +// CHECK-FIXES: !(GetValue(s) && S != (A)s);{{$}} Index: clang-tidy/readability/SimplifyBooleanExprCheck.cpp === --- clang-tidy/readability/SimplifyBooleanExprCheck.cpp +++ clang-tidy/readability/SimplifyBooleanExprCheck.cpp @@ -75,6 +75,8 @@ bool needsParensAfterUnaryNegation(const Expr *E) { E = E->IgnoreImpCasts(); + if (auto *EC = dyn_cast(E)) +E = EC->getSubExpr(); if (isa(E) || isa(E)) return true; ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D46910: [Support] Avoid normalization in sys::getDefaultTargetTriple
thakis added a comment. This changes the default triple on Windows from x86_64-pc-win32 to x86_64-pc-windows-msvc. This breaks at least Repository: rC Clang https://reviews.llvm.org/D46910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D46910: [Support] Avoid normalization in sys::getDefaultTargetTriple
thakis added a comment. (sorry, hit cmd-return accidentally, I will come in again…) Repository: rC Clang https://reviews.llvm.org/D46910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D46910: [Support] Avoid normalization in sys::getDefaultTargetTriple
thakis added a comment. This changes the default triple on Windows from x86_64-pc-win32 to x86_64-pc-windows-msvc. This breaks at least lit's make_itanium_abi_triple() (http://llvm-cs.pcc.me.uk/utils/lit/lit/llvm/config.py#234) def make_itanium_abi_triple(self, triple): m = re.match(r'(\w+)-(\w+)-(\w+)', triple) if not m: self.lit_config.fatal( "Could not turn '%s' into Itanium ABI triple" % triple) if m.group(3).lower() != 'win32': # All non-win32 triples use the Itanium ABI. return triple return m.group(1) + '-' + m.group(2) + '-mingw32' which in turn breaks %itanium_abi_triple in lit tests, which then breaks some 257 tests on Windows. (Also visible on http://lab.llvm.org:8011/builders/clang-x64-ninja-win7 , but that bot has been broken for a long time.) So I'll revert this for now. Repository: rC Clang https://reviews.llvm.org/D46910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D46910: [Support] Avoid normalization in sys::getDefaultTargetTriple
thakis added a comment. …hm looks like https://reviews.llvm.org/rL332750 touched files in both clang and llvm, which is probably why the diff looks super confusing on phab. I'll revert it in two pieces, I don't know how to commit changes to llvm and clang in one revision. Repository: rC Clang https://reviews.llvm.org/D46910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r332822 - Revert 332750, clang part (see comment on D46910).
Author: nico Date: Sun May 20 16:02:20 2018 New Revision: 332822 URL: http://llvm.org/viewvc/llvm-project?rev=332822&view=rev Log: Revert 332750, clang part (see comment on D46910). Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=332822&r1=332821&r2=332822&view=diff == --- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original) +++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Sun May 20 16:02:20 2018 @@ -2927,11 +2927,10 @@ static void ParseTargetArgs(TargetOption Opts.FPMath = Args.getLastArgValue(OPT_mfpmath); Opts.FeaturesAsWritten = Args.getAllArgValues(OPT_target_feature); Opts.LinkerVersion = Args.getLastArgValue(OPT_target_linker_version); - Opts.Triple = Args.getLastArgValue(OPT_triple); + Opts.Triple = llvm::Triple::normalize(Args.getLastArgValue(OPT_triple)); // Use the default target triple if unspecified. if (Opts.Triple.empty()) Opts.Triple = llvm::sys::getDefaultTargetTriple(); - Opts.Triple = llvm::Triple::normalize(Opts.Triple); Opts.OpenCLExtensionsAsWritten = Args.getAllArgValues(OPT_cl_ext_EQ); Opts.ForceEnableInt128 = Args.hasArg(OPT_fforce_enable_int128); Opts.NVPTXUseShortPointers = Args.hasFlag( ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D46910: [Support] Avoid normalization in sys::getDefaultTargetTriple
thakis added a comment. Reverted in r332822 / r332823. Repository: rC Clang https://reviews.llvm.org/D46910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r332825 - [X86] Remove mask arguments from permvar builtins/intrinsics. Use a select in IR instead.
Author: ctopper Date: Sun May 20 16:34:10 2018 New Revision: 332825 URL: http://llvm.org/viewvc/llvm-project?rev=332825&view=rev Log: [X86] Remove mask arguments from permvar builtins/intrinsics. Use a select in IR instead. Someday maybe we'll use selects for all the builtins. Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def cfe/trunk/lib/Headers/avx512bwintrin.h cfe/trunk/lib/Headers/avx512fintrin.h cfe/trunk/lib/Headers/avx512vbmiintrin.h cfe/trunk/lib/Headers/avx512vbmivlintrin.h cfe/trunk/lib/Headers/avx512vlbwintrin.h cfe/trunk/lib/Headers/avx512vlintrin.h cfe/trunk/test/CodeGen/avx512bw-builtins.c cfe/trunk/test/CodeGen/avx512f-builtins.c cfe/trunk/test/CodeGen/avx512vbmi-builtins.c cfe/trunk/test/CodeGen/avx512vbmivl-builtin.c cfe/trunk/test/CodeGen/avx512vl-builtins.c cfe/trunk/test/CodeGen/avx512vlbw-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=332825&r1=332824&r2=332825&view=diff == --- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original) +++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Sun May 20 16:34:10 2018 @@ -1766,18 +1766,18 @@ TARGET_BUILTIN(__builtin_ia32_vfmsubsd3_ TARGET_BUILTIN(__builtin_ia32_vfmsubss3_mask3, "V4fV4fV4fV4fUcIi", "nc", "avx512f") TARGET_BUILTIN(__builtin_ia32_vfnmsubsd3_mask3, "V2dV2dV2dV2dUcIi", "nc", "avx512f") TARGET_BUILTIN(__builtin_ia32_vfnmsubss3_mask3, "V4fV4fV4fV4fUcIi", "nc", "avx512f") -TARGET_BUILTIN(__builtin_ia32_permvarhi512_mask, "V32sV32sV32sV32sUi", "nc", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_permvardf512_mask, "V8dV8dV8LLiV8dUc", "nc", "avx512f") -TARGET_BUILTIN(__builtin_ia32_permvardi512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "nc", "avx512f") -TARGET_BUILTIN(__builtin_ia32_permvarsf512_mask, "V16fV16fV16iV16fUs", "nc", "avx512f") -TARGET_BUILTIN(__builtin_ia32_permvarsi512_mask, "V16iV16iV16iV16iUs", "nc", "avx512f") -TARGET_BUILTIN(__builtin_ia32_permvarqi512_mask, "V64cV64cV64cV64cULLi", "nc", "avx512vbmi") -TARGET_BUILTIN(__builtin_ia32_permvarqi128_mask, "V16cV16cV16cV16cUs", "nc", "avx512vbmi,avx512vl") -TARGET_BUILTIN(__builtin_ia32_permvarqi256_mask, "V32cV32cV32cV32cUi", "nc", "avx512vbmi,avx512vl") -TARGET_BUILTIN(__builtin_ia32_permvarhi128_mask, "V8sV8sV8sV8sUc", "nc", "avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_permvarhi256_mask, "V16sV16sV16sV16sUs", "nc", "avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_permvardf256_mask, "V4dV4dV4LLiV4dUc", "nc", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_permvardi256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "nc", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_permvarhi512, "V32sV32sV32s", "nc", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_permvardf512, "V8dV8dV8LLi", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_permvardi512, "V8LLiV8LLiV8LLi", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_permvarsf512, "V16fV16fV16i", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_permvarsi512, "V16iV16iV16i", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_permvarqi512, "V64cV64cV64c", "nc", "avx512vbmi") +TARGET_BUILTIN(__builtin_ia32_permvarqi128, "V16cV16cV16c", "nc", "avx512vbmi,avx512vl") +TARGET_BUILTIN(__builtin_ia32_permvarqi256, "V32cV32cV32c", "nc", "avx512vbmi,avx512vl") +TARGET_BUILTIN(__builtin_ia32_permvarhi128, "V8sV8sV8s", "nc", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_permvarhi256, "V16sV16sV16s", "nc", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_permvardf256, "V4dV4dV4LLi", "nc", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_permvardi256, "V4LLiV4LLiV4LLi", "nc", "avx512vl") TARGET_BUILTIN(__builtin_ia32_fpclasspd128_mask, "UcV2dIiUc", "nc", "avx512dq,avx512vl") TARGET_BUILTIN(__builtin_ia32_fpclasspd256_mask, "UcV4dIiUc", "nc", "avx512dq,avx512vl") TARGET_BUILTIN(__builtin_ia32_fpclassps128_mask, "UcV4fIiUc", "nc", "avx512dq,avx512vl") Modified: cfe/trunk/lib/Headers/avx512bwintrin.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512bwintrin.h?rev=332825&r1=332824&r2=332825&view=diff == --- cfe/trunk/lib/Headers/avx512bwintrin.h (original) +++ cfe/trunk/lib/Headers/avx512bwintrin.h Sun May 20 16:34:10 2018 @@ -2034,30 +2034,25 @@ _mm512_maskz_broadcastw_epi16 (__mmask32 static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_permutexvar_epi16 (__m512i __A, __m512i __B) { - return (__m512i) __builtin_ia32_permvarhi512_mask ((__v32hi) __B, - (__v32hi) __A, - (__v32hi) _mm512_undefined_epi32 (), - (__mmask32) -1); + return (__m512i)__builtin_ia32_permvarhi512((__v32hi)__B, (__v32hi)__A); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_permutexvar_epi16 (__mmask32 __M, __m512i __A, __m512i __B) { - return (__m512i) __builtin_ia32_p
[PATCH] D46910: [Support] Avoid normalization in sys::getDefaultTargetTriple
phosek added a comment. In https://reviews.llvm.org/D46910#1105992, @thakis wrote: > This changes the default triple on Windows from x86_64-pc-win32 to > x86_64-pc-windows-msvc. This breaks at least lit's make_itanium_abi_triple() > (http://llvm-cs.pcc.me.uk/utils/lit/lit/llvm/config.py#234) > > def make_itanium_abi_triple(self, triple): > m = re.match(r'(\w+)-(\w+)-(\w+)', triple) > if not m: > self.lit_config.fatal( > "Could not turn '%s' into Itanium ABI triple" % triple) > if m.group(3).lower() != 'win32': > # All non-win32 triples use the Itanium ABI. > return triple > return m.group(1) + '-' + m.group(2) + '-mingw32' > > > which in turn breaks %itanium_abi_triple in lit tests, which then breaks some > 257 tests on Windows. > > (Also visible on http://lab.llvm.org:8011/builders/clang-x64-ninja-win7 , but > that bot has been broken for a long time.) > > So I'll revert this for now. Sorry about the breakage, I wasn't aware of that test failure and never got any email (probably because the bot has been red before). I'll try to fix make_itanium_abi_triple and test it on my Windows box tomorrow before resubmitting. In https://reviews.llvm.org/D46910#1105993, @thakis wrote: > …hm looks like https://reviews.llvm.org/rL332750 touched files in both clang > and llvm, which is probably why the diff looks super confusing on phab. I'll > revert it in two pieces, I don't know how to commit changes to llvm and clang > in one revision. The change was made through monorepo and submitted via `git llvm push` which allows changing multiple projects in one commit. Repository: rC Clang https://reviews.llvm.org/D46910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D47070: [CUDA] Upgrade linked bitcode to enable inlining
echristo added a comment. In https://reviews.llvm.org/D47070#1105533, @Hahnfeld wrote: > Looks like this was added as a "temporary solution" in > https://reviews.llvm.org/D8984. Meanwhile the attribute whitelist was merged > half a year later (https://reviews.llvm.org/D7802), so maybe we can just get > rid of comparing `target-cpu` and `target-features` entirely? You don't want to get rid of the comparison because you might have specific code that can't be inlined from one into another. In https://reviews.llvm.org/D47070#1104846, @tra wrote: > This was not intended. :-( I was unaware that GetCPUAndFeaturesAttributes() > would add any feature that looks like a valid CPU name to the target-cpu > attribute. > All I needed is to make builtins available or not. Setting them as function > attributes is not what we need here. > > I'm not sure what's the best way to deal with this. On one hand I do need to > make some builtins available depending on combination of GPU arch and PTX > version. The only way to do it is via the features. On the other hand, the > features appear to propagate to LLVM IR, which is something I don't need or > want. > > One way would be to introduce some sort of feature blacklist which would > prevent them from being converted to function attributes. > Or, perhaps, we can change TARGET_BUILTIN or create something similar which > would allow availability of builtins w/o relying on features. > > As a short-term fix we can disable feature-to-function attribute propagation > for NVPTX until we fix it. > > @echristo -- any other suggestions? This is some of what I was talking about when I was mentioning how function attributes and the targets work. Ideally you'll have a compatible set of features and it won't really cause an issue. The idea is that if you're compiling for a minimum ptx feature of X, then any "compatible" set of ptx should be able to inline into your code. I think you do want the features to propagate in general, just specific use cases may not care one way or another - that said, for those use cases you're probably just compiling everything with the same feature anyhow. I guess, ultimately, I'm not seeing what the concern here is for how features are working or not working for the target so it's harder to help. What is the problem you're running into, or can you try a different way of explaining it to me? :) Repository: rC Clang https://reviews.llvm.org/D47070 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D45783: [DEBUGINFO, NVPTX] Render `-no-cuda-debug` LLVM option when required.
echristo added a comment. So, I'd really prefer not to set options via the backend option path. From here I think we should aim to take all of the options we added and having the asm printer in the backend know how to set them depending on the target. We could also add things to the IR metadata if necessary, but I'd like to avoid that if possible. Thoughts? Repository: rC Clang https://reviews.llvm.org/D45783 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D47029: [X86] Remove some preprocessor feature checks from intrinsic headers
echristo accepted this revision. echristo added a comment. This revision is now accepted and ready to land. LGTM. -eric https://reviews.llvm.org/D47029 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D46791: Make -gsplit-dwarf generally available
echristo added subscribers: pcc, paulsemel. echristo added a comment. FWIW Peter has some patches to move object emission away from objcopy that I'm on the hook to review here shortly so the objcopy part of this should become unnecessary and can just have us able to emit dwarf5 compatible split dwarf on any platform. -eric https://reviews.llvm.org/D46791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D44931: [WebAssembly] Use Windows EH instructions for Wasm EH
aheejin added inline comments. Comment at: lib/CodeGen/CGException.cpp:1241-1245 +while (llvm::TerminatorInst *TI = RethrowBlock->getTerminator()) { + llvm::BranchInst *BI = cast(TI); + assert(BI->isConditional()); + RethrowBlock = BI->getSuccessor(1); +} majnemer wrote: > aheejin wrote: > > aheejin wrote: > > > majnemer wrote: > > > > This seems pretty fragile, why is this guaranteed to work? Could we > > > > maintain a map from CatchSwitchInst to catch-all block? > > > The function call sequence here is `CodeGenFunction::ExitCXXTryStmt` -> > > > `emitCatchDispatchBlock` (static) -> `emitWasmCatchDispatchBlock` > > > (static) and `emitCatchDispatchBlock` also has other callers, so it is a > > > little cumbersome to pass a map to those functions to be filled in. (We > > > have to make a parameter that's only gonna be used for wasm to both > > > `emitCatchDispatchBlock` and `emitWasmCatchDispatchBlock`) > > > > > > The other way is also change those static `emit` functions into > > > `CodeGenFunction` class's member functions and make the map as a member > > > variable. > > > > > > But first, in which case do you think this will be fragile? > > > `emitWasmCatchDispatchBlock` follows the structure of the landingpad > > > model, so for a C++ code like this > > > ``` > > > try { > > > ... > > > } catch (int) { > > > ... > > > } catch (float) { > > > ... > > > } > > > ``` > > > the BB structure that starts from wasm's `catch.start` block will look > > > like > > > ``` > > > catch.dispatch: ; preds = %entry > > > %0 = catchswitch within none [label %catch.start] unwind to caller > > > > > > catch.start: ; preds = > > > %catch.dispatch > > > %1 = catchpad within %0 [i8* bitcast (i8** @_ZTIi to i8*), i8* bitcast > > > (i8** @_ZTIf to i8*)] > > > %2 = call i8* @llvm.wasm.get.exception() > > > %3 = call i32 @llvm.wasm.get.ehselector() > > > %4 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)) #2 > > > %matches = icmp eq i32 %3, %4 > > > br i1 %matches, label %catch12, label %catch.fallthrough > > > > > > catch12: ; preds = %catch.start > > > body of catch (int) > > > > > > catch.fallthrough:; preds = %catch.start > > > %8 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIf to i8*)) #2 > > > %matches1 = icmp eq i32 %3, %8 > > > br i1 %matches1, label %catch, label %rethrow > > > > > > catch:; preds = > > > %catch.fallthrough > > > body of catch (float) > > > > > > rethrow: ; preds = > > > %catch.fallthrough > > > call void @__cxa_rethrow() #5 [ "funclet"(token %1) ] > > > unreachable > > > ``` > > > > > > So to me it looks like, no matter how the bodies of `catch (int)` or > > > `catch (float)` are complicated, there should always be blocks like > > > `catch.start` and `catch.fallthrough`, which compares typeids and divide > > > control flow depending on the typeid comparison. I could very well be > > > mistaken, so please let me know if so. > > Oh and the `RethrowBlock` in the code is not the same as the `catch_all` > > block... cleanuppads will be `catch_all` blocks in wasm, and catchpads will > > be `catch `. That `RethrowBlock` belongs to `catch ` block, and > > is entered when the current exception caught is a C++ exception but does > > not match any of the catch clauses, so it can be rethrown to the enclosing > > scope. > I guess I'm worried that we could have emitted statements inside the > catch(int) and catch(float) blocks and we'd either run into a terminator > which isn't a BranchInst. > If we could not emit any statements yet, then I think this is OK... Actually it's after we emit all catch handlers, but I think this routine is not gonna touch the contents of those handlers. So it's like ``` Start --> int? (N) --> float? (N) --> rethrow (Y) (Y) handler handler ``` So however much control flow each handler contains, if we follow only (N)s, we will end up in the rethrow block. Repository: rC Clang https://reviews.llvm.org/D44931 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D44607: Recompute invalidated iterator in insertTargetAndModeArgs
sepavloff added a comment. In https://reviews.llvm.org/D44607#1105962, @raj.khem wrote: > Can this be backported to release_60 branch too please ? The patch is compact, clear and addresses stability issue. I think it is worth of backporting to release_60. Repository: rL LLVM https://reviews.llvm.org/D44607 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r332829 - [X86] Remove some unused builtins.
Author: ctopper Date: Sun May 20 20:36:57 2018 New Revision: 332829 URL: http://llvm.org/viewvc/llvm-project?rev=332829&view=rev Log: [X86] Remove some unused builtins. These were upgraded to native shufflevectors months ago. Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def cfe/trunk/lib/Sema/SemaChecking.cpp Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=332829&r1=332828&r2=332829&view=diff == --- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original) +++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Sun May 20 20:36:57 2018 @@ -1616,14 +1616,6 @@ TARGET_BUILTIN(__builtin_ia32_pternlogq1 TARGET_BUILTIN(__builtin_ia32_pternlogq128_maskz, "V2LLiV2LLiV2LLiV2LLiIiUc", "nc", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pternlogq256_mask, "V4LLiV4LLiV4LLiV4LLiIiUc", "nc", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pternlogq256_maskz, "V4LLiV4LLiV4LLiV4LLiIiUc", "nc", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_shuf_f32x4_mask, "V16fV16fV16fIiV16fUs", "nc", "avx512f") -TARGET_BUILTIN(__builtin_ia32_shuf_f64x2_mask, "V8dV8dV8dIiV8dUc", "nc", "avx512f") -TARGET_BUILTIN(__builtin_ia32_shuf_i32x4_mask, "V16iV16iV16iIiV16iUs", "nc", "avx512f") -TARGET_BUILTIN(__builtin_ia32_shuf_i64x2_mask, "V8LLiV8LLiV8LLiIiV8LLiUc", "nc", "avx512f") -TARGET_BUILTIN(__builtin_ia32_shuf_f32x4_256_mask, "V8fV8fV8fIiV8fUc", "nc", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_shuf_f64x2_256_mask, "V4dV4dV4dIiV4dUc", "nc", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_shuf_i32x4_256_mask, "V8iV8iV8iIiV8iUc", "nc", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_shuf_i64x2_256_mask, "V4LLiV4LLiV4LLiIiV4LLiUc", "nc", "avx512vl") TARGET_BUILTIN(__builtin_ia32_sqrtsd_round_mask, "V2dV2dV2dV2dUcIi", "nc", "avx512f") TARGET_BUILTIN(__builtin_ia32_sqrtss_round_mask, "V4fV4fV4fV4fUcIi", "nc", "avx512f") TARGET_BUILTIN(__builtin_ia32_rsqrt14pd128_mask, "V2dV2dV2dUc", "nc", "avx512vl") Modified: cfe/trunk/lib/Sema/SemaChecking.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=332829&r1=332828&r2=332829&view=diff == --- cfe/trunk/lib/Sema/SemaChecking.cpp (original) +++ cfe/trunk/lib/Sema/SemaChecking.cpp Sun May 20 20:36:57 2018 @@ -2574,10 +2574,6 @@ bool Sema::CheckX86BuiltinFunctionCall(u i = 1; l = 0; u = 7; break; case X86::BI__builtin_ia32_sha1rnds4: - case X86::BI__builtin_ia32_shuf_f32x4_256_mask: - case X86::BI__builtin_ia32_shuf_f64x2_256_mask: - case X86::BI__builtin_ia32_shuf_i32x4_256_mask: - case X86::BI__builtin_ia32_shuf_i64x2_256_mask: i = 2; l = 0; u = 3; break; case X86::BI__builtin_ia32_vpermil2pd: @@ -2696,10 +2692,6 @@ bool Sema::CheckX86BuiltinFunctionCall(u case X86::BI__builtin_ia32_palignr512_mask: case X86::BI__builtin_ia32_vcomisd: case X86::BI__builtin_ia32_vcomiss: - case X86::BI__builtin_ia32_shuf_f32x4_mask: - case X86::BI__builtin_ia32_shuf_f64x2_mask: - case X86::BI__builtin_ia32_shuf_i32x4_mask: - case X86::BI__builtin_ia32_shuf_i64x2_mask: case X86::BI__builtin_ia32_dbpsadbw128_mask: case X86::BI__builtin_ia32_dbpsadbw256_mask: case X86::BI__builtin_ia32_dbpsadbw512_mask: ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D47050: MC: Change the streamer ctors to take an object writer instead of a stream. NFCI.
echristo added a comment. LGTM. Repository: rC Clang https://reviews.llvm.org/D47050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D46230: For x86_64, gcc 7.2 under Amazon Linux AMI sets its paths to x86_64-amazon-linux
echristo added a comment. Well, that's ridiculous. We should really fix this a better way in the future. That said, would you add a testcase for this please so we don't regress if we fix it? :) -eric Repository: rC Clang https://reviews.llvm.org/D46230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D46052: GNUstep Objective-C ABI version 2
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. Thanks, my comments seem to all be addressed. Repository: rC Clang https://reviews.llvm.org/D46052 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D47125: [X86] Remove masking from pternlog llvm intrinsics and use a select instruction instead.
craig.topper created this revision. craig.topper added reviewers: RKSimon, spatel, GBuella. Because the intrinsics in the headers are implemented as macros, we can't just use a select builtin and pternlog builtin. This would require one of the macro arguments to be used twice. Depending on what was passed to the macro we could expand an expression twice leading to weird behavior. We could maybe declare our local variable in the macro, but that would need to worry about name collisions. To avoid that just generate IR directly in CGBuiltin.cpp. Repository: rC Clang https://reviews.llvm.org/D47125 Files: lib/CodeGen/CGBuiltin.cpp test/CodeGen/avx512f-builtins.c test/CodeGen/avx512vl-builtins.c Index: test/CodeGen/avx512vl-builtins.c === --- test/CodeGen/avx512vl-builtins.c +++ test/CodeGen/avx512vl-builtins.c @@ -5604,73 +5604,81 @@ __m128i test_mm_ternarylogic_epi32(__m128i __A, __m128i __B, __m128i __C) { // CHECK-LABEL: @test_mm_ternarylogic_epi32 - // CHECK: @llvm.x86.avx512.mask.pternlog.d.128 + // CHECK: @llvm.x86.avx512.pternlog.d.128 return _mm_ternarylogic_epi32(__A, __B, __C, 4); } __m128i test_mm_mask_ternarylogic_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) { // CHECK-LABEL: @test_mm_mask_ternarylogic_epi32 - // CHECK: @llvm.x86.avx512.mask.pternlog.d.128 + // CHECK: @llvm.x86.avx512.pternlog.d.128 + // CHECK: select <4 x i1> %{{.*}}, <4 x i32> %{{.*}}, <4 x i32> %{{.*}} return _mm_mask_ternarylogic_epi32(__A, __U, __B, __C, 4); } __m128i test_mm_maskz_ternarylogic_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C) { // CHECK-LABEL: @test_mm_maskz_ternarylogic_epi32 - // CHECK: @llvm.x86.avx512.maskz.pternlog.d.128 + // CHECK: @llvm.x86.avx512.pternlog.d.128 + // CHECK: select <4 x i1> %{{.*}}, <4 x i32> %{{.*}}, <4 x i32> zeroinitializer return _mm_maskz_ternarylogic_epi32(__U, __A, __B, __C, 4); } __m256i test_mm256_ternarylogic_epi32(__m256i __A, __m256i __B, __m256i __C) { // CHECK-LABEL: @test_mm256_ternarylogic_epi32 - // CHECK: @llvm.x86.avx512.mask.pternlog.d.256 + // CHECK: @llvm.x86.avx512.pternlog.d.256 return _mm256_ternarylogic_epi32(__A, __B, __C, 4); } __m256i test_mm256_mask_ternarylogic_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) { // CHECK-LABEL: @test_mm256_mask_ternarylogic_epi32 - // CHECK: @llvm.x86.avx512.mask.pternlog.d.256 + // CHECK: @llvm.x86.avx512.pternlog.d.256 + // CHECK: select <8 x i1> %{{.*}}, <8 x i32> %{{.*}}, <8 x i32> %{{.*}} return _mm256_mask_ternarylogic_epi32(__A, __U, __B, __C, 4); } __m256i test_mm256_maskz_ternarylogic_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C) { // CHECK-LABEL: @test_mm256_maskz_ternarylogic_epi32 - // CHECK: @llvm.x86.avx512.maskz.pternlog.d.256 + // CHECK: @llvm.x86.avx512.pternlog.d.256 + // CHECK: select <8 x i1> %{{.*}}, <8 x i32> %{{.*}}, <8 x i32> zeroinitializer return _mm256_maskz_ternarylogic_epi32(__U, __A, __B, __C, 4); } __m128i test_mm_ternarylogic_epi64(__m128i __A, __m128i __B, __m128i __C) { // CHECK-LABEL: @test_mm_ternarylogic_epi64 - // CHECK: @llvm.x86.avx512.mask.pternlog.q.128 + // CHECK: @llvm.x86.avx512.pternlog.q.128 return _mm_ternarylogic_epi64(__A, __B, __C, 4); } __m128i test_mm_mask_ternarylogic_epi64(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) { // CHECK-LABEL: @test_mm_mask_ternarylogic_epi64 - // CHECK: @llvm.x86.avx512.mask.pternlog.q.128 + // CHECK: @llvm.x86.avx512.pternlog.q.128 + // CHECK: select <2 x i1> %{{.*}}, <2 x i64> %{{.*}}, <2 x i64> %{{.*}} return _mm_mask_ternarylogic_epi64(__A, __U, __B, __C, 4); } __m128i test_mm_maskz_ternarylogic_epi64(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C) { // CHECK-LABEL: @test_mm_maskz_ternarylogic_epi64 - // CHECK: @llvm.x86.avx512.maskz.pternlog.q.128 + // CHECK: @llvm.x86.avx512.pternlog.q.128 + // CHECK: select <2 x i1> %{{.*}}, <2 x i64> %{{.*}}, <2 x i64> zeroinitializer return _mm_maskz_ternarylogic_epi64(__U, __A, __B, __C, 4); } __m256i test_mm256_ternarylogic_epi64(__m256i __A, __m256i __B, __m256i __C) { // CHECK-LABEL: @test_mm256_ternarylogic_epi64 - // CHECK: @llvm.x86.avx512.mask.pternlog.q.256 + // CHECK: @llvm.x86.avx512.pternlog.q.256 return _mm256_ternarylogic_epi64(__A, __B, __C, 4); } __m256i test_mm256_mask_ternarylogic_epi64(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C) { // CHECK-LABEL: @test_mm256_mask_ternarylogic_epi64 - // CHECK: @llvm.x86.avx512.mask.pternlog.q.256 + // CHECK: @llvm.x86.avx512.pternlog.q.256 + // CHECK: select <4 x i1> %{{.*}}, <4 x i64> %{{.*}}, <4 x i64> %{{.*}} return _mm256_mask_ternarylogic_epi64(__A, __U, __B, __C, 4); } __m256i test_mm256_maskz_ternarylogic_epi64(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C) { // CHECK-LABEL: @test_mm256_maskz_ternarylogic_epi64 - // CHECK: @llvm.x86.a
r332830 - [X86] Remove some preprocessor feature checks from intrinsic headers
Author: ctopper Date: Sun May 20 23:07:49 2018 New Revision: 332830 URL: http://llvm.org/viewvc/llvm-project?rev=332830&view=rev Log: [X86] Remove some preprocessor feature checks from intrinsic headers Summary: These look to be a couple things that weren't removed when we switched to target attribute. The popcnt makes including just smmintrin.h also include popcntintrin.h. The popcnt file itself already contains target attrributes. The prefetch ones are just wrappers around __builtin_prefetch which we have graceful fallbacks for in the backend if the exact instruction isn't available. So there's no reason to hide them. And it makes them available in functions that have the write target attribute but not a -march command line flag. Reviewers: echristo, RKSimon, spatel, DavidKreitzer Reviewed By: echristo Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47029 Modified: cfe/trunk/lib/Headers/prfchwintrin.h cfe/trunk/lib/Headers/smmintrin.h Modified: cfe/trunk/lib/Headers/prfchwintrin.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/prfchwintrin.h?rev=332830&r1=332829&r2=332830&view=diff == --- cfe/trunk/lib/Headers/prfchwintrin.h (original) +++ cfe/trunk/lib/Headers/prfchwintrin.h Sun May 20 23:07:49 2018 @@ -28,7 +28,6 @@ #ifndef __PRFCHWINTRIN_H #define __PRFCHWINTRIN_H -#if defined(__PRFCHW__) || defined(__3dNOW__) /// Loads a memory sequence containing the specified memory address into ///all data cache levels. The cache-coherency state is set to exclusive. ///Data can be read from and written to the cache line without additional @@ -66,6 +65,5 @@ _m_prefetchw(void *__P) { __builtin_prefetch (__P, 1, 3 /* _MM_HINT_T0 */); } -#endif #endif /* __PRFCHWINTRIN_H */ Modified: cfe/trunk/lib/Headers/smmintrin.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/smmintrin.h?rev=332830&r1=332829&r2=332830&view=diff == --- cfe/trunk/lib/Headers/smmintrin.h (original) +++ cfe/trunk/lib/Headers/smmintrin.h Sun May 20 23:07:49 2018 @@ -2458,8 +2458,6 @@ _mm_crc32_u64(unsigned long long __C, un #undef __DEFAULT_FN_ATTRS -#ifdef __POPCNT__ #include -#endif #endif /* __SMMINTRIN_H */ ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D47029: [X86] Remove some preprocessor feature checks from intrinsic headers
This revision was automatically updated to reflect the committed changes. Closed by commit rC332830: [X86] Remove some preprocessor feature checks from intrinsic headers (authored by ctopper, committed by ). Repository: rC Clang https://reviews.llvm.org/D47029 Files: lib/Headers/prfchwintrin.h lib/Headers/smmintrin.h Index: lib/Headers/smmintrin.h === --- lib/Headers/smmintrin.h +++ lib/Headers/smmintrin.h @@ -2458,8 +2458,6 @@ #undef __DEFAULT_FN_ATTRS -#ifdef __POPCNT__ #include -#endif #endif /* __SMMINTRIN_H */ Index: lib/Headers/prfchwintrin.h === --- lib/Headers/prfchwintrin.h +++ lib/Headers/prfchwintrin.h @@ -28,7 +28,6 @@ #ifndef __PRFCHWINTRIN_H #define __PRFCHWINTRIN_H -#if defined(__PRFCHW__) || defined(__3dNOW__) /// Loads a memory sequence containing the specified memory address into ///all data cache levels. The cache-coherency state is set to exclusive. ///Data can be read from and written to the cache line without additional @@ -66,6 +65,5 @@ { __builtin_prefetch (__P, 1, 3 /* _MM_HINT_T0 */); } -#endif #endif /* __PRFCHWINTRIN_H */ Index: lib/Headers/smmintrin.h === --- lib/Headers/smmintrin.h +++ lib/Headers/smmintrin.h @@ -2458,8 +2458,6 @@ #undef __DEFAULT_FN_ATTRS -#ifdef __POPCNT__ #include -#endif #endif /* __SMMINTRIN_H */ Index: lib/Headers/prfchwintrin.h === --- lib/Headers/prfchwintrin.h +++ lib/Headers/prfchwintrin.h @@ -28,7 +28,6 @@ #ifndef __PRFCHWINTRIN_H #define __PRFCHWINTRIN_H -#if defined(__PRFCHW__) || defined(__3dNOW__) /// Loads a memory sequence containing the specified memory address into ///all data cache levels. The cache-coherency state is set to exclusive. ///Data can be read from and written to the cache line without additional @@ -66,6 +65,5 @@ { __builtin_prefetch (__P, 1, 3 /* _MM_HINT_T0 */); } -#endif #endif /* __PRFCHWINTRIN_H */ ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D40988: Clang-format: add finer-grained options for putting all arguments on one line
djasper added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:760 (!Style.AllowAllParametersOfDeclarationOnNextLine && State.Line->MustBeDeclaration) || +(!Style.AllowAllArgumentsOnNextLine && This still looks suspicious to me. State.Line->MustBeDeclaration is either true or false meaning that AllowAllParametersOfDeclarationOnNextLine or AllowAllArgumentsOnNextLine can always affect the behavior here, leading to BreakBeforeParameter to be set to true, even if we are in the case for PreviousIsBreakingCtorInitializerColon being true. So, my guess would be that if you set one of AllowAllArgumentsOnNextLine and AllowAllParametersOfDeclarationOnNextLine to false, then AllowAllConstructorInitializersOnNextLine doesn't have an effect anymore. Please verify, and if this is true, please fix and add tests. I think this might be easier to understand if you pulled the one if statement apart. https://reviews.llvm.org/D40988 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits