SuccessChanges

Summary

  1. [JITLink][MachO] Handle muliple symbols at same offset when splitting C-strings. (details)
  2. [docs] Fix load instructions in chapter 7 of the tutorial (details)
  3. [SROA] Avoid splitting loads/stores with irregular type (details)
  4. Interp.h - AddSubMulHelper - avoid APSInt::toString std::string wrapper. NFCI (details)
  5. JSONNodeDumper.cpp - VisitIntegerLiteral - avoid APSInt::toString std::string wrapper. NFCI (details)
  6. [clang] NFC: Rename rvalue to prvalue (details)
  7. Revert "[SROA] Avoid splitting loads/stores with irregular type" (details)
  8. [clang] NFC: rename SK_CastDerivedToBaseRValue to SK_CastDerivedToBasePRValue (details)
  9. Correct the behavior of va_arg checking in C++ (details)
  10. [ValueTypes][RISCV] Cap RVV fixed-length vectors by size (details)
  11. [AArch64LoadStoreOptimizer] Generate more STPs by renaming registers earlier (details)
  12. [OpenMP][Tools] Fix Archer for MACOS (details)
  13. [OpenMP][Tools] Cleanup memory pool used in Archer (details)
  14. [OpenMP][Tools] Fix Archer handling of task dependencies (details)
  15. [mlir] Expose a function to populate tensor constant bufferization patterns (details)
  16. [Test] Add more elaborate case of symbolic execution of 1-iteration loop (details)
Commit 82f8aef3deb196ad323a3ef57c03276c6e93a246 by Lang Hames
[JITLink][MachO] Handle muliple symbols at same offset when splitting C-strings.

The C-string section splitting support added in f9649d123db triggered an assert
("Duplicate canonical symbol at address") when multiple symbols were defined at
the the same offset within a C-string block (this triggered on arm64, where we
always add a block start symbol). The bug was caused by a failure to update the
record of the last canonical symbol address. The fix was to maintain this record
correctly, and move the auto-generation of the block-start symbol above the
handling for symbols defined in the object itself so that all symbols
(auto-generated and defined) are processed in address order.
The file was modifiedllvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp
Commit 391f9ef1aa8b28ef8bad4486576477c0700e43e9 by jim
[docs] Fix load instructions in chapter 7 of the tutorial

Loads in the first half of the chapter are missing the type argument.

Patched By: klao (Mihaly Barasz)

Reviewed By: Jim

Differential Revision: https://reviews.llvm.org/D90326
The file was modifiedllvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl07.rst
Commit 905f4eb537c118783969fded19e96fe6504c2956 by thatlemon
[SROA] Avoid splitting loads/stores with irregular type

Upon encountering loads/stores on types whose size is not a multiple of 8 bits the SROA pass would either trip an assertion or use logic that was not meant to work with such irregularly-sized types.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D99435
The file was modifiedllvm/lib/Transforms/Scalar/SROA.cpp
The file was addedllvm/test/Transforms/SROA/irregular-type.ll
Commit d806d11b14e1db7d5c5986d563e74ca972f0e5e6 by llvm-dev
Interp.h - AddSubMulHelper - avoid APSInt::toString std::string wrapper. NFCI

Pulled out of D103888 - use the underlying SmallString version directly
The file was modifiedclang/lib/AST/Interp/Interp.h
Commit f3fd36e590f4ca36e466801bee40497714df895c by llvm-dev
JSONNodeDumper.cpp - VisitIntegerLiteral - avoid APSInt::toString std::string wrapper. NFCI

Pulled out of D103888 - use the underlying SmallString version directly
The file was modifiedclang/lib/AST/JSONNodeDumper.cpp
Commit aef5d8fdc7d0d348125d5ecf4a13be5888eb1654 by mizvekov
[clang] NFC: Rename rvalue to prvalue

This renames the expression value categories from rvalue to prvalue,
keeping nomenclature consistent with C++11 onwards.

C++ has the most complicated taxonomy here, and every other language
only uses a subset of it, so it's less confusing to use the C++ names
consistently, and mentally remap to the C names when working on that
context (prvalue -> rvalue, no xvalues, etc).

