Changes

Summary

  1. [MLIR] Introduce scf.execute_region op (details)
  2. [LoopDeletion] Break backedge if we can prove that the loop is exited on 1st iteration (try 3) (details)
  3. Revert D104028 "[llvm][Inliner] Add an optional PriorityInlineOrder" (details)
  4. [ORC] Add support for dumping objects to the C API. (details)
  5. [clang] Exclude function pointers on DefaultedComparisonAnalyzer (details)
  6. [ORC] Use uint8_t rather than char for RPC wrapper-function calls. (details)
  7. [ORC][C-bindings] Re-order object transform function arguments. (details)
  8. [libclang] Fix error handler in translateSourceLocation. (details)
  9. [analyzer] Handle NTTP invocation in CallContext.getCalleeDecl() (details)
  10. [DAG] SelectionDAG::computeKnownBits - use APInt::insertBits to merge subvector knownbits. NFCI. (details)
  11. [mlir] Add notes about using external interface application. (details)
  12. [clang] Implement P2266 Simpler implicit move (details)
  13. [HWASan] Run LAM tests with -hwasan-generate-tags-with-calls. (details)
  14. RISCV: simplify a test case for RISCV (NFCI) (details)
  15. Fix build failure on 32 bit Arm (details)
Commit 18c8c934d8584f706dfca9e633f0f89cefe3688e by uday
[MLIR] Introduce scf.execute_region op

Introduce the execute_region op that is able to hold a region which it
executes exactly once. The op encapsulates a CFG within itself while
isolating it from the surrounding control flow. Proposal discussed here:
https://llvm.discourse.group/t/introduce-std-inlined-call-op-proposal/282

execute_region enables one to inline a function without lowering out all
other higher level control flow constructs (affine.for/if, scf.for/if)
to the flat list of blocks / CFG form. It thus allows the benefit of
transforms on higher level control flow ops available in the presence of
the inlined calls. The inlined calls continue to benefit from
propagation of SSA values across their top boundary. Functions won’t
have to remain outlined until later than desired.  Abstractions like
affine execute_regions, lambdas with implicit captures could be lowered
to this without first lowering out structured loops/ifs or outlining.
But two potential early use cases are of: (1) an early inliner (which
can inline functions by introducing execute_region ops), (2) lowering of
an affine.execute_region, which cleanly maps to an scf.execute_region
when going from the affine dialect to the scf dialect.

Differential Revision: https://reviews.llvm.org/D75837
The file was modifiedmlir/test/Dialect/SCF/canonicalize.mlir
The file was modifiedmlir/test/Dialect/SCF/invalid.mlir
The file was modifiedmlir/utils/vim/syntax/mlir.vim
The file was modifiedmlir/lib/Dialect/SCF/SCF.cpp
The file was modifiedmlir/test/Dialect/SCF/ops.mlir
The file was modifiedmlir/include/mlir/Dialect/SCF/SCFOps.td
Commit de92287cf8d1b07516b7e006a54529f174d4f5ef by mkazantsev
[LoopDeletion] Break backedge if we can prove that the loop is exited on 1st iteration (try 3)

This patch handles one particular case of one-iteration loops for which SCEV
cannot straightforwardly prove BECount = 1. The idea of the optimization is to
symbolically execute conditional branches on the 1st iteration, moving in topoligical
order, and only visiting blocks that may be reached on the first iteration. If we find out
that we never reach header via the latch, then the backedge can be broken.

This implementation uses InstSimplify. SCEV version was rejected due to high
compile time impact.

Differential Revision: https://reviews.llvm.org/D102615
Reviewed By: nikic
The file was modifiedllvm/test/Transforms/LoopDeletion/unreachable-loops.ll
The file was modifiedllvm/test/Transforms/LoopDeletion/zero-btc.ll
The file was modifiedllvm/lib/Transforms/Scalar/LoopDeletion.cpp
The file was modifiedllvm/test/Transforms/LoopDeletion/eval_first_iteration.ll
Commit 93183a41b962ce21ea168357172aaf00cdca5bd9 by taolq
Revert D104028 "[llvm][Inliner] Add an optional PriorityInlineOrder"
The file was modifiedllvm/test/Transforms/Inline/inline_invoke.ll
The file was modifiedllvm/test/Transforms/Inline/last-callsite.ll
The file was modifiedllvm/test/Transforms/Inline/monster_scc.ll
The file was modifiedllvm/test/Transforms/Inline/inline_call.ll
The file was modifiedllvm/lib/Transforms/IPO/Inliner.cpp
Commit cec8e69f01c3374cb38c6683058381b96fab8f89 by Lang Hames
[ORC] Add support for dumping objects to the C API.

Provides ObjectTransformLayer APIs, a getter to access the
ObjectTransformLayer member of LLJIT, and the DumpObjects utility
to make construction of a dump-to-disk transform easy.

An example showing how the new APIs can be used has been added in
llvm/examples/OrcV2Examples/OrcV2CBindingsDumpObjects.
The file was modifiedllvm/include/llvm-c/LLJIT.h
The file was addedllvm/examples/OrcV2Examples/OrcV2CBindingsDumpObjects/CMakeLists.txt
The file was addedllvm/examples/OrcV2Examples/OrcV2CBindingsDumpObjects/OrcV2CBindingsDumpObjects.c
The file was modifiedllvm/include/llvm-c/Orc.h
The file was modifiedllvm/examples/OrcV2Examples/CMakeLists.txt
The file was modifiedllvm/lib/ExecutionEngine/Orc/OrcV2CBindings.cpp
Commit 7ddd15cd5dea76a19a9c5315e2a9903d74a49be8 by mizvekov
[clang] Exclude function pointers on DefaultedComparisonAnalyzer

This implements a more comprehensive fix than was done at D95409.
Instead of excluding just function pointer subobjects, we also
exclude any user-defined function pointer conversion operators.

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

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D103855
The file was modifiedclang/test/CXX/class/class.compare/class.spaceship/p2.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/lib/Sema/SemaDeclCXX.cpp
Commit cbfb12469ba312c8ff513397b29bef470f151caa by Lang Hames
[ORC] Use uint8_t rather than char for RPC wrapper-function calls.

This partially reverts 838490de7ed, which broke some Solaris bots. Apparently
Solaris defines int8_t as char rather than signed char, which made the
SerializationTypeName<char> specialization a redefinition.

This partial revert isolates use of uint8_t buffers to ORC-RPC handling of
wrapper functions only. The TargetProcessControl::runWrapper method will
continue to use char buffers.
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Shared/Serialization.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/OrcRPCTargetProcessControl.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/TargetProcess/OrcRPCTPCServer.h
Commit 8962c68ad007a525f9daa987c99eda57e0d0069a by Lang Hames
[ORC][C-bindings] Re-order object transform function arguments.

ObjInOut is an in-out parameter not a return value argument, so by convention
it should come after the context value (Ctx).
The file was modifiedllvm/lib/ExecutionEngine/Orc/OrcV2CBindings.cpp
The file was modifiedllvm/examples/OrcV2Examples/OrcV2CBindingsDumpObjects/OrcV2CBindingsDumpObjects.c
The file was modifiedllvm/include/llvm-c/Orc.h
Commit fd569a11b585d13cdceac2d890c2beda0fa5f0eb by simon.tatham
[libclang] Fix error handler in translateSourceLocation.

Given an invalid SourceLocation, translateSourceLocation will call
clang_getNullLocation, and then do nothing with the result. But
clang_getNullLocation has no side effects: it just constructs and
returns a null CXSourceLocation value.

Surely the intention was to //return// that null CXSourceLocation to
the caller, instead of throwing it away and pressing on anyway.

Reviewed By: miyuki

Differential Revision: https://reviews.llvm.org/D104442
The file was modifiedclang/tools/libclang/CXSourceLocation.h
Commit cc2ef195560999d0690a8d8805ea811270e38f26 by vsavchenko
[analyzer] Handle NTTP invocation in CallContext.getCalleeDecl()

This fixes a crash in MallocChecker for the situation when operator new (delete) is invoked via NTTP  and makes the behavior of CallContext.getCalleeDecl(Expr) identical to CallEvent.getDecl().

Reviewed By: vsavchenko

Differential Revision: https://reviews.llvm.org/D103025
The file was modifiedclang/lib/StaticAnalyzer/Core/CheckerContext.cpp
The file was modifiedclang/test/Analysis/NewDelete-checker-test.cpp
Commit 7353beda4aa13187d1c9ba03015589272b157c61 by llvm-dev
[DAG] SelectionDAG::computeKnownBits - use APInt::insertBits to merge subvector knownbits. NFCI.

As noticed on D104472 we can use APInt::insertBits which will avoid a lot of temporary APInt creations
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Commit 7f7be19e6a5e0ebb3af04a624996fbc7cd06f209 by silvasean
[mlir] Add notes about using external interface application.

Differential Revision: https://reviews.llvm.org/D104489
The file was modifiedmlir/docs/Interfaces.md
Commit ced6b204d18e6eed611f8ebf27122ec19147ea7a by mizvekov
[clang] Implement P2266 Simpler implicit move

This Implements [[http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2266r1.html|P2266 Simpler implicit move]].

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

Reviewed By: Quuxplusone

Differential Revision: https://reviews.llvm.org/D99005
The file was modifiedclang/test/CXX/temp/temp.decls/temp.mem/p5.cpp
The file was modifiedclang/www/cxx_status.html
The file was modifiedclang/test/SemaObjCXX/block-capture.mm
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/test/CXX/expr/expr.prim/expr.prim.lambda/p4-cxx14.cpp
The file was modifiedclang/test/SemaCXX/deduced-return-type-cxx14.cpp
The file was modifiedclang/lib/Sema/SemaCoroutine.cpp
The file was modifiedclang/test/CXX/class/class.init/class.copy.elision/p3.cpp
The file was modifiedclang/test/SemaCXX/return-stack-addr.cpp
The file was modifiedclang/lib/Sema/SemaStmt.cpp
The file was modifiedclang/test/SemaCXX/constant-expression-cxx11.cpp
The file was modifiedclang/test/SemaCXX/coroutines.cpp
The file was modifiedclang/lib/Sema/Sema.cpp
The file was modifiedclang/test/SemaCXX/coroutine-rvo.cpp
The file was modifiedclang/lib/Sema/SemaType.cpp
The file was modifiedclang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-cxx14.cpp
The file was modifiedclang/lib/Sema/SemaExprCXX.cpp
The file was modifiedclang/test/SemaCXX/warn-return-std-move.cpp
The file was modifiedclang/test/CXX/drs/dr3xx.cpp
The file was modifiedclang/test/SemaCXX/constant-expression-cxx14.cpp
Commit 493565a4aa7cc3b48e2b5c51b541a438fc449217 by mascasa
[HWASan] Run LAM tests with -hwasan-generate-tags-with-calls.

The default callback instrumentation in x86 LAM mode uses ASLR bits
to randomly choose a tag, and thus has a 1/64 chance of choosing a
stack tag of 0, causing stack tests to fail intermittently.  By using
__hwasan_generate_tag to pick tags, we guarantee non-zero tags and
eliminate the test flakiness.

aarch64 doesn't seem to have this problem using thread-local addresses
to pick tags, so perhaps we can remove this workaround once we implement
a similar mechanism for LAM.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D104470
The file was modifiedcompiler-rt/lib/hwasan/hwasan.cpp
The file was modifiedcompiler-rt/test/hwasan/lit.cfg.py
Commit b30bc8cc5d51a0c61651bafd977eb6b1729ca471 by Saleem Abdulrasool
RISCV: simplify a test case for RISCV (NFCI)

The output of the object file is unimportant and entirely discarded.
Simply redirect the output to `/dev/null` or `NUL` as the case may be.
Additionally, the space between the labels is unimportant.  There is no
need to add space between the labels.  Two labels at the same address
are sufficient to generate the difference expression and should still
test the same behaviour.
The file was modifiedllvm/test/MC/RISCV/hilo-constaddr-expr.s
Commit 9777f3fd06e20237992883b2b4668582228a1f90 by omair.javaid
Fix build failure on 32 bit Arm

This patch fixes build failure caused by commit
f27e4548fc42876f66dac260ca3b6df0d5fd5fd6 on 32 bit arm.

Differential Revision: https://reviews.llvm.org/D103292
The file was modifiedlld/MachO/InputFiles.cpp