| #
20898784 |
| 30-Sep-2020 |
Ties Stuij <[email protected]> |
[ARM] Follow AACPS standard for volatile bit-fields access width
This patch resumes the work of D16586. According to the AAPCS, volatile bit-fields should be accessed using containers of the widht o
[ARM] Follow AACPS standard for volatile bit-fields access width
This patch resumes the work of D16586. According to the AAPCS, volatile bit-fields should be accessed using containers of the widht of their declarative type. In such case: ``` struct S1 { short a : 1; } ``` should be accessed using load and stores of the width (sizeof(short)), where now the compiler does only load the minimum required width (char in this case). However, as discussed in D16586, that could overwrite non-volatile bit-fields, which conflicted with C and C++ object models by creating data race conditions that are not part of the bit-field, e.g. ``` struct S2 { short a; int b : 16; } ``` Accessing `S2.b` would also access `S2.a`.
The AAPCS Release 2020Q2 (https://documentation-service.arm.com/static/5efb7fbedbdee951c1ccf186?token=) section 8.1 Data Types, page 36, "Volatile bit-fields - preserving number and width of container accesses" has been updated to avoid conflict with the C++ Memory Model. Now it reads in the note: ``` This ABI does not place any restrictions on the access widths of bit-fields where the container overlaps with a non-bit-field member or where the container overlaps with any zero length bit-field placed between two other bit-fields. This is because the C/C++ memory model defines these as being separate memory locations, which can be accessed by two threads simultaneously. For this reason, compilers must be permitted to use a narrower memory access width (including splitting the access into multiple instructions) to avoid writing to a different memory location. For example, in struct S { int a:24; char b; }; a write to a must not also write to the location occupied by b, this requires at least two memory accesses in all current Arm architectures. In the same way, in struct S { int a:24; int:0; int b:8; };, writes to a or b must not overwrite each other. ```
I've updated the patch D16586 to follow such behavior by verifying that we only change volatile bit-field access when: - it won't overlap with any other non-bit-field member - we only access memory inside the bounds of the record - avoid overlapping zero-length bit-fields.
Regarding the number of memory accesses, that should be preserved, that will be implemented by D67399.
Reviewed By: ostannard
Differential Revision: https://reviews.llvm.org/D72932
show more ...
|
| #
06bc685f |
| 25-Sep-2020 |
Vedant Kumar <[email protected]> |
[ubsan] nullability-arg: Fix crash on C++ member pointers
Extend -fsanitize=nullability-arg to handle call sites which accept C++ member pointers.
rdar://62476022
Differential Revision: https://re
[ubsan] nullability-arg: Fix crash on C++ member pointers
Extend -fsanitize=nullability-arg to handle call sites which accept C++ member pointers.
rdar://62476022
Differential Revision: https://reviews.llvm.org/D88336
show more ...
|
| #
d6f3f612 |
| 08-Sep-2020 |
Ties Stuij <[email protected]> |
Revert "[ARM] Follow AACPS standard for volatile bit-fields access width"
This reverts commit 514df1b2bb1ecd1a33327001ea38a347fd2d0380.
Some of the buildbots got llvm-lit errors on CodeGen/volatile
Revert "[ARM] Follow AACPS standard for volatile bit-fields access width"
This reverts commit 514df1b2bb1ecd1a33327001ea38a347fd2d0380.
Some of the buildbots got llvm-lit errors on CodeGen/volatile.c
show more ...
|
| #
514df1b2 |
| 28-Aug-2020 |
Ties Stuij <[email protected]> |
[ARM] Follow AACPS standard for volatile bit-fields access width
This patch resumes the work of D16586. According to the AAPCS, volatile bit-fields should be accessed using containers of the widht o
[ARM] Follow AACPS standard for volatile bit-fields access width
This patch resumes the work of D16586. According to the AAPCS, volatile bit-fields should be accessed using containers of the widht of their declarative type. In such case: ``` struct S1 { short a : 1; } ``` should be accessed using load and stores of the width (sizeof(short)), where now the compiler does only load the minimum required width (char in this case). However, as discussed in D16586, that could overwrite non-volatile bit-fields, which conflicted with C and C++ object models by creating data race conditions that are not part of the bit-field, e.g. ``` struct S2 { short a; int b : 16; } ``` Accessing `S2.b` would also access `S2.a`.
The AAPCS Release 2020Q2 (https://documentation-service.arm.com/static/5efb7fbedbdee951c1ccf186?token=) section 8.1 Data Types, page 36, "Volatile bit-fields - preserving number and width of container accesses" has been updated to avoid conflict with the C++ Memory Model. Now it reads in the note: ``` This ABI does not place any restrictions on the access widths of bit-fields where the container overlaps with a non-bit-field member or where the container overlaps with any zero length bit-field placed between two other bit-fields. This is because the C/C++ memory model defines these as being separate memory locations, which can be accessed by two threads simultaneously. For this reason, compilers must be permitted to use a narrower memory access width (including splitting the access into multiple instructions) to avoid writing to a different memory location. For example, in struct S { int a:24; char b; }; a write to a must not also write to the location occupied by b, this requires at least two memory accesses in all current Arm architectures. In the same way, in struct S { int a:24; int:0; int b:8; };, writes to a or b must not overwrite each other. ```
Patch D16586 was updated to follow such behavior by verifying that we only change volatile bit-field access when: - it won't overlap with any other non-bit-field member - we only access memory inside the bounds of the record - avoid overlapping zero-length bit-fields.
Regarding the number of memory accesses, that should be preserved, that will be implemented by D67399.
Differential Revision: https://reviews.llvm.org/D72932
The following people contributed to this patch: - Diogo Sampaio - Ties Stuij
show more ...
|
| #
19e883fc |
| 26-Aug-2020 |
Christopher Tetreault <[email protected]> |
[SVE] Remove calls to VectorType::getNumElements from clang
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D82582
|
| #
160ff837 |
| 03-Aug-2020 |
Saiyedul Islam <[email protected]> |
[OpenMP][AMDGCN] Support OpenMP offloading for AMDGCN architecture - Part 3
Provides AMDGCN and NVPTX specific specialization of getGPUWarpSize, getGPUThreadID, and getGPUNumThreads methods. Adds te
[OpenMP][AMDGCN] Support OpenMP offloading for AMDGCN architecture - Part 3
Provides AMDGCN and NVPTX specific specialization of getGPUWarpSize, getGPUThreadID, and getGPUNumThreads methods. Adds tests for AMDGCN codegen for these methods in generic and simd modes. Also changes the precondition in InitTempAlloca to be slightly more permissive. Useful for AMDGCN OpenMP codegen where allocas are created with a cast to an address space.
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D84260
show more ...
|
| #
36036aa7 |
| 13-Jul-2020 |
David Blaikie <[email protected]> |
Reapply "Rename/refactor isIntegerConstantExpression to getIntegerConstantExpression"
Reapply 49e5f603d40083dce9c05796e3cde3a185c3beba which had been reverted in c94332919bd922032e979b3ae3ced5ca5bdf
Reapply "Rename/refactor isIntegerConstantExpression to getIntegerConstantExpression"
Reapply 49e5f603d40083dce9c05796e3cde3a185c3beba which had been reverted in c94332919bd922032e979b3ae3ced5ca5bdf9650.
Originally reverted because I hadn't updated it in quite a while when I got around to committing it, so there were a bunch of missing changes to new code since I'd written the patch.
Reviewers: aaron.ballman
Differential Revision: https://reviews.llvm.org/D76646
show more ...
|
| #
c9433291 |
| 13-Jul-2020 |
David Blaikie <[email protected]> |
Revert "Rename/refactor isIntegerConstantExpression to getIntegerConstantExpression"
Broke buildbots since I hadn't updated this patch in a while. Sorry for the noise.
This reverts commit 49e5f603d
Revert "Rename/refactor isIntegerConstantExpression to getIntegerConstantExpression"
Broke buildbots since I hadn't updated this patch in a while. Sorry for the noise.
This reverts commit 49e5f603d40083dce9c05796e3cde3a185c3beba.
show more ...
|
| #
49e5f603 |
| 23-Mar-2020 |
David Blaikie <[email protected]> |
Rename/refactor isIntegerConstantExpression to getIntegerConstantExpression
There is a version that just tests (also called isIntegerConstantExpression) & whereas this version is specifically used w
Rename/refactor isIntegerConstantExpression to getIntegerConstantExpression
There is a version that just tests (also called isIntegerConstantExpression) & whereas this version is specifically used when the value is of interest (a few call sites were actually refactored to calling the test-only version) so let's make the API look more like it.
Reviewers: aaron.ballman
Differential Revision: https://reviews.llvm.org/D76646
show more ...
|
| #
2da9572a |
| 09-Jul-2020 |
cchen <[email protected]> |
[OPENMP50] extend array section for stride (Parsing/Sema/AST)
Reviewers: ABataev, jdoerfert
Reviewed By: ABataev
Subscribers: yaxunl, guansong, arphaman, sstefan1, cfe-commits, sandoval, dreachem
[OPENMP50] extend array section for stride (Parsing/Sema/AST)
Reviewers: ABataev, jdoerfert
Reviewed By: ABataev
Subscribers: yaxunl, guansong, arphaman, sstefan1, cfe-commits, sandoval, dreachem
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82800
show more ...
|
| #
6aab27ba |
| 05-Jul-2020 |
sstefan1 <[email protected]> |
[OpenMPIRBuilder][Fix] Move llvm::omp::types to OpenMPIRBuilder.
Summary: D82193 exposed a problem with global type definitions in `OMPConstants.h`. This causes a race when running in thinLTO mode.
[OpenMPIRBuilder][Fix] Move llvm::omp::types to OpenMPIRBuilder.
Summary: D82193 exposed a problem with global type definitions in `OMPConstants.h`. This causes a race when running in thinLTO mode. Types now live inside of OpenMPIRBuilder to prevent this from happening.
Reviewers: jdoerfert
Subscribers: yaxunl, hiraditya, guansong, dexonsmith, aaron.ballman, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D83176
show more ...
|
| #
80e15b45 |
| 04-Jun-2020 |
Fady Ghanim <[email protected]> |
[Clang][OpenMP][OMPBuilder] Moving OMP allocation and cache creation code to OMPBuilderCBHelpers
Summary: Modified the OMPBuilderCBHelpers in the following ways: - Moved location of class definition
[Clang][OpenMP][OMPBuilder] Moving OMP allocation and cache creation code to OMPBuilderCBHelpers
Summary: Modified the OMPBuilderCBHelpers in the following ways: - Moved location of class definition and deleted all constructors - Moved OpenMP-specific address allocation of local variables - Moved threadprivate variable creation for the current thread
Reviewers: jdoerfert
Subscribers: yaxunl, guansong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79676
show more ...
|
| #
51e4aa87 |
| 14-Jun-2020 |
Tyker <[email protected]> |
attempt to fix failing buildbots after 3bab88b7baa20b276faaee0aa7ca87f636c91877
Prevent IR-gen from emitting consteval declarations
Summary: with this patch instead of emitting calls to consteval f
attempt to fix failing buildbots after 3bab88b7baa20b276faaee0aa7ca87f636c91877
Prevent IR-gen from emitting consteval declarations
Summary: with this patch instead of emitting calls to consteval function. the IR-gen will emit a store of the already computed result.
show more ...
|
| #
550c4562 |
| 15-Jun-2020 |
Kirill Bobyrev <[email protected]> |
Revert "Prevent IR-gen from emitting consteval declarations"
This reverts commit 3bab88b7baa20b276faaee0aa7ca87f636c91877.
This patch causes test failures: http://lab.llvm.org:8011/builders/clang-c
Revert "Prevent IR-gen from emitting consteval declarations"
This reverts commit 3bab88b7baa20b276faaee0aa7ca87f636c91877.
This patch causes test failures: http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/17260
show more ...
|
| #
3bab88b7 |
| 14-Jun-2020 |
Tyker <[email protected]> |
Prevent IR-gen from emitting consteval declarations
Summary: with this patch instead of emitting calls to consteval function. the IR-gen will emit a store of the already computed result.
Reviewers:
Prevent IR-gen from emitting consteval declarations
Summary: with this patch instead of emitting calls to consteval function. the IR-gen will emit a store of the already computed result.
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D76420
show more ...
|
| #
c9a52de0 |
| 03-Jun-2020 |
Akira Hatanaka <[email protected]> |
[CodeGen] Simplify the way lifetime of block captures is extended
Rather than pushing inactive cleanups for the block captures at the entry of a full expression and activating them during the creati
[CodeGen] Simplify the way lifetime of block captures is extended
Rather than pushing inactive cleanups for the block captures at the entry of a full expression and activating them during the creation of the block literal, just call pushLifetimeExtendedDestroy to ensure the cleanups are popped at the end of the scope enclosing the block expression.
rdar://problem/63996471
Differential Revision: https://reviews.llvm.org/D81624
show more ...
|
| #
8f3f88d2 |
| 01-Jun-2020 |
Florian Hahn <[email protected]> |
[Matrix] Implement matrix index expressions ([][]).
This patch implements matrix index expressions (matrix[RowIdx][ColumnIdx]).
It does so by introducing a new MatrixSubscriptExpr(Base, RowIdx, Col
[Matrix] Implement matrix index expressions ([][]).
This patch implements matrix index expressions (matrix[RowIdx][ColumnIdx]).
It does so by introducing a new MatrixSubscriptExpr(Base, RowIdx, ColumnIdx). MatrixSubscriptExprs are built in 2 steps in ActOnMatrixSubscriptExpr. First, if the base of a subscript is of matrix type, we create a incomplete MatrixSubscriptExpr(base, idx, nullptr). Second, if the base is an incomplete MatrixSubscriptExpr, we create a complete MatrixSubscriptExpr(base->getBase(), base->getRowIdx(), idx)
Similar to vector elements, it is not possible to take the address of a MatrixSubscriptExpr. For CodeGen, a new MatrixElt type is added to LValue, which is very similar to VectorElt. The only difference is that we may need to cast the type of the base from an array to a vector type when accessing it.
Reviewers: rjmccall, anemet, Bigcheese, rsmith, martong
Reviewed By: rjmccall
Differential Revision: https://reviews.llvm.org/D76791
show more ...
|
| #
79689817 |
| 01-Jun-2020 |
Christopher Tetreault <[email protected]> |
[SVE] Eliminate calls to default-false VectorType::get() from Clang
Reviewers: efriedma, david-arm, fpetrogalli, ddunbar, rjmccall
Reviewed By: fpetrogalli, rjmccall
Subscribers: tschuett, rkruppe
[SVE] Eliminate calls to default-false VectorType::get() from Clang
Reviewers: efriedma, david-arm, fpetrogalli, ddunbar, rjmccall
Reviewed By: fpetrogalli, rjmccall
Subscribers: tschuett, rkruppe, psnobl, dmgreen, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80323
show more ...
|
| #
62f3ef2b |
| 18-May-2020 |
Eli Friedman <[email protected]> |
[CGCall] Annotate references with "align" attribute.
If we're going to assume references are dereferenceable, we should also assume they're aligned: otherwise, we can't actually dereference them.
S
[CGCall] Annotate references with "align" attribute.
If we're going to assume references are dereferenceable, we should also assume they're aligned: otherwise, we can't actually dereference them.
See also D80072.
Differential Revision: https://reviews.llvm.org/D80166
show more ...
|
| #
a6a237f2 |
| 18-May-2020 |
Anastasia Stulova <[email protected]> |
[OpenCL] Added addrspace_cast operator in C++ mode.
This operator is intended for casting between pointers to objects in different address spaces and follows similar logic as const_cast in C++.
Tag
[OpenCL] Added addrspace_cast operator in C++ mode.
This operator is intended for casting between pointers to objects in different address spaces and follows similar logic as const_cast in C++.
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60193
show more ...
|
| #
11aa3707 |
| 14-May-2020 |
Eli Friedman <[email protected]> |
StoreInst should store Align, not MaybeAlign
This is D77454, except for stores. All the infrastructure work was done for loads, so the remaining changes necessary are relatively small.
Differentia
StoreInst should store Align, not MaybeAlign
This is D77454, except for stores. All the infrastructure work was done for loads, so the remaining changes necessary are relatively small.
Differential Revision: https://reviews.llvm.org/D79968
show more ...
|
| #
10658691 |
| 11-May-2020 |
Florian Hahn <[email protected]> |
[Matrix] Add matrix type to Clang.
This patch adds a matrix type to Clang as described in the draft specification in clang/docs/MatrixSupport.rst. It introduces a new option -fenable-matrix, which c
[Matrix] Add matrix type to Clang.
This patch adds a matrix type to Clang as described in the draft specification in clang/docs/MatrixSupport.rst. It introduces a new option -fenable-matrix, which can be used to enable the matrix support.
The patch adds new MatrixType and DependentSizedMatrixType types along with the plumbing required. Loads of and stores to pointers to matrix values are lowered to memory operations on 1-D IR arrays. After loading, the loaded values are cast to a vector. This ensures matrix values use the alignment of the element type, instead of LLVM's large vector alignment.
The operators and builtins described in the draft spec will will be added in follow-up patches.
Reviewers: martong, rsmith, Bigcheese, anemet, dexonsmith, rjmccall, aaron.ballman
Reviewed By: rjmccall
Differential Revision: https://reviews.llvm.org/D72281
show more ...
|
| #
215dc2e2 |
| 14-Apr-2020 |
Ayke van Laethem <[email protected]> |
[AVR] Use the correct address space for non-prototyped function calls
Some function declarations like this:
void foo();
do not have a type declaration, for that you'd use:
void foo(void);
[AVR] Use the correct address space for non-prototyped function calls
Some function declarations like this:
void foo();
do not have a type declaration, for that you'd use:
void foo(void);
Clang internally bitcasts the variadic function declaration to a function pointer, but doesn't use the correct address space on AVR. This commit fixes that.
This fix is necessary to let Clang compile compiler-rt for AVR.
Differential Revision: https://reviews.llvm.org/D78125
show more ...
|
| #
bab6df86 |
| 12-Apr-2020 |
Richard Smith <[email protected]> |
Rework how UuidAttr, CXXUuidofExpr, and GUID template arguments and constants are represented.
Summary: Previously, we treated CXXUuidofExpr as quite a special case: it was the only kind of expressi
Rework how UuidAttr, CXXUuidofExpr, and GUID template arguments and constants are represented.
Summary: Previously, we treated CXXUuidofExpr as quite a special case: it was the only kind of expression that could be a canonical template argument, it could be a constant lvalue base object, and so on. In addition, we represented the UUID value as a string, whose source form we did not preserve faithfully, and that we partially parsed in multiple different places.
With this patch, we create an MSGuidDecl object to represent the implicit object of type 'struct _GUID' created by a UuidAttr. Each UuidAttr holds a pointer to its 'struct _GUID' and its original (as-written) UUID string. A non-value-dependent CXXUuidofExpr behaves like a DeclRefExpr denoting that MSGuidDecl object. We cache an APValue representation of the GUID on the MSGuidDecl and use it from constant evaluation where needed.
This allows removing a lot of the special-case logic to handle these expressions. Unfortunately, many parts of Clang assume there are only a couple of interesting kinds of ValueDecl, so the total amount of special-case logic is not really reduced very much.
This fixes a few bugs and issues: * PR38490: we now support reading from GUID objects returned from __uuidof during constant evaluation. * Our Itanium mangling for a non-instantiation-dependent template argument involving __uuidof no longer depends on which CXXUuidofExpr template argument we happened to see first. * We now predeclare ::_GUID, and permit use of __uuidof without any header inclusion, better matching MSVC's behavior. We do not predefine ::__s_GUID, though; that seems like a step too far. * Our IR representation for GUID constants now uses the correct IR type wherever possible. We will still fall back to using the {i32, i16, i16, [8 x i8]} layout if a definition of struct _GUID is not available. This is not ideal: in principle the two layouts could have different padding.
Reviewers: rnk, jdoerfert
Subscribers: arphaman, cfe-commits, aeubanks
Tags: #clang
Differential Revision: https://reviews.llvm.org/D78171
show more ...
|
| #
6f64daca |
| 15-Apr-2020 |
Benjamin Kramer <[email protected]> |
Upgrade calls to CreateShuffleVector to use the preferred form of passing an array of ints
No functionality change intended.
|