Renames:
* VK_RValue -> VK_PRValue
* Expr::isRValue -> Expr::isPRValue
* SK_QualificationConversionRValue -> SK_QualificationConversionPRValue
* JSON AST Dumper Expression nodes value category: "rvalue" -> "prvalue"

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D103720
The file was modifiedclang/lib/CodeGen/CGOpenMPRuntime.cpp
The file was modifiedclang/lib/Sema/SemaType.cpp
The file was modifiedclang/test/AST/ast-dump-expr-json.cpp
The file was modifiedclang/test/AST/ast-dump-stmt-json.c
The file was modifiedclang/test/AST/ast-dump-funcs-json.cpp
The file was modifiedclang/test/AST/ast-dump-expr-json.c
The file was modifiedclang/test/AST/ast-dump-types-errors-json.cpp
The file was modifiedclang/test/AST/ast-dump-record-definition-data-json.cpp
The file was modifiedclang/test/AST/ast-dump-stmt-json.m
The file was modifiedclang/include/clang/Sema/Initialization.h
The file was modifiedclang/include/clang/Basic/Specifiers.h
The file was modifiedclang/lib/CodeGen/CGStmtOpenMP.cpp
The file was modifiedclang/lib/AST/ExprClassification.cpp
The file was modifiedclang/lib/CodeGen/CGExpr.cpp
The file was modifiedclang/lib/Analysis/BodyFarm.cpp
The file was modifiedclang/test/AST/multistep-explicit-cast-json.c
The file was modifiedclang/lib/CodeGen/CGExprScalar.cpp
The file was modifiedclang/lib/Sema/SemaLambda.cpp
The file was modifiedclang/lib/Sema/SemaTemplateInstantiate.cpp
The file was modifiedclang/lib/Sema/SemaFixItUtils.cpp
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp
The file was modifiedclang/lib/AST/JSONNodeDumper.cpp
The file was modifiedclang/lib/AST/DeclCXX.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp
The file was modifiedclang/include/clang/AST/ExprCXX.h
The file was modifiedclang/lib/StaticAnalyzer/Core/CallEvent.cpp
The file was modifiedclang/lib/Sema/SemaCoroutine.cpp
The file was modifiedclang/include/clang/AST/ExprObjC.h
The file was modifiedclang/test/AST/ast-dump-records-json.cpp
The file was modifiedclang/lib/Sema/SemaStmt.cpp
The file was modifiedclang/test/AST/ast-dump-stmt-json.cpp
The file was modifiedclang/lib/AST/Expr.cpp
The file was modifiedclang/lib/Sema/SemaTemplateInstantiateDecl.cpp
The file was modifiedclang/lib/AST/ExprConstant.cpp
The file was modifiedclang/lib/Sema/SemaDecl.cpp
The file was modifiedclang/test/AST/ast-dump-expr-json.m
The file was modifiedclang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp
The file was modifiedclang/lib/Analysis/ThreadSafety.cpp
The file was modifiedclang/lib/Sema/SemaStmtAsm.cpp
The file was modifiedclang/lib/Sema/TreeTransform.h
The file was modifiedclang/lib/Sema/SemaInit.cpp
The file was modifiedclang/lib/Sema/SemaCast.cpp
The file was modifiedclang/lib/Sema/SemaExprMember.cpp
The file was modifiedclang/lib/Sema/SemaLookup.cpp
The file was modifiedclang/lib/Sema/SemaDeclCXX.cpp
The file was modifiedclang/lib/CodeGen/CGObjC.cpp
The file was modifiedclang/lib/Sema/SemaObjCProperty.cpp
The file was modifiedclang/lib/Sema/SemaPseudoObject.cpp
The file was modifiedclang/test/AST/ast-dump-decl-json.m
The file was modifiedclang/lib/AST/ExprObjC.cpp
The file was modifiedclang/test/AST/ast-dump-decl-json.c
The file was modifiedclang/lib/Sema/SemaExprObjC.cpp
The file was modifiedclang/lib/Sema/SemaOverload.cpp
The file was modifiedclang/include/clang/AST/Expr.h
The file was modifiedclang/lib/AST/ExprConcepts.cpp
The file was modifiedclang/lib/Sema/SemaDeclAttr.cpp
The file was modifiedclang/lib/Sema/SemaTemplate.cpp
The file was modifiedclang/lib/Sema/SemaChecking.cpp
The file was modifiedclang/lib/Sema/SemaExpr.cpp
The file was modifiedclang-tools-extra/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp
The file was modifiedclang/lib/AST/TextNodeDumper.cpp
The file was modifiedclang/test/AST/ast-dump-objc-arc-json.m
The file was modifiedclang/test/AST/ast-dump-temporaries-json.cpp
The file was modifiedclang/test/AST/ast-dump-template-decls-json.cpp
The file was modifiedclang/test/AST/multistep-explicit-cast-json.cpp
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/lib/Sema/Sema.cpp
The file was modifiedclang/lib/CodeGen/CGBlocks.cpp
The file was modifiedclang/lib/Sema/SemaExprCXX.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
The file was modifiedclang/test/AST/ast-dump-if-json.cpp
The file was modifiedclang/lib/Frontend/Rewrite/RewriteModernObjC.cpp
The file was modifiedclang/lib/Frontend/Rewrite/RewriteObjC.cpp
The file was modifiedclang/lib/AST/ExprCXX.cpp
Commit 205cde63c70e017a71d1ec06377421f7733f2ad5 by thakis
Revert "[SROA] Avoid splitting loads/stores with irregular type"

