[PATCH] D47671: [analyzer] Implement copy elision.
xazax.hun added a comment. Herald added a subscriber: mikhail.ramalho. Just for the record, there is a common example where relying on copy elision might bite and google do not recommend relying on it for correctness: https://abseil.io/tips/120 The main purpose of sharing is to add some more context to the discussion, I do not consider this to be an argument, because I can still see that this practice as opinionated. Repository: rC Clang https://reviews.llvm.org/D47671 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D40443: [Modules TS] Make imports from an interface unit visible to its implementation units
hamzasood updated this revision to Diff 150649. hamzasood added a comment. Addressed Richard's comments. https://reviews.llvm.org/D40443 Files: include/clang/Basic/Module.h lib/Basic/Module.cpp lib/Sema/SemaDecl.cpp test/CXX/modules-ts/basic/basic.def.odr/p6/module-vs-module.cpp test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p1.cpp test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p1/interface-imports.cpp Index: test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p1.cpp === --- test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p1.cpp +++ test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p1.cpp @@ -1,28 +0,0 @@ -// RUN: %clang_cc1 -fmodules-ts %s -verify -o /dev/null -// RUN: %clang_cc1 -fmodules-ts %s -DINTERFACE -verify -emit-module-interface -o %t -// RUN: %clang_cc1 -fmodules-ts %s -DIMPLEMENTATION -verify -fmodule-file=%t -o /dev/null -// -// RUN: %clang_cc1 -fmodules-ts %s -DBUILT_AS_INTERFACE -emit-module-interface -verify -o /dev/null -// RUN: %clang_cc1 -fmodules-ts %s -DINTERFACE -DBUILT_AS_INTERFACE -emit-module-interface -verify -o /dev/null -// RUN: %clang_cc1 -fmodules-ts %s -DIMPLEMENTATION -DBUILT_AS_INTERFACE -emit-module-interface -verify -o /dev/null - -#if INTERFACE -// expected-no-diagnostics -export module A; -#elif IMPLEMENTATION -module A; - #ifdef BUILT_AS_INTERFACE - // expected-error@-2 {{missing 'export' specifier in module declaration while building module interface}} - #define INTERFACE - #endif -#else - #ifdef BUILT_AS_INTERFACE - // expected-error@1 {{missing 'export module' declaration in module interface unit}} - #endif -#endif - -#ifndef INTERFACE -export int b; // expected-error {{export declaration can only be used within a module interface unit}} -#else -export int a; -#endif Index: test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p1/interface-imports.cpp === --- test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p1/interface-imports.cpp +++ test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p1/interface-imports.cpp @@ -0,0 +1,40 @@ +// RUN: rm -rf %t +// RUN: mkdir -p %t +// RUN: echo 'export module a; export class A { };' > %t/a.cppm +// RUN: echo 'export module b; export class B { };' > %t/b.cppm +// +// RUN: %clang_cc1 -fmodules-ts -emit-module-interface %t/a.cppm -o %t/a.pcm +// RUN: %clang_cc1 -fmodules-ts -emit-module-interface %t/b.cppm -o %t/b.pcm +// RUN: %clang_cc1 -fmodules-ts -fprebuilt-module-path=%t -emit-module-interface %s -o %t/test.pcm -DTEST_INTERFACE +// +// RUN: %clang_cc1 -fmodules-ts -I%t -fmodule-file=%t/test.pcm %s -verify -DTEST_IMPLEMENTATION +// RUN: %clang_cc1 -fmodules-ts -I%t -fmodule-file=%t/test.pcm %s -verify -DOTHER_TU + + +#ifdef TEST_INTERFACE +import a; +export module test; +import b; +#endif + +#ifdef TEST_IMPLEMENTATION +module test; + +A a; // expected-error {{must be imported from module 'a'}} + // expected-n...@a.cppm:1 {{here}} + +// Module b is imported within the purview of this module's interface unit. +// So its exported definitions should be visible here. +B b; +#endif + + +#ifdef OTHER_TU +import test; + +A a; // expected-error {{must be imported from module 'a'}} + // expected-n...@a.cppm:1 {{here}} + +B b; // expected-error {{must be imported from module 'b'}} + // expected-n...@b.cppm:1 {{here}} +#endif Index: test/CXX/modules-ts/basic/basic.def.odr/p6/module-vs-module.cpp === --- test/CXX/modules-ts/basic/basic.def.odr/p6/module-vs-module.cpp +++ test/CXX/modules-ts/basic/basic.def.odr/p6/module-vs-module.cpp @@ -10,9 +10,7 @@ // // RUN: %clang_cc1 -fmodules-ts -std=c++17 %s -fmodule-file=%t/M.pcm -emit-module-interface -o %t/N.pcm -DMODULE_INTERFACE -DNO_ERRORS // RUN: %clang_cc1 -fmodules-ts -std=c++17 %s -fmodule-file=%t/N.pcm -verify -// FIXME: Once we start importing "import" declarations properly, this should -// be rejected (-verify should be added to the following line). -// RUN: %clang_cc1 -fmodules-ts -std=c++17 %s -fmodule-file=%t/N.pcm -DNO_IMPORT +// RUN: %clang_cc1 -fmodules-ts -std=c++17 %s -fmodule-file=%t/N.pcm -DNO_IMPORT -verify // // RUN: %clang_cc1 -fmodules-ts -std=c++17 %s -fmodule-file=%t/M.pcm -emit-module-interface -o %t/N-no-M.pcm -DMODULE_INTERFACE -DNO_ERRORS -DNO_IMPORT // RUN: %clang_cc1 -fmodules-ts -std=c++17 %s -fmodule-file=%t/N-no-M.pcm -verify Index: lib/Sema/SemaDecl.cpp === --- lib/Sema/SemaDecl.cpp +++ lib/Sema/SemaDecl.cpp @@ -16570,6 +16570,17 @@ TU->setModuleOwnershipKind(Decl::ModuleOwnershipKind::ModulePrivate); TU->setLocalOwningModule(Mod); + // Modules TS + p0731r0 [dcl.module.interface]p1: + // Every name of an entity with linkage other than internal linkage made + // visible in the pu
[PATCH] D40443: [Modules TS] Make imports from an interface unit visible to its implementation units
hamzasood marked 2 inline comments as done. hamzasood added inline comments. Comment at: lib/Sema/SemaDecl.cpp:16185-16194 + if (getLangOpts().ModulesTS) { +Module *CurrentModule = getCurrentModule(); +assert(CurrentModule && "Expected to be in a module scope"); + +// If the current module has been loaded from disk, then this is an +// implementation unit and hence we shouldn't modify the module. +// FIXME: Is that a hacky assumption? We can't just check rsmith wrote: > This is not appropriate; generally whether we serialize to an AST file should > be treated as orthogonal to whether we're in / importing a module. > > The right check here is probably `getLangOpts().getCompilingModule() == > CMK_ModuleInterface`. Thanks! I completely missed that lang opt. https://reviews.llvm.org/D40443 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D47979: [X86] Lowering Mask Scalar add/sub/mul/div intrinsics to native IR (Clang part)
tkrupa added inline comments. Comment at: lib/CodeGen/CGBuiltin.cpp:9926 +Value *Div = Builder.CreateFDiv(A, B); +llvm::VectorType *MaskTy = llvm::VectorType::get(Builder.getInt1Ty(), + cast(Mask->getType())->getBitWidth()); craig.topper wrote: > Can we just emit the and+icmp that the other operations end up with? We can't - if select condition is a CmpInst, CodeGenPrepare::optimizeSelectInst replaces it with a branch condition in case of expensive operations such as div. That's the reason I'm handling it in CGBuiltin in the first place. Repository: rC Clang https://reviews.llvm.org/D47979 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D47979: [X86] Lowering Mask Scalar add/sub/mul/div intrinsics to native IR (Clang part)
craig.topper accepted this revision. craig.topper added a comment. This revision is now accepted and ready to land. LGTM Repository: rC Clang https://reviews.llvm.org/D47979 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r334366 - [X86] Use target independent masked expandload and compressstore intrinsics to implement expandload/compressstore builtins.
Author: ctopper Date: Sun Jun 10 10:27:05 2018 New Revision: 334366 URL: http://llvm.org/viewvc/llvm-project?rev=334366&view=rev Log: [X86] Use target independent masked expandload and compressstore intrinsics to implement expandload/compressstore builtins. Summary: We've had these target independent intrinsics for at least a year and a half. Looks like they do exactly what we need here and the backend already supports them. Reviewers: RKSimon, delena, spatel, GBuella Reviewed By: RKSimon Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D47693 Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp cfe/trunk/test/CodeGen/avx512f-builtins.c cfe/trunk/test/CodeGen/avx512vbmi2-builtins.c cfe/trunk/test/CodeGen/avx512vl-builtins.c cfe/trunk/test/CodeGen/avx512vlvbmi2-builtins.c Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=334366&r1=334365&r2=334366&view=diff == --- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original) +++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Sun Jun 10 10:27:05 2018 @@ -8496,6 +8496,40 @@ static Value *EmitX86MaskedLoad(CodeGenF return CGF.Builder.CreateMaskedLoad(Ptr, Align, MaskVec, Ops[1]); } +static Value *EmitX86ExpandLoad(CodeGenFunction &CGF, +ArrayRef Ops) { + llvm::Type *ResultTy = Ops[1]->getType(); + llvm::Type *PtrTy = ResultTy->getVectorElementType(); + + // Cast the pointer to element type. + Value *Ptr = CGF.Builder.CreateBitCast(Ops[0], + llvm::PointerType::getUnqual(PtrTy)); + + Value *MaskVec = getMaskVecValue(CGF, Ops[2], + ResultTy->getVectorNumElements()); + + llvm::Function *F = CGF.CGM.getIntrinsic(Intrinsic::masked_expandload, + ResultTy); + return CGF.Builder.CreateCall(F, { Ptr, MaskVec, Ops[1] }); +} + +static Value *EmitX86CompressStore(CodeGenFunction &CGF, + ArrayRef Ops) { + llvm::Type *ResultTy = Ops[1]->getType(); + llvm::Type *PtrTy = ResultTy->getVectorElementType(); + + // Cast the pointer to element type. + Value *Ptr = CGF.Builder.CreateBitCast(Ops[0], + llvm::PointerType::getUnqual(PtrTy)); + + Value *MaskVec = getMaskVecValue(CGF, Ops[2], + ResultTy->getVectorNumElements()); + + llvm::Function *F = CGF.CGM.getIntrinsic(Intrinsic::masked_compressstore, + ResultTy); + return CGF.Builder.CreateCall(F, { Ops[1], Ptr, MaskVec }); +} + static Value *EmitX86MaskLogic(CodeGenFunction &CGF, Instruction::BinaryOps Opc, unsigned NumElts, ArrayRef Ops, bool InvertLHS = false) { @@ -9219,6 +9253,46 @@ Value *CodeGenFunction::EmitX86BuiltinEx return EmitX86MaskedLoad(*this, Ops, Align); } + case X86::BI__builtin_ia32_expandloaddf128_mask: + case X86::BI__builtin_ia32_expandloaddf256_mask: + case X86::BI__builtin_ia32_expandloaddf512_mask: + case X86::BI__builtin_ia32_expandloadsf128_mask: + case X86::BI__builtin_ia32_expandloadsf256_mask: + case X86::BI__builtin_ia32_expandloadsf512_mask: + case X86::BI__builtin_ia32_expandloaddi128_mask: + case X86::BI__builtin_ia32_expandloaddi256_mask: + case X86::BI__builtin_ia32_expandloaddi512_mask: + case X86::BI__builtin_ia32_expandloadsi128_mask: + case X86::BI__builtin_ia32_expandloadsi256_mask: + case X86::BI__builtin_ia32_expandloadsi512_mask: + case X86::BI__builtin_ia32_expandloadhi128_mask: + case X86::BI__builtin_ia32_expandloadhi256_mask: + case X86::BI__builtin_ia32_expandloadhi512_mask: + case X86::BI__builtin_ia32_expandloadqi128_mask: + case X86::BI__builtin_ia32_expandloadqi256_mask: + case X86::BI__builtin_ia32_expandloadqi512_mask: +return EmitX86ExpandLoad(*this, Ops); + + case X86::BI__builtin_ia32_compressstoredf128_mask: + case X86::BI__builtin_ia32_compressstoredf256_mask: + case X86::BI__builtin_ia32_compressstoredf512_mask: + case X86::BI__builtin_ia32_compressstoresf128_mask: + case X86::BI__builtin_ia32_compressstoresf256_mask: + case X86::BI__builtin_ia32_compressstoresf512_mask: + case X86::BI__builtin_ia32_compressstoredi128_mask: + case X86::BI__builtin_ia32_compressstoredi256_mask: + case X86::BI__builtin_ia32_compressstoredi512_mask: + case X86::BI__builtin_ia32_compressstoresi128_mask: + case X86::BI__builtin_ia32_compressstoresi256_mask: + case X86::BI__builtin_ia32_compressstoresi512_mask: + case X86::BI__builtin_ia32_compressstorehi128_mask: + case X86::BI__builtin_ia32_compressstorehi256_mask: + case X86::BI__builtin_ia32_compressstorehi512_mask: + case X86::BI__builtin_ia32_compressstoreqi128_mask: + case X86::BI__builtin_ia32_compressstoreqi256_mask: + case X8
[PATCH] D47693: [X86] Use target independent masked expandload and compressstore intrinsics to implement expandload/compressstore builtins.
This revision was automatically updated to reflect the committed changes. Closed by commit rL334366: [X86] Use target independent masked expandload and compressstore intrinsics to… (authored by ctopper, committed by ). Changed prior to commit: https://reviews.llvm.org/D47693?vs=149657&id=150654#toc Repository: rL LLVM https://reviews.llvm.org/D47693 Files: cfe/trunk/lib/CodeGen/CGBuiltin.cpp cfe/trunk/test/CodeGen/avx512f-builtins.c cfe/trunk/test/CodeGen/avx512vbmi2-builtins.c cfe/trunk/test/CodeGen/avx512vl-builtins.c cfe/trunk/test/CodeGen/avx512vlvbmi2-builtins.c Index: cfe/trunk/test/CodeGen/avx512f-builtins.c === --- cfe/trunk/test/CodeGen/avx512f-builtins.c +++ cfe/trunk/test/CodeGen/avx512f-builtins.c @@ -7293,40 +7293,52 @@ } __m512i test_mm512_mask_expandloadu_epi64(__m512i __W, __mmask8 __U, void const *__P) { // CHECK-LABEL: @test_mm512_mask_expandloadu_epi64 - // CHECK: @llvm.x86.avx512.mask.expand.load.q.512 + // CHECK: @llvm.masked.expandload.v8i64(i64* %{{.*}}, <8 x i1> %{{.*}}, <8 x i64> %{{.*}}) return _mm512_mask_expandloadu_epi64(__W, __U, __P); } __m512i test_mm512_maskz_expandloadu_epi64(__mmask8 __U, void const *__P) { // CHECK-LABEL: @test_mm512_maskz_expandloadu_epi64 - // CHECK: @llvm.x86.avx512.mask.expand.load.q.512 + // CHECK: @llvm.masked.expandload.v8i64(i64* %{{.*}}, <8 x i1> %{{.*}}, <8 x i64> %{{.*}}) return _mm512_maskz_expandloadu_epi64(__U, __P); } __m512d test_mm512_mask_expandloadu_pd(__m512d __W, __mmask8 __U, void const *__P) { // CHECK-LABEL: @test_mm512_mask_expandloadu_pd - // CHECK: @llvm.x86.avx512.mask.expand.load.pd.512 + // CHECK: @llvm.masked.expandload.v8f64(double* %{{.*}}, <8 x i1> %{{.*}}, <8 x double> %{{.*}}) return _mm512_mask_expandloadu_pd(__W, __U, __P); } __m512d test_mm512_maskz_expandloadu_pd(__mmask8 __U, void const *__P) { // CHECK-LABEL: @test_mm512_maskz_expandloadu_pd - // CHECK: @llvm.x86.avx512.mask.expand.load.pd.512 + // CHECK: @llvm.masked.expandload.v8f64(double* %{{.*}}, <8 x i1> %{{.*}}, <8 x double> %{{.*}}) return _mm512_maskz_expandloadu_pd(__U, __P); } __m512i test_mm512_mask_expandloadu_epi32(__m512i __W, __mmask16 __U, void const *__P) { // CHECK-LABEL: @test_mm512_mask_expandloadu_epi32 - // CHECK: @llvm.x86.avx512.mask.expand.load.d.512 + // CHECK: @llvm.masked.expandload.v16i32(i32* %{{.*}}, <16 x i1> %{{.*}}, <16 x i32> %{{.*}}) return _mm512_mask_expandloadu_epi32(__W, __U, __P); } __m512i test_mm512_maskz_expandloadu_epi32(__mmask16 __U, void const *__P) { // CHECK-LABEL: @test_mm512_maskz_expandloadu_epi32 - // CHECK: @llvm.x86.avx512.mask.expand.load.d.512 + // CHECK: @llvm.masked.expandload.v16i32(i32* %{{.*}}, <16 x i1> %{{.*}}, <16 x i32> %{{.*}}) return _mm512_maskz_expandloadu_epi32(__U, __P); } +__m512 test_mm512_mask_expandloadu_ps(__m512 __W, __mmask16 __U, void const *__P) { + // CHECK-LABEL: @test_mm512_mask_expandloadu_ps + // CHECK: @llvm.masked.expandload.v16f32(float* %{{.*}}, <16 x i1> %{{.*}}, <16 x float> %{{.*}}) + return _mm512_mask_expandloadu_ps(__W, __U, __P); +} + +__m512 test_mm512_maskz_expandloadu_ps(__mmask16 __U, void const *__P) { + // CHECK-LABEL: @test_mm512_maskz_expandloadu_ps + // CHECK: @llvm.masked.expandload.v16f32(float* %{{.*}}, <16 x i1> %{{.*}}, <16 x float> %{{.*}}) + return _mm512_maskz_expandloadu_ps(__U, __P); +} + __m512 test_mm512_mask_expand_ps(__m512 __W, __mmask16 __U, __m512 __A) { // CHECK-LABEL: @test_mm512_mask_expand_ps // CHECK: @llvm.x86.avx512.mask.expand.ps.512 @@ -7428,25 +7440,25 @@ void test_mm512_mask_compressstoreu_pd(void *__P, __mmask8 __U, __m512d __A) { // CHECK-LABEL: @test_mm512_mask_compressstoreu_pd - // CHECK: @llvm.x86.avx512.mask.compress.store.pd.512 + // CHECK: @llvm.masked.compressstore.v8f64(<8 x double> %{{.*}}, double* %{{.*}}, <8 x i1> %{{.*}}) return _mm512_mask_compressstoreu_pd(__P, __U, __A); } void test_mm512_mask_compressstoreu_epi64(void *__P, __mmask8 __U, __m512i __A) { // CHECK-LABEL: @test_mm512_mask_compressstoreu_epi64 - // CHECK: @llvm.x86.avx512.mask.compress.store.q.512 + // CHECK: @llvm.masked.compressstore.v8i64(<8 x i64> %{{.*}}, i64* %{{.*}}, <8 x i1> %{{.*}}) return _mm512_mask_compressstoreu_epi64(__P, __U, __A); } void test_mm512_mask_compressstoreu_ps(void *__P, __mmask16 __U, __m512 __A) { // CHECK-LABEL: @test_mm512_mask_compressstoreu_ps - // CHECK: @llvm.x86.avx512.mask.compress.store.ps.512 + // CHECK: @llvm.masked.compressstore.v16f32(<16 x float> %{{.*}}, float* %{{.*}}, <16 x i1> %{{.*}}) return _mm512_mask_compressstoreu_ps(__P, __U, __A); } void test_mm512_mask_compressstoreu_epi32(void *__P, __mmask16 __U, __m512i __A) { // CHECK-LABEL: @test_mm512_mask_compressstoreu_epi32 - // CHECK: @llvm.x86.avx512.mask.compress.store.d.512 + // CHECK: @llvm.masked.compressstore.v16i32(<16 x i32
[PATCH] D47111: : Implement monotonic_buffer_resource.
Quuxplusone added inline comments. Comment at: include/experimental/memory_resource:489 +memory_resource* __res_; +size_t __next_buffer_size_; +}; I've discovered that Boost.Container does not bother to preserve this state across calls to `release()`. If that's legal, then we can save 8 bytes here. I've asked for an LWG issue to be opened on the subject of "what the heck is `release()` supposed to do anyway." Repository: rCXX libc++ https://reviews.llvm.org/D47111 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D47946: [ASTmporter] Fix infinite recursion on function import with struct definition in parameters
balazske added a comment. Problem: This change interferes with https://reviews.llvm.org/D47445. Probably that should be committed, it is approved already. Repository: rC Clang https://reviews.llvm.org/D47946 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r334385 - [X86] Remove masking from dbpsadbw builtins, use select builtin instead.
Author: ctopper Date: Sun Jun 10 23:18:29 2018 New Revision: 334385 URL: http://llvm.org/viewvc/llvm-project?rev=334385&view=rev Log: [X86] Remove masking from dbpsadbw builtins, use select builtin instead. Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def cfe/trunk/lib/Headers/avx512bwintrin.h cfe/trunk/lib/Headers/avx512vlbwintrin.h cfe/trunk/lib/Sema/SemaChecking.cpp cfe/trunk/test/CodeGen/avx512bw-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=334385&r1=334384&r2=334385&view=diff == --- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original) +++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Sun Jun 10 23:18:29 2018 @@ -1745,9 +1745,9 @@ TARGET_BUILTIN(__builtin_ia32_kunpckhi, TARGET_BUILTIN(__builtin_ia32_kxnorhi, "UsUsUs", "nc", "avx512f") TARGET_BUILTIN(__builtin_ia32_kxorhi, "UsUsUs", "nc", "avx512f") TARGET_BUILTIN(__builtin_ia32_palignr512, "V64cV64cV64cIi", "nc", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_dbpsadbw128_mask, "V8sV16cV16cIiV8sUc", "nc", "avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_dbpsadbw256_mask, "V16sV32cV32cIiV16sUs", "nc", "avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_dbpsadbw512_mask, "V32sV64cV64cIiV32sUi", "nc", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_dbpsadbw128, "V8sV16cV16cIi", "nc", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_dbpsadbw256, "V16sV32cV32cIi", "nc", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_dbpsadbw512, "V32sV64cV64cIi", "nc", "avx512bw") TARGET_BUILTIN(__builtin_ia32_psadbw512, "V8LLiV64cV64c", "nc", "avx512bw") TARGET_BUILTIN(__builtin_ia32_compressdf512_mask, "V8dV8dV8dUc", "nc", "avx512f") TARGET_BUILTIN(__builtin_ia32_compressdi512_mask, "V8LLiV8LLiV8LLiUc", "nc", "avx512f") Modified: cfe/trunk/lib/Headers/avx512bwintrin.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512bwintrin.h?rev=334385&r1=334384&r2=334385&view=diff == --- cfe/trunk/lib/Headers/avx512bwintrin.h (original) +++ cfe/trunk/lib/Headers/avx512bwintrin.h Sun Jun 10 23:18:29 2018 @@ -1819,22 +1819,18 @@ _mm512_mask_permutexvar_epi16 (__m512i _ (__v64qi)(__m512i)_mm512_setzero_si512()) #define _mm512_dbsad_epu8(A, B, imm) \ - (__m512i)__builtin_ia32_dbpsadbw512_mask((__v64qi)(__m512i)(A), \ - (__v64qi)(__m512i)(B), (int)(imm), \ - (__v32hi)_mm512_undefined_epi32(), \ - (__mmask32)-1) + (__m512i)__builtin_ia32_dbpsadbw512((__v64qi)(__m512i)(A), \ + (__v64qi)(__m512i)(B), (int)(imm)) #define _mm512_mask_dbsad_epu8(W, U, A, B, imm) \ - (__m512i)__builtin_ia32_dbpsadbw512_mask((__v64qi)(__m512i)(A), \ - (__v64qi)(__m512i)(B), (int)(imm), \ - (__v32hi)(__m512i)(W), \ - (__mmask32)(U)) + (__m512i)__builtin_ia32_selectw_512((__mmask32)(U), \ + (__v32hi)_mm512_dbsad_epu8((A), (B), (imm)), \ + (__v32hi)(__m512i)(W)) #define _mm512_maskz_dbsad_epu8(U, A, B, imm) \ - (__m512i)__builtin_ia32_dbpsadbw512_mask((__v64qi)(__m512i)(A), \ - (__v64qi)(__m512i)(B), (int)(imm), \ - (__v32hi)_mm512_setzero_si512(), \ - (__mmask32)(U)) + (__m512i)__builtin_ia32_selectw_512((__mmask32)(U), \ + (__v32hi)_mm512_dbsad_epu8((A), (B), (imm)), \ + (__v32hi)_mm512_setzero_si512()) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_sad_epu8 (__m512i __A, __m512i __B) Modified: cfe/trunk/lib/Headers/avx512vlbwintrin.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512vlbwintrin.h?rev=334385&r1=334384&r2=334385&view=diff == --- cfe/trunk/lib/Headers/avx512vlbwintrin.h (original) +++ cfe/trunk/lib/Headers/avx512vlbwintrin.h Sun Jun 10 23:18:29 2018 @@ -2714,40 +2714,32 @@ _mm256_mask_permutexvar_epi16 (__m256i _ (__v32qi)_mm256_setzero_si256()) #define _mm_dbsad_epu8(A, B, imm) \ - (__m128i)__builtin_ia32_dbpsadbw128_mask((__v16qi)(__m128i)(A), \ - (__v16qi)(__m128i)(B), (int)(imm), \ - (__v8hi)_mm_setzero_si128(), \ - (__mmask8)-1) + (__m128i)__builtin_ia32_dbpsadbw128((__v16q
[PATCH] D47875: [MS ABI] Mangle unnamed empty enums (PR37723)
This revision was automatically updated to reflect the committed changes. Closed by commit rL334388: [MS ABI] Mangle unnamed empty enums (PR37723) (authored by hans, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D47875?vs=150462&id=150677#toc Repository: rL LLVM https://reviews.llvm.org/D47875 Files: cfe/trunk/lib/AST/MicrosoftMangle.cpp cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp Index: cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp === --- cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp +++ cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp @@ -1,5 +1,6 @@ // RUN: %clang_cc1 -std=c++11 -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=19.00 | FileCheck %s --check-prefix=CHECK --check-prefix=MSVC2015 // RUN: %clang_cc1 -std=c++11 -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=18.00 | FileCheck %s --check-prefix=CHECK --check-prefix=MSVC2013 +// RUN: %clang_cc1 -std=c++11 -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -gcodeview -debug-info-kind=limited | FileCheck %s --check-prefix=DBG namespace FTypeWithQuals { template @@ -350,3 +351,10 @@ void f(decltype(enumerator)) {} // CHECK-DAG: define internal void @"?f@@YAXW4@@@Z"( void use_f() { f(enumerator); } + +namespace pr37723 { +struct s { enum {}; enum {}; }; +// DBG-DAG: DW_TAG_enumeration_type{{.*}}identifier: ".?AW4@s@pr37723@@" +// DBG-DAG: DW_TAG_enumeration_type{{.*}}identifier: ".?AW4@s@pr37723@@" +s x; +} Index: cfe/trunk/lib/AST/MicrosoftMangle.cpp === --- cfe/trunk/lib/AST/MicrosoftMangle.cpp +++ cfe/trunk/lib/AST/MicrosoftMangle.cpp @@ -884,11 +884,13 @@ // associate typedef mangled in if they have one. Name += "getName(); - } else if (auto *ED = dyn_cast(TD)) { -auto EnumeratorI = ED->enumerator_begin(); -assert(EnumeratorI != ED->enumerator_end()); + } else if (isa(TD) && + cast(TD)->enumerator_begin() != + cast(TD)->enumerator_end()) { +// Anonymous non-empty enums mangle in the first enumerator. +auto *ED = cast(TD); Name += "getName(); +Name += ED->enumerator_begin()->getName(); } else { // Otherwise, number the types using a $S prefix. Name += "Index: cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp === --- cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp +++ cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp @@ -1,5 +1,6 @@ // RUN: %clang_cc1 -std=c++11 -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=19.00 | FileCheck %s --check-prefix=CHECK --check-prefix=MSVC2015 // RUN: %clang_cc1 -std=c++11 -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=18.00 | FileCheck %s --check-prefix=CHECK --check-prefix=MSVC2013 +// RUN: %clang_cc1 -std=c++11 -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -gcodeview -debug-info-kind=limited | FileCheck %s --check-prefix=DBG namespace FTypeWithQuals { template @@ -350,3 +351,10 @@ void f(decltype(enumerator)) {} // CHECK-DAG: define internal void @"?f@@YAXW4@@@Z"( void use_f() { f(enumerator); } + +namespace pr37723 { +struct s { enum {}; enum {}; }; +// DBG-DAG: DW_TAG_enumeration_type{{.*}}identifier: ".?AW4@s@pr37723@@" +// DBG-DAG: DW_TAG_enumeration_type{{.*}}identifier: ".?AW4@s@pr37723@@" +s x; +} Index: cfe/trunk/lib/AST/MicrosoftMangle.cpp === --- cfe/trunk/lib/AST/MicrosoftMangle.cpp +++ cfe/trunk/lib/AST/MicrosoftMangle.cpp @@ -884,11 +884,13 @@ // associate typedef mangled in if they have one. Name += "getName(); - } else if (auto *ED = dyn_cast(TD)) { -auto EnumeratorI = ED->enumerator_begin(); -assert(EnumeratorI != ED->enumerator_end()); + } else if (isa(TD) && + cast(TD)->enumerator_begin() != + cast(TD)->enumerator_end()) { +// Anonymous non-empty enums mangle in the first enumerator. +auto *ED = cast(TD); Name += "getName(); +Name += ED->enumerator_begin()->getName(); } else { // Otherwise, number the types using a $S prefix. Name += "___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D47945: Add support for arrays in performance-implicit-conversion-in-loop
pilki added a comment. Thanks Alex! I do not have the submit right, can you take care of it? Thanks Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47945 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r334388 - [MS ABI] Mangle unnamed empty enums (PR37723)
Author: hans Date: Sun Jun 10 23:54:23 2018 New Revision: 334388 URL: http://llvm.org/viewvc/llvm-project?rev=334388&view=rev Log: [MS ABI] Mangle unnamed empty enums (PR37723) Differential Revision: https://reviews.llvm.org/D47875 Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=334388&r1=334387&r2=334388&view=diff == --- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original) +++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Sun Jun 10 23:54:23 2018 @@ -884,11 +884,13 @@ void MicrosoftCXXNameMangler::mangleUnqu // associate typedef mangled in if they have one. Name += "getName(); - } else if (auto *ED = dyn_cast(TD)) { -auto EnumeratorI = ED->enumerator_begin(); -assert(EnumeratorI != ED->enumerator_end()); + } else if (isa(TD) && + cast(TD)->enumerator_begin() != + cast(TD)->enumerator_end()) { +// Anonymous non-empty enums mangle in the first enumerator. +auto *ED = cast(TD); Name += "getName(); +Name += ED->enumerator_begin()->getName(); } else { // Otherwise, number the types using a $S prefix. Name += "http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp?rev=334388&r1=334387&r2=334388&view=diff == --- cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp (original) +++ cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp Sun Jun 10 23:54:23 2018 @@ -1,5 +1,6 @@ // RUN: %clang_cc1 -std=c++11 -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=19.00 | FileCheck %s --check-prefix=CHECK --check-prefix=MSVC2015 // RUN: %clang_cc1 -std=c++11 -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=18.00 | FileCheck %s --check-prefix=CHECK --check-prefix=MSVC2013 +// RUN: %clang_cc1 -std=c++11 -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -gcodeview -debug-info-kind=limited | FileCheck %s --check-prefix=DBG namespace FTypeWithQuals { template @@ -350,3 +351,10 @@ enum { enumerator }; void f(decltype(enumerator)) {} // CHECK-DAG: define internal void @"?f@@YAXW4@@@Z"( void use_f() { f(enumerator); } + +namespace pr37723 { +struct s { enum {}; enum {}; }; +// DBG-DAG: DW_TAG_enumeration_type{{.*}}identifier: ".?AW4@s@pr37723@@" +// DBG-DAG: DW_TAG_enumeration_type{{.*}}identifier: ".?AW4@s@pr37723@@" +s x; +} ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits