[OMPIRBuilder] Hoist alloca's to entry blocks of compiler-emitted GPU reduction functions
Fixes a bug in GPU reductions when `-O0` was used to compile GPU
reductions. There were invalid memory accesses at runtime for the
following example:
```fortran
program test_array_reduction()
integer :: red_array(1)
integer :: i
red_array = 0
!$omp target teams distribute parallel do reduction(+:red_array)
do i = 1, 100
red_array(1) = red_array(1) + 4422
end do
!$omp end target teams distribute parallel do
[10 lines not shown]
[lldb-dap] Add unknown request handler (#181109)
Added unknown request handler to avoid crash. Returning error in this
case looks better than stopping entire debug session.
[OFFLOAD] Add support for SPIRV to ompx (#179849)
After adding support to build device RTL for SPIRV, this PR will make an
ompx to use the DeviceRTL API when compiled for SPIRV
[clang] Clarify SourceLocation and (Char)SourceRange docs (#177400)
The current documentation leaves some questions unanswered to me, which
I'm trying to clarify here.
1. It was unclear how SourceLocation differed when referring to the
character level vs. the token level. Turns out there is no such
difference, and SourceLocation always refers to characters. This should
be made explicit in the docs.
2. It was unclear in which cases (Char)SourceRange is inclusive
(containing the endpoint) or exclusive (ending before the endpoint).
From my reading of the docs and investigating the behavior of different
AST nodes' `getSourceLoc()` result and `Lexer::getSourceText()`,
SourceRange is always inclusive and CharSourceRange is inclusive only as
a TokenRange, and exclusive as a CharRange. This is also consistent
matches with the documentation of the clang::transformer::after()
function in RangeSelector.h, where the question of inclusive/exclusive
ranges came up first for me.
[clang] NestedNameSpecifier typo correction fix (#181239)
This stops typo correction from considering template parameters as
candidates for a NestedNameSpecifier when it has a prefix itself.
I think this is better than the alternative of accepting these
candidates, but otherwise droping the prefix, because it seems more
far-fetched that someone would actually try to refer to a template
parameter this way.
Since this regression was never released, there are no release notes.
Fixes #167120
[clang][Sema] Avoid assert when diagnosing address-space qualified new/delete (#178424)
### Whats the error
Clang could assert when diagnosing new or delete on types in
language-specific address spaces (e.g. OpenCL __local), instead of
emitting a normal error.
### Why it happened
The diagnostics used getAddressSpaceAttributePrintValue(), which assumes
target-specific address spaces and asserts for language-defined ones
like
OpenCL.
### Whats the Fix
Explicitly check for language defined address spaces in new/delete
diagnostics and emit the error directly, avoiding the crashing path, Add
[2 lines not shown]
[llvm-otool] Fix error messages to use -p instead of --dis-symname (#181225)
Also fixes llvm-objdump error messages to print --dis-symname instead of
single dash option.
[VPlan] Run initial recipe simplification on VPlan0. (#176828)
In some cases, LV gets simplifyable IR as input. Directly apply
simplifications on the initial VPlan0 to avoid vectorization in cases
where the loop body can be folded away.
Using the end-to-end pipeline, this is relatively rare, but when
reducing test cases, the reduction often ends up with cases with trivial
folds. Rejecting those will result in more robust & realistic test
cases.
As follow-up, I also plan to add initial dead recipe removal.
Depends on https://github.com/llvm/llvm-project/pull/176795.
PR: https://github.com/llvm/llvm-project/pull/176828
[SCEV] Discard samesign when analyzing loop invariant exits (#181171)
If the predicate has samesign set, we could either perform the checks
with the unsigned predicate and return and unsigned invariant predicate,
or we could perform them with the signed predicate and return a signed
invariant predicate. The current implementation can end up mixing both,
using a signed predicate for one check and an unsigned one for the
other.
Avoid this by dropping the samesign flag.
Fixes https://github.com/llvm/llvm-project/issues/180870.
Revert "Revert "[WebAssembly] Mark extract.last.active as having invalid cost."" (#181342)
Reverts llvm/llvm-project#180942
Looks like something changed the cost model. Will investigate later.
[libc++][NFC] Simplify some overloads in fs::path a bit (#181053)
We can use `if constexpr` instead, removing a bit of code and making
things easier to read.
[OFFLOAD] Add support for host offloading device (#177307)
The purpose of this PR is to add support of host as an offloading device
to liboffload. Both OpenMP and sycl support offloading to a host as
their normal workflow and therefore would require such capability from
liboffload library.
Revert "[WebAssembly] Mark extract.last.active as having invalid cost." (#180942)
The failures should have been resolved with #180290 (which also added
WebAssembly tests).
This reverts commit 811fb223af2b3e2d68c99b346f4b75dcf3de3417.
[AArch64] Lower SETLE and SETLT vector CondCodes to FCMGT/FCMGE directly.
We previously checked that the compare was NoNan, but the "don't care"
condition codes can be set from known-values as well as nnan instructions.
Lower the vector condition codes directly so that they do not get scalarized
into many scalar instructions.