This reverts commit 905f4eb537c118783969fded19e96fe6504c2956.
Breaks check-llvm on most (all?) bots, see https://reviews.llvm.org/D99435
The file was removedllvm/test/Transforms/SROA/irregular-type.ll
The file was modifiedllvm/lib/Transforms/Scalar/SROA.cpp
Commit c25572bf2993438f24b57d859d072e8b2aa975d2 by mizvekov
[clang] NFC: rename SK_CastDerivedToBaseRValue to SK_CastDerivedToBasePRValue

This is a follow up to the "rvalue-to-prvalue" rename at D103720.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Depends on D103720

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D103933
The file was modifiedclang/include/clang/Sema/Initialization.h
The file was modifiedclang/lib/Sema/SemaInit.cpp
Commit c92f505346b80fd053ef191bbc66810c9d564b0c by aaron
Correct the behavior of va_arg checking in C++

Clang checks whether the type given to va_arg will automatically cause
undefined behavior, but this check was issuing false positives for
enumerations in C++. The issue turned out to be because
typesAreCompatible() in C++ checks whether the types are *the same*, so
this uses custom logic if the type compatibility check fails.

This issue was found by a user on code like:

typedef enum {
  CURLINFO_NONE,
  CURLINFO_EFFECTIVE_URL,
  CURLINFO_LASTONE = 60
} CURLINFO;

...

__builtin_va_arg(list, CURLINFO); // false positive warning

Given that C++ defers to C for the rules around va_arg, the behavior
should be the same in both C and C++ and not diagnose because int and
CURLINFO are "compatible enough" types for va_arg.
The file was modifiedclang/lib/Sema/SemaExpr.cpp
The file was modifiedclang/test/SemaCXX/varargs.cpp
Commit 502edebd9d6eb4665add9fd5edaa2dd1b1b24298 by fraser
[ValueTypes][RISCV] Cap RVV fixed-length vectors by size

This patch changes RVV's policy for its supported list of fixed-length
vector types by capping by vector size rather than element count. Now
all 1024-byte vectors (of supported element types) are supported, rather
than all 256-element vectors.

This is a more natural fit for the architecture, and allows us to, for
example, improve the support for vector bitcasts.

This change necessitated the adding of some new simple types to avoid
"regressing" on the number of currently-supported vectors. We round out
the 1024-byte types by adding `v512i8`, `v1024i8`, `v512i16` and
`v512f16`.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D103884
The file was modifiedllvm/lib/CodeGen/ValueTypes.cpp
The file was modifiedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-bitcast-large-vector.ll
The file was modifiedllvm/include/llvm/CodeGen/ValueTypes.td
The file was modifiedllvm/utils/TableGen/CodeGenTarget.cpp
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
The file was modifiedllvm/test/CodeGen/RISCV/rvv/interleave-crash.ll
The file was modifiedllvm/include/llvm/Support/MachineValueType.h
Commit d96ea46629803641038ebe46d8cd512f8cf7e20f by meera.nakrani
[AArch64LoadStoreOptimizer] Generate more STPs by renaming registers earlier

