[PATCH] D47190: [Driver] Add -ivfsoverlay-lib option to load VFS from shared

2018-05-22 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic created this revision. Herald added a subscriber: mgorny. This patch allows clang to use a VirtualFileSystem represented by a shared library. This VFS will be used on top of the real file system. Library specified -ivfsoverlay-lib by must export `clang::vfs::FileSystem

[PATCH] D47190: [Driver] Add -ivfsoverlay-lib option to load VFS from shared

2018-05-22 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 147974. asavonic added a comment. Add license header. https://reviews.llvm.org/D47190 Files: include/clang/Driver/Options.td include/clang/Lex/HeaderSearchOptions.h lib/Frontend/CompilerInvocation.cpp unittests/Frontend/CMakeLists.txt

[PATCH] D47190: [Driver] Add -ivfsoverlay-lib option to load VFS from shared library

2018-05-23 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 148225. asavonic added a comment. Fixed warning about void* to function pointer cast. Repository: rC Clang https://reviews.llvm.org/D47190 Files: include/clang/Driver/Options.td include/clang/Lex/HeaderSearchOptions.h

[PATCH] D47190: [Driver] Add -ivfsoverlay-lib option to load VFS from shared library

2018-06-04 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 149763. asavonic added a comment. Addressed CR comments, added a diagnostic if shared library was not loaded. https://reviews.llvm.org/D47190 Files: include/clang/Basic/DiagnosticFrontendKinds.td include/clang/Driver/Options.td

[PATCH] D50259: [OpenCL] Disallow negative attribute arguments

2018-08-03 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic created this revision. asavonic added reviewers: Anastasia, yaxunl. Herald added a subscriber: cfe-commits. Negative arguments in kernel attributes are silently bitcast'ed to unsigned, for example: __attribute__((reqd_work_group_size(1, -1, 1))) __kernel void k() {} is a complete

[PATCH] D49723: [OpenCL] Check for invalid kernel arguments in array types

2018-07-27 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 157685. asavonic marked an inline comment as done. asavonic added a comment. Fix assert. Repository: rC Clang https://reviews.llvm.org/D49723 Files: lib/Sema/SemaDecl.cpp test/SemaOpenCL/invalid-kernel-parameters.cl Index:

[PATCH] D49723: [OpenCL] Check for invalid kernel arguments in array types

2018-07-27 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. In https://reviews.llvm.org/D49723#1178127, @Anastasia wrote: > In https://reviews.llvm.org/D49723#1174837, @asavonic wrote: > > > In https://reviews.llvm.org/D49723#1173352, @Anastasia wrote: > > > > > Btw, has this restriction been removed from CL 2.0? > > > > > > No,

[PATCH] D49723: [OpenCL] Check for invalid kernel arguments in array types

2018-07-27 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 157688. asavonic added a comment. Rollback accidentally squashed commit. Repository: rC Clang https://reviews.llvm.org/D49723 Files: lib/Sema/SemaDecl.cpp test/SemaOpenCL/invalid-kernel-parameters.cl Index:

[PATCH] D49725: [OpenCL] Forbid size dependent types used as kernel arguments

2018-07-26 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 157471. asavonic added a comment. Moved unrelated change to https://reviews.llvm.org/D49723. Repository: rC Clang https://reviews.llvm.org/D49725 Files: lib/Sema/SemaDecl.cpp test/SemaOpenCL/invalid-kernel-parameters.cl Index:

[PATCH] D49723: [OpenCL] Check for invalid kernel arguments in array types

2018-07-26 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 157470. asavonic added a comment. Moved another chunk from https://reviews.llvm.org/D49725 Repository: rC Clang https://reviews.llvm.org/D49723 Files: lib/Sema/SemaDecl.cpp test/SemaOpenCL/invalid-kernel-parameters.cl Index:

[PATCH] D49725: [OpenCL] Forbid size dependent types used as kernel arguments

2018-07-26 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic marked an inline comment as done. asavonic added inline comments. Comment at: lib/Sema/SemaDecl.cpp:8267 - S.Diag(PD->getLocation(), diag::note_within_field_of_type) -<< PD->getDeclName(); + S.Diag(OrigRecDecl->getLocation(),

[PATCH] D49725: [OpenCL] Forbid size dependent types used as kernel arguments

2018-07-24 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic created this revision. Herald added subscribers: cfe-commits, Anastasia, yaxunl. Size_t, intptr_t, uintptr_t and ptrdiff_t cannot be used as kernel arguments, according to OpenCL Specification s6.9k: The size in bytes of these types are implementation-defined and in addition can

[PATCH] D49723: [OpenCL] Check for invalid kernel arguments in array types

2018-07-24 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic created this revision. Herald added subscribers: cfe-commits, Anastasia, yaxunl. OpenCL specification forbids use of several types as kernel arguments. This patch improves existing diagnostic to look through arrays. Repository: rC Clang https://reviews.llvm.org/D49723 Files:

[PATCH] D49723: [OpenCL] Check for invalid kernel arguments in array types

2018-07-25 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 157219. asavonic added a comment. Moved a chunk from https://reviews.llvm.org/D49725; added 2 more tests. Repository: rC Clang https://reviews.llvm.org/D49723 Files: lib/Sema/SemaDecl.cpp test/SemaOpenCL/invalid-kernel-parameters.cl Index:

[PATCH] D49723: [OpenCL] Check for invalid kernel arguments in array types

2018-07-25 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. In https://reviews.llvm.org/D49723#1173352, @Anastasia wrote: > Btw, has this restriction been removed from CL 2.0? No, it applies for CL2.0 as well. Repository: rC Clang https://reviews.llvm.org/D49723 ___

[PATCH] D49725: [OpenCL] Forbid size dependent types used as kernel arguments

2018-07-25 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 157222. asavonic added a comment. Added a diagnostic note for typedefs; moved unrelated changes to https://reviews.llvm.org/D49723. Repository: rC Clang https://reviews.llvm.org/D49725 Files: lib/Sema/SemaDecl.cpp

[PATCH] D49725: [OpenCL] Forbid size dependent types used as kernel arguments

2018-07-25 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic marked 5 inline comments as done. asavonic added a comment. In https://reviews.llvm.org/D49725#1173321, @yaxunl wrote: > This patch also adds check for array of structs. Can you include this in > title or split to a separate patch? I'm sorry, this change with arrays should actually

[PATCH] D51544: [OpenCL] Split opencl-c.h header

2018-09-05 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. In https://reviews.llvm.org/D51544#1224730, @Anastasia wrote: > It seems generally good to partition this big header but I am trying to > understand what problem is it trying to solve now? Main motivation is to reduce memory footprint by factoring out everything that

[PATCH] D51544: [OpenCL] Split opencl-c.h header

2018-09-07 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. In https://reviews.llvm.org/D51544#1227313, @Anastasia wrote: > Currently the main header still contains everything, so the size of the PCH > won't change. The idea is that we don't pre-compile the whole opencl-c.h, we split it into several headers (3 of them are

[PATCH] D50259: [OpenCL] Disallow negative attribute arguments

2018-09-06 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC341539: [OpenCL] Disallow negative attribute arguments (authored by asavonic, committed by ). Changed prior to commit: https://reviews.llvm.org/D50259?vs=159022=164190#toc Repository: rC Clang

[PATCH] D51302: [OpenCL] Relax diagnostics on OpenCL access qualifiers

2018-09-06 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL341553: [OpenCL] Relax diagnostics on OpenCL access qualifiers (authored by asavonic, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D51302: [OpenCL] Relax diagnostics on OpenCL access qualifiers

2018-09-06 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC341553: [OpenCL] Relax diagnostics on OpenCL access qualifiers (authored by asavonic, committed by ). Repository: rC Clang https://reviews.llvm.org/D51302 Files: lib/Sema/SemaDeclAttr.cpp

[PATCH] D51853: Merge two attribute diagnostics into one

2018-09-10 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic created this revision. asavonic added a reviewer: aaron.ballman. Herald added a subscriber: cfe-commits. Merged the recently added `err_attribute_argument_negative` diagnostic with existing `err_attribute_requires_positive_integer` diagnostic: the former allows only strictly positive

[PATCH] D51544: [OpenCL] Split opencl-c.h header

2018-09-11 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. In https://reviews.llvm.org/D51544#1229105, @Anastasia wrote: > > With this setup, we can compile opencl-c-common.h, opencl-c-fp16.h and > > opencl-c-fp64.h into PCHs with one set of extensions/OpenCL version, > > and use them for any other set of extensions/OpenCL

[PATCH] D51402: [OpenCL] Adding cl_intel_planar_yuv extension

2018-10-23 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic closed this revision. asavonic added a comment. Committed revision 345044 https://reviews.llvm.org/D51402 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D52654: [OpenCL][NFC] Unify ZeroToOCL* cast types

2018-10-23 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC345038: [OpenCL][NFC] Unify ZeroToOCL* cast types (authored by asavonic, committed by ). Repository: rC Clang https://reviews.llvm.org/D52654 Files: include/clang/AST/OperationKinds.def

[PATCH] D52658: [OpenCL] Remove PIPE_RESERVE_ID_VALID_BIT from opencl-c.h

2018-10-23 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL345051: [OpenCL] Remove PIPE_RESERVE_ID_VALID_BIT from opencl-c.h (authored by asavonic, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D53023: Prototype OpenCL BIFs using Tablegen

2018-10-26 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added inline comments. Comment at: lib/Sema/SemaExpr.cpp:2247 if (R.empty() && HasTrailingLParen && II && !getLangOpts().CPlusPlus) { -NamedDecl *D = ImplicitlyDefineFunction(NameLoc, *II, S); -if (D) R.addDecl(D); +if (getLangOpts().OpenCL) { + auto

[PATCH] D53023: Prototype OpenCL BIFs using Tablegen

2018-10-26 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. > TODO > Measure the performance / size impact I looks like the total size of OpenCLBuiltinDecl table should be ~450KB (for ~15000 functions). I guess it can be reduced furthermore by: 1. Replacing return type with an index (you've mentioned this in TODO). 2. Replace

[PATCH] D53200: [OpenCL] Fix serialization of OpenCLExtensionDecls

2018-10-29 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC345497: [OpenCL] Fix serialization of OpenCLExtensionDecls (authored by asavonic, committed by ). Repository: rC Clang https://reviews.llvm.org/D53200 Files: lib/Serialization/ASTWriter.cpp

[PATCH] D51484: [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension

2018-11-07 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. I reverted this change in r346338, as it breaks Index/opencl-types.cl LIT test. See http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/21503/steps/ninja%20check%201/logs/FAIL%3A%20Clang%3A%3Aopencl-types.cl Repository: rL LLVM

[PATCH] D51484: [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension

2018-11-08 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. Committed in r346392. Repository: rC Clang https://reviews.llvm.org/D51484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D54253: [OpenCL][NFC] Improve test coverage of test/Index/opencl-types.cl

2018-11-08 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. LGTM. Repository: rC Clang https://reviews.llvm.org/D54253 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D54152: [OpenCL] Fix diagnostic message about overload candidates

2018-11-07 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC346311: [OpenCL] Fix diagnostic message about overload candidates (authored by asavonic, committed by ). Repository: rC Clang https://reviews.llvm.org/D54152 Files:

[PATCH] D51484: [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension

2018-11-07 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL346326: [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension (authored by asavonic, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D52292: [Sema][OpenCL] Improve diagnostics for not viable overloadable function candidates

2018-10-11 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC344246: [Sema][OpenCL] Improve diagnostics for not viable overloadable function… (authored by asavonic, committed by ). Repository: rC Clang https://reviews.llvm.org/D52292 Files:

[PATCH] D51544: [OpenCL] Split opencl-c.h header

2018-08-31 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic created this revision. asavonic added reviewers: Anastasia, yaxunl, bader. Herald added subscribers: cfe-commits, jfb, mgorny. TL;DR - This patch splits huge opencl-c.h header into multiple headers to support efficient use of Precompiled Headers (or Modules): - opencl-c-defs.h

[PATCH] D52457: [OpenCL] Implement OpenCL convert builtin

2018-09-25 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic created this revision. Herald added subscribers: cfe-commits, kristina, Anastasia, yaxunl. OpenCL `convert' is a builtin that takes a builtin scalar or vector type, and converts it to another builtin scalar or vector type using different rounding modes (round-to-even, round-to-zero,

