[OpenMP][Offload] Add `LIBOMPTARGET_TREAT_ATTACH_AUTO_AS_ALWAYS` to treat `attach(auto)` as `attach(always)`. (#172382)
This is needed as a way to support older code that was expecting
unconditional attachment to happen for cases like:
```c
int *p;
int x;
#pragma omp targret enter data map(p) // (A)
#pragma omp target enter data map(x) // (B)
p = &x;
// By default, this does NOT attach p and x
#pragma omp target enter data map(p[0:0]) // (C)
```
When the environment variable is set, such maps, where both the pointer
and the pointee already have corresponding copies on the device, but are
not attached to one another, will be attached as-if OpenMP 6.1 TR14's
`attach(always)` map-type-modifier was specified on `(C)`.
[CI] Make premerge advisor exit with code 0 if failures are explained
This will mark the CI as green if the premerge advisor is able to
explain all of the failures. We have seen many false negatives (failures
not explained that should be), but no false positives (failures
explained that should not be) so far.
Reviewers: cmtice
Pull Request: https://github.com/llvm/llvm-project/pull/172394
[CI] Use the exit code from the premerge advisor
This patch makes it so that we use an exit code determined by the
premerge advisor rather than whatever exit code was returned by the
failing command. This is intended for making it so that we can mark the
CI as green if all of the failures are explained as either flaky or
already failing at HEAD. For now we just propagate whatever the last
command returned.
Reviewers: cmtice
Pull Request: https://github.com/llvm/llvm-project/pull/172393
[Codegen][NewPM] Explicitly Nest Passes in CodegenPassBuilder (#169867)
This implements the major piece of
https://discourse.llvm.org/t/rfc-codegen-new-pass-manager-pipeline-construction-design/84659,
making it explicit when we break the function pipeline up.
We essentially get rid of the AddPass and AddMachinePass helpers and
replace them with explicit functions for the pass types. The user then
needs to explicitly call flushFPMstoMPM before breaking.
This is sort of a hybrid of the current construction and what the RFC
proposed. The alternative would be passing around FunctionPassManagers
and having the pipeline actually explicitly constructed. I think this
compromises ergonomics slightly (needing to pass a FPM in many more
places). It is also nice to assert that the function pass manager is
empty when adding a module pass, which is easier when CodegenPassBuilder
owns the FPM and MFPM.
AMDGPU: Avoid introducing unnecessary fabs in fast fdiv lowering (#172553)
If the sign bit of the denominator is known 0, do not emit the fabs.
Also, extend this to handle min/max with fabs inputs.
I originally tried to do this as the general combine on fabs, but
it proved to be too much trouble at this time. This is mostly
complexity introduced by expanding the various min/maxes into
canonicalizes, and then not being able to assume the sign bit
of canonicalize (fabs x) without nnan.
This defends against future code size regressions in the atan2 and
atan2pi library functions.
[sanitizer_common] Fix missing `check-sanitizer` deps under LLVM_ENABLE_RUNTIMES (#170817)
`COMPILER_RT_STANDALONE_BUILD` is set when doing a
`LLVM_ENABLE_RUNTIMES` build. This prevents the sanitizer runtimes from
being added as dependencies to `check-sanitizer`. Currently, if you make
runtime changes and then run `check-sanitizer` you won't actually be
testing a rebuilt runtime.
I don't follow why `COMPILER_RT_STANDALONE_BUILD` is even relevant here
(was it ever?), so the right thing to do may be to remove the check
entirely instead of adding `OR LLVM_RUNTIMES_BUILD` like I'm doing
here..
rdar://165894534
[clang][NFC] `getAsVoidPointer` and `getFromVoidPointer` should deal in pointers to `const`
Rather than just blindly assuming we can modify the data pointed to by a `const void *`, just accept and return `const`-qualified pointers. This eliminates a `const_cast` and makes a `reinterpret_cast` no longer act as a `const_cast`.