Our initial motivating case was memcpy's with alignments > 16. The
loads/stores, to which small memcpy's expand, are kept together in
several places so that we get a sequence like this for a 64 bit copy:
LD w0
LD w1
ST w0
ST w1
The load/store optimiser can generate a LDP/STP w0, w1 from this because
the registers read/written are consecutive. In our case however, the
sequence is optimised during ISel, resulting in:
LD w0
ST w0
LD w0
ST w0
This instruction reordering allows reuse of registers. Since the registers
are no longer consecutive (i.e. they are the same), it inhibits LDP/STP
creation. The approach here is to perform renaming:
LD w0
ST w0
LD w1
ST w1
to enable the folding of the stores into a STP. We do not yet generate
the LDP due to a limitation in the renaming implementation, but plan to
look at that in a follow-up so that we fully support this case. While
this was initially motivated by certain memcpy's, this is a general
approach and thus is beneficial for other cases too, as can be seen
in some test changes.

Differential Revision: https://reviews.llvm.org/D103597
The file was modifiedllvm/test/CodeGen/AArch64/consthoist-gep.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
The file was modifiedllvm/test/CodeGen/AArch64/stp-opt-with-renaming.mir
The file was modifiedllvm/test/CodeGen/AArch64/ldst-opt.ll
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/byval-call.ll
Commit 82e4e505315b8df27e82c0e1cb9d5eb1aa7d45da by protze
[OpenMP][Tools] Fix Archer for MACOS

Archer uses weak symbol overloads of TSan functions to enable loading the tool
even if the application is not built with TSan. For MACOS the tool collects
the function pointer at runtime.
When adding the function entry/exit markers, we missed to add the functions
in the MACOS codepath.
This patch also replaces the repeated function lookup by a single initial
function lookup and fixes the disabling logic in RunningOnValgrind.

Differential Revision: https://reviews.llvm.org/D103607
The file was modifiedopenmp/tools/archer/ompt-tsan.cpp
Commit 08d8f1a958bd8be681e3e1f346be80818a83a556 by protze
[OpenMP][Tools] Cleanup memory pool used in Archer

The main motivation for reusing objects is that it helps to avoid creating and
leaking synchronization clocks in TSan. The reused object will reuse the
synchronization clock in TSan.

Before, new and delete operators were overloaded to get and return memory for
the object from/to the object pool.
This patch replaces the operator overloading with explicit static New/Delete
functions.

Objects for parallel regions and implicit tasks will always be recruited and
returned to the thread-local object pool. Only for explicit task, there is a
chance that an other thread completes the task and will free the object. This
patch optimizes the thread-local New/Delete calls by avoiding locks and only
lock if the pool is empty. Remote threads return the object into a separate
queue.

The chunk size for allocations is now decided based on page size. The objects
will also be aligned to cache lines avoiding false sharing.

This is the first patch in a series to provide better tasking support.

Differential Revision: https://reviews.llvm.org/D103606
The file was modifiedopenmp/tools/archer/tests/lit.cfg
The file was modifiedopenmp/tools/archer/README.md
The file was modifiedopenmp/tools/archer/ompt-tsan.cpp
Commit 639b3979310d8cec82b9b0a3ad3e64566244717f by protze
[OpenMP][Tools] Fix Archer handling of task dependencies

The current handling of dependencies in Archer has two flaws:

- annotation of dependency synchronization is not limited to sibling tasks
- annotation of in/out dependencies is based on the assumption, that dependency
  variables will rarely be byte-sized variables.

This patch introduces a map in the generating task to manage the dependency
variables for the child tasks. The map is only accesses from the generating
task, so no locking is necessary. This also limits the dependency-based
synchronization to sibling tasks.
This patch also introduces proper handling for new dependency types such as
mutexinoutset and inoutset.

Differential Revision: https://reviews.llvm.org/D103608
The file was modifiedopenmp/tools/archer/ompt-tsan.cpp
Commit c0db8d50ca3ceb1301b2ade2fb86c591a5b64e5c by benny.kra
[mlir] Expose a function to populate tensor constant bufferization patterns

This makes it easier to use it from other bufferization passes.

Differential Revision: https://reviews.llvm.org/D103838
The file was modifiedmlir/lib/Dialect/StandardOps/Transforms/TensorConstantBufferize.cpp
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Transforms/Passes.h
Commit 0120e6c295e42d3b9ed2cd125b1c9056a59fbcf6 by mkazantsev
[Test] Add more elaborate case of symbolic execution of 1-iteration loop
The file was modifiedllvm/test/Transforms/LoopDeletion/eval_first_iteration.ll