[PATCH] D52458: [OpenCL] Implement OpenCL math builtins: fp -> fp

2018-09-25 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic created this revision. Herald added subscribers: cfe-commits, kristina, Anastasia, yaxunl. This patch adds OpenCL builtin functions that take any built-in floating point type (float, double, half) and return a value of the same floating point type. Repository: rC Clang

[PATCH] D55262: [OpenCL] Fix for TBAA information of pointer after addresspacecast

2018-12-12 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL348919: [OpenCL] Fix for TBAA information of pointer after addresspacecast (authored by asavonic, committed by ). Changed prior to commit: https://reviews.llvm.org/D55262?vs=177012=177827#toc

[PATCH] D54947: [OpenCL][CodeGen] Fix replacing memcpy with addrspacecast

2018-12-10 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC348752: [OpenCL][CodeGen] Fix replacing memcpy with addrspacecast (authored by asavonic, committed by ). Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54947/new/

[PATCH] D54253: [OpenCL] Launch opencl-types.cl test only on x86

2018-11-26 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. >> FWIW, I'd vote for the first revision of this patch. From my >> >> understanding, the test verifies that libclang is able to parse OpenCL >> code correctly. It doesn't do anything specific to x86: target for x86 just >> happens to support a set of OpenCL

[PATCH] D54253: [OpenCL] Launch opencl-types.cl test only on x86

2018-11-22 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. FWIW, I'd vote for the first revision of this patch. From my understanding, the test verifies that libclang is able to parse OpenCL code correctly. It doesn't do anything specific to x86: target for x86 just happens to support a set of OpenCL extensions.

[PATCH] D51853: Merge two attribute diagnostics into one

2018-09-17 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC342367: Merge two attribute diagnostics into one (authored by asavonic, committed by ). Changed prior to commit: https://reviews.llvm.org/D51853?vs=164651=165734#toc Repository: rC Clang

[PATCH] D51722: [OpenCL] Allow blocks to capture arrays in OpenCL

2018-09-17 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL342370: [OpenCL] Allow blocks to capture arrays in OpenCL (authored by asavonic, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D58388: [OpenCL] Simplify LLVM IR generated for OpenCL blocks

2019-02-21 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC354568: [OpenCL] Simplify LLVM IR generated for OpenCL blocks (authored by asavonic, committed by ). Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58388/new/

[PATCH] D59493: [OpenCL] Generate 'unroll.enable' metadata for __attribute__((opencl_unroll_hint))

2019-03-20 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC356571: [OpenCL] Generate unroll.enable metadata for __attribute__… (authored by asavonic, committed by ). Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59493/new/

[PATCH] D58666: [OpenCL] Undefine cl_intel_planar_yuv extension

2019-06-03 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL362398: [OpenCL] Undefine cl_intel_planar_yuv extension (authored by asavonic, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D63256: [OpenCL] Split type and macro definitions into opencl-c-base.h

2019-06-14 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. LGTM, except for the `IncludeDefaultHeader` and `DeclareOpenCLBuiltins` logic. Comment at: lib/Frontend/CompilerInvocation.cpp:2194 } +// Include base header file for builtin types and constants. +if (Opts.DeclareOpenCLBuiltins) {

[PATCH] D63256: [OpenCL] Split type and macro definitions into opencl-c-base.h

2019-06-18 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic accepted this revision. asavonic added a comment. This revision is now accepted and ready to land. Thanks. LGTM. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63256/new/ https://reviews.llvm.org/D63256 ___ cfe-commits mailing list

[PATCH] D71460: [OpenCL] Fix support for cl_khr_mipmap_image_writes

2019-12-13 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. What about `get_image_num_mip_levels` functions defined in the extension specification? Comment at: clang/lib/Headers/opencl-c.h:14780 void __ovld write_imagef(read_write image2d_depth_t image, int2 coord, int lod, float color); void __ovld

[PATCH] D89909: [SYCL] Implement SYCL address space attributes handling

2020-11-13 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added inline comments. Comment at: clang/lib/CodeGen/CGExpr.cpp:4554 + + // Language rules define if it is legal to cast from one address space + // to another, and which address space we should use as a "common sdmitriev wrote: > bader wrote:

[PATCH] D89909: [SYCL] Implement SYCL address space attributes handling

2020-11-13 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added inline comments. Comment at: clang/lib/CodeGen/CGExpr.cpp:4554 + + // Language rules define if it is legal to cast from one address space + // to another, and which address space we should use as a "common bader wrote: > asavonic wrote:

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-06-16 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. @erichkeane, can you please check if this patch is OK for Clang? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98895/new/ https://reviews.llvm.org/D98895 ___ cfe-commits

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-05-18 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98895/new/ https://reviews.llvm.org/D98895 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D101156: [Clang] Support a user-defined __dso_handle

2021-05-12 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. In D101156#2724789 , @rjmccall wrote: > What's the crash exactly/ Is IRGen just unhappy about processing the user > definition when we've generated a declaration with a different type? Because > we're already supposed to be

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-05-19 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added inline comments. Comment at: clang/test/Sema/x86-no-x87.c:48-61 +void assign2() { + struct st_long_double st; +#ifndef NOERROR + // expected-error@+2{{long double is not supported on this target}} +#endif + st.ld = 0.42; +} pengfei wrote: >

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-05-24 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 347443. asavonic added a comment. Added LIT run lines for i686 and windows targets. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98895/new/ https://reviews.llvm.org/D98895 Files:

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-05-24 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added inline comments. Comment at: clang/test/Sema/x86-no-x87.c:48-61 +void assign2() { + struct st_long_double st; +#ifndef NOERROR + // expected-error@+2{{long double is not supported on this target}} +#endif + st.ld = 0.42; +} pengfei wrote: >

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-05-25 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added inline comments. Comment at: clang/test/Sema/x86-no-x87.c:2 +// RUN: %clang_cc1 -fsyntax-only -verify %s -triple x86_64-linux-gnu -target-feature -x87 +// RUN: %clang_cc1 -fsyntax-only -verify %s -triple i686-linux-gnu -target-feature -x87 +// RUN: %clang_cc1

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-05-27 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 348219. asavonic added a comment. - Disabled double or float return for x86 targets - Refactored checks into a separate function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98895/new/

[PATCH] D101156: [Clang] Support a user-defined __dso_handle

2021-06-06 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 350134. asavonic edited the summary of this revision. asavonic added a comment. - Used `llvm::TrackingVH` to track Init changes. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101156/new/ https://reviews.llvm.org/D101156 Files:

[PATCH] D101156: [Clang] Support a user-defined __dso_handle

2021-06-06 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:4425 + if (ReplaceInitWithGV) +Init = llvm::ConstantExpr::getBitCast(GV, GV->getValueType()); + rjmccall wrote: > Can we actually do this bitcast for arbitrary initializers?

[PATCH] D101156: [Clang] Support a user-defined __dso_handle

2021-06-07 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb31f41e78b27: [Clang] Support a user-defined __dso_handle (authored by asavonic). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101156/new/

[PATCH] D101156: [Clang] Support a user-defined __dso_handle

2021-06-03 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101156/new/ https://reviews.llvm.org/D101156 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D101156: [Clang] Support a user-defined __dso_handle

2021-05-24 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 347341. asavonic edited the summary of this revision. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101156/new/ https://reviews.llvm.org/D101156 Files: clang/lib/CodeGen/CodeGenModule.cpp

[PATCH] D101156: [Clang] Support a user-defined __dso_handle

2021-05-24 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. I went ahead and implemented a fix for EmitGlobalVarDefinition. Please let me know what approach is preferable: Diff 339986 or Diff 347341. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101156/new/

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-04-26 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. The option was added in D19658 and D13979 , but I'm not sure how it is supposed to work for SystemV ABI. GCC emits an error if long double type is used with -mno-x87: "test.c:37:1: error: x87 register

[PATCH] D100591: [Clang][AArch64] Disable rounding of return values for AArch64

2021-04-26 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 340517. asavonic added a comment. Keep rounding of return values for big-endian targets. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100591/new/ https://reviews.llvm.org/D100591 Files:

[PATCH] D100591: [Clang][AArch64] Disable rounding of return values for AArch64

2021-04-26 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. In D100591#2711433 , @t.p.northover wrote: > On big-endian targets the rounding up to 64-bits (specified in the AAPCS) is > significant; it means that structs get passed in the high bits of `x0` rather > than low. E.g.

[PATCH] D101156: [Clang] Support a user-defined __dso_handle

2021-04-23 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. John, can you please review this patch? I originally wanted to add a diagnostic to prevent the crash in CG (PR49198), but the case seems easy enough to support. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101156/new/

[PATCH] D100591: [Clang][AArch64] Disable rounding of return values for AArch64

2021-04-22 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. Ping. Please let me know if the patch is acceptable for AArch64, or something else should be done to avoid overhead from rounding of return values. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100591/new/

[PATCH] D100591: [Clang][AArch64] Disable rounding of return values for AArch64

2021-05-04 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb451ecd86e13: [Clang][AArch64] Disable rounding of return values for AArch64 (authored by asavonic). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-03-18 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic created this revision. asavonic added a reviewer: andrew.w.kaylor. Herald added a subscriber: pengfei. asavonic requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch attempts to fix a compiler crash that occurs when `long

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-03-18 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. I'm not sure that this is the right approach, but I wanted to get feedback on how the issue should be fixed. Currently, the compiler crashes on almost any code with `long double` (excluding cases where CG does not properly disable x87): long double foo(long double x,

[PATCH] D100591: [Clang][AArch64] Disable rounding of return values for AArch64

2021-04-15 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added inline comments. Comment at: clang/test/CodeGen/arm64-arguments.c:53 -// CHECK: define{{.*}} i64 @f12() +// CHECK: define{{.*}} i24 @f11_packed() +struct s11_packed { char c; short s } __attribute__((packed)); I'm not sure if `i24` here is a

[PATCH] D100591: [Clang][AArch64] Disable rounding of return values for AArch64

2021-04-15 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic created this revision. asavonic added reviewers: rjmccall, dmgreen, t.p.northover, ostannard, sdesmalen, momchil.velikov, SjoerdMeijer. Herald added subscribers: mstorsjo, danielkiss, kristof.beyls. asavonic requested review of this revision. Herald added a project: clang. Herald added a

[PATCH] D100591: [Clang][AArch64] Disable rounding of return values for AArch64

2021-04-15 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. In D100591#2692599 , @rjmccall wrote: > I think the right thing to do here is to recognize generally that we're > emitting a mandatory tail call, and so suppress *all* the normal > transformations on the return value. I

[PATCH] D100225: [Clang][AArch64] Coerce integer return values through an undef vector

2021-04-11 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. In D100225#2681809 , @rjmccall wrote: > Why does the ABI "require" this to be returned as an i64 if some of the bits > are undefined? AArch64 ABI requires return values (of composite types) to be rounded up to 64 bits (see

[PATCH] D100225: [Clang][AArch64] Coerce integer return values through an undef vector

2021-04-09 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic created this revision. Herald added subscribers: danielkiss, kristof.beyls. asavonic requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. If target ABI requires coercion to a larger type, higher bits of the resulting value are supposed

[PATCH] D100225: [Clang][AArch64] Coerce integer return values through an undef vector

2021-04-11 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. So we can just remove this rounding from `classifyReturnType`? Thanks a lot John! I will upload this change as a separate review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100225/new/ https://reviews.llvm.org/D100225

[PATCH] D101156: [Clang] Support a user-defined __dso_handle

2021-04-23 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic created this revision. asavonic requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This fixes PR49198: Wrong usage of __dso_handle in user code leads to a compiler crash. `__dso_handle` variable is now created with a prefix to avoid

[PATCH] D109315: [clang] Check unsupported types in expressions

2021-09-09 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 371693. asavonic added a comment. - Reworded the diagnostic. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109315/new/ https://reviews.llvm.org/D109315 Files:

[PATCH] D109315: [clang] Check unsupported types in expressions

2021-09-10 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 371912. asavonic added a comment. Rebased Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109315/new/ https://reviews.llvm.org/D109315 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D109315: [clang] Check unsupported types in expressions

2021-09-13 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGec6c847179fd: [clang] Check unsupported types in expressions (authored by asavonic). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109315/new/

[PATCH] D98895: [X86][Draft] Disable long double type for -mno-x87 option

2021-09-06 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. Thanks @erichkeane. SPIR-V diagnostics seem to work fine. There are a few cases that are not handled, so I submitted D109315 to review them separately. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D109315: [clang] Check unsupported types in expressions

2021-09-06 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic created this revision. asavonic added reviewers: erichkeane, Fznamznon. asavonic requested review of this revision. Herald added a reviewer: jdoerfert. Herald added subscribers: cfe-commits, sstefan1. Herald added a project: clang. The patch adds diagnostics for cases like: float F3 =

[PATCH] D109315: [clang] Check unsupported types in expressions

2021-09-06 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:10687 def err_device_unsupported_type -: Error<"%0 requires %select{|%2 bit size}1 %3 type support, but device " -"'%4' does not support it">; +: Error<"%select{|%1

[PATCH] D109315: [clang] Check unsupported types in expressions

2021-09-20 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic reopened this revision. asavonic added a comment. This revision is now accepted and ready to land. This is weird... Buildbot reported that `lock/omp_init_lock.c` test crashed with SIGSEGV, but I cannot reproduce this on my machine. I added a check for a null QualType; not sure if it

[PATCH] D109315: [clang] Check unsupported types in expressions

2021-09-20 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 373531. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109315/new/ https://reviews.llvm.org/D109315 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/include/clang/Sema/Sema.h

[PATCH] D109315: [clang] Check unsupported types in expressions

2021-10-15 Thread Andrew Savonichev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG3dbcea8b957a: Reland [clang] Check unsupported types in expressions (authored by asavonic). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D98895: [X86][clang] Disable long double type for -mno-x87 option

2021-10-22 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic updated this revision to Diff 381538. asavonic retitled this revision from "[X86][Draft] Disable long double type for -mno-x87 option" to "[X86][clang] Disable long double type for -mno-x87 option". asavonic edited the summary of this revision. asavonic added a comment. Herald added a

[PATCH] D114162: [X86][clang] Enable floating-point type for -mno-x87 option on 32-bits

2021-11-19 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added inline comments. Comment at: clang/lib/Basic/Targets/X86.cpp:385 - if (!HasX87) { -if (LongDoubleFormat == ::APFloat::x87DoubleExtended()) - HasLongDouble = false; -if (getTriple().getArch() == llvm::Triple::x86) - HasFPReturn = false; - } +

[PATCH] D114162: [X86][clang] Enable floating-point type for -mno-x87 option on 32-bits

2021-11-19 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added inline comments. Comment at: clang/lib/Basic/Targets/X86.cpp:385 - if (!HasX87) { -if (LongDoubleFormat == ::APFloat::x87DoubleExtended()) - HasLongDouble = false; -if (getTriple().getArch() == llvm::Triple::x86) - HasFPReturn = false; - } +

[PATCH] D114162: [X86][clang] Enable floating-point type for -mno-x87 option on 32-bits

2021-11-29 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic accepted this revision. asavonic added a comment. This revision is now accepted and ready to land. LGTM. We can also remove all code related to HasFPReturn, it is no longer needed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114162/new/

[PATCH] D98895: [X86][clang] Disable long double type for -mno-x87 option

2021-10-29 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:9573 - checkTypeSupport(NewFD->getType(), D.getBeginLoc(), NewFD); + if (D.getFunctionDefinitionKind() != FunctionDefinitionKind::Declaration) +checkTypeSupport(NewFD->getType(), D.getBeginLoc(),

[PATCH] D98895: [X86][clang] Disable long double type for -mno-x87 option

2021-10-29 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:9573 - checkTypeSupport(NewFD->getType(), D.getBeginLoc(), NewFD); + if (D.getFunctionDefinitionKind() != FunctionDefinitionKind::Declaration) +checkTypeSupport(NewFD->getType(), D.getBeginLoc(),

[PATCH] D98895: [X86][clang] Disable long double type for -mno-x87 option

2021-10-28 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. @pengfei, @erichkeane, please let me know if the patch is OK now, or anything else needs to be fixed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98895/new/ https://reviews.llvm.org/D98895

[PATCH] D98895: [X86][clang] Disable long double type for -mno-x87 option

2021-11-09 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. In D98895#3119064 , @erichkeane wrote: > In D98895#3119027 , @asavonic wrote: > >> In D98895#3118821 , @eandrews wrote: >> >>> This patch causes a

[PATCH] D98895: [X86][clang] Disable long double type for -mno-x87 option

2021-11-09 Thread Andrew Savonichev via Phabricator via cfe-commits
asavonic added a comment. In D98895#3118821 , @eandrews wrote: > This patch causes a regression. > > To reproduce - `clang -cc1 -fsycl-is-device -triple spir64 test.cpp` > > test.cpp:x:3: error: 'bar<__float128>' requires 128 bit size '__float128' >

  1   2   >