SuccessChanges

Summary

  1. [libc] Add strspn implementation and std::bitset (details)
  2. [OpenMP] Fix `present` diagnostic for array extension (details)
  3. [OpenMP] Fix `target data` exit for array extension (details)
  4. [WebAssembly] Fix types in wasm_simd128.h and add tests (details)
  5. [InstCombine] add tests for icmp with mul nsw/nuw; NFC (details)
  6. [InstCombine] fold icmp with 'mul nsw/nuw' and constant operands (details)
Commit f3b41502554f2948ad00531dde7c3f53973de960 by gyurgyikcp
[libc] Add strspn implementation and std::bitset

Reviewed By: sivachandra, abrachet

Differential Revision: https://reviews.llvm.org/D85103
The file was addedlibc/src/string/strspn.h
The file was modifiedlibc/utils/CPP/CMakeLists.txt (diff)
The file was modifiedlibc/config/linux/x86_64/entrypoints.txt (diff)
The file was addedlibc/test/utils/CPP/CMakeLists.txt
The file was addedlibc/utils/CPP/Bitset.h
The file was modifiedlibc/src/string/CMakeLists.txt (diff)
The file was modifiedlibc/test/utils/CMakeLists.txt (diff)
The file was addedlibc/test/src/string/strspn_test.cpp
The file was addedlibc/test/utils/CPP/bitset_test.cpp
The file was modifiedlibc/test/src/string/CMakeLists.txt (diff)
The file was addedlibc/src/string/strspn.cpp
The file was modifiedlibc/config/linux/aarch64/entrypoints.txt (diff)
Commit 41b1aefecb9447620dd182b0352abed0df05665c by jdenny.ornl
[OpenMP] Fix `present` diagnostic for array extension

For example, without this patch, the following fails as expected with
or without the `present` modifier, but the `present` modifier doesn't
produce its usual diagnostic:

```
#pragma omp target data map(alloc: arr[0:2])
{
   #pragma omp target map(present, tofrom: arr[0:100]) // not fully present
   ;
}
```

Reviewed By: grokos, vzakhari

Differential Revision: https://reviews.llvm.org/D85320
The file was addedopenmp/libomptarget/test/mapping/present/target_array_extension.c
The file was addedopenmp/libomptarget/test/mapping/present/target_data_array_extension.c
The file was modifiedopenmp/libomptarget/src/device.cpp (diff)
Commit 8c8bb128dfd09f84b27b9e732cf1355582b1d019 by jdenny.ornl
[OpenMP] Fix `target data` exit for array extension

For example:

```
#pragma omp target data map(tofrom:arr[0:100])
{
   #pragma omp target exit data map(delete:arr[0:100])
   #pragma omp target enter data map(alloc:arr[98:2])
}
```

Without this patch, the transfer at the end of the target data region
is broken and fails depending on the target device.  According to my
read of the spec, the transfer shouldn't even be attempted because
`arr[0:100]` isn't (fully) present there.  To fix that, this patch
makes `DeviceTy::getTgtPtrBegin` return null for this case.

Reviewed By: grokos

Differential Revision: https://reviews.llvm.org/D85342
The file was modifiedopenmp/libomptarget/src/omptarget.cpp (diff)
The file was addedopenmp/libomptarget/test/mapping/target_data_array_extension_at_exit.c
Commit f496950001c47724867912d863858db0a81b4309 by tlively
[WebAssembly] Fix types in wasm_simd128.h and add tests

47f7174ffa changed the types used in the Wasm SIMD builtin functions,
but not all of their uses in wasm_simd128.h were updated. This commit
fixes wasm_simd128.h and adds tests to make sure similar problems do
not pass uncaught in the future.

Differential Revision: https://reviews.llvm.org/D85347
The file was modifiedclang/lib/Headers/wasm_simd128.h (diff)
The file was addedclang/test/Headers/wasm.c
The file was addedclang/test/Headers/wasm.cpp
Commit 0315571a19bb27da1b68088b07f1368747dd9438 by spatel
[InstCombine] add tests for icmp with mul nsw/nuw; NFC
The file was modifiedllvm/test/Transforms/InstCombine/icmp-mul.ll (diff)
Commit c66169136fe667d653ff40ba4bd9f6047702e93c by spatel
[InstCombine] fold icmp with 'mul nsw/nuw' and constant operands

This also removes a more specific fold that only handled icmp with 0.

https://rise4fun.com/Alive/sdM9

  Name: mul nsw with icmp eq
  Pre: (C1 != 0) && (C2 % C1) == 0
  %a = mul nsw i8 %x, C1
  %r = icmp eq i8 %a, C2
    =>
  %r = icmp eq i8 %x, C2 / C1

  Name: mul nuw with icmp eq
  Pre: (C1 != 0) && (C2 %u C1) == 0
  %a = mul nuw i8 %x, C1
  %r = icmp eq i8 %a, C2
    =>
  %r = icmp eq i8 %x, C2 /u C1

  Name: mul nsw with icmp ne
  Pre: (C1 != 0) && (C2 % C1) == 0
  %a = mul nsw i8 %x, C1
  %r = icmp ne i8 %a, C2
    =>
  %r = icmp ne i8 %x, C2 / C1

  Name: mul nuw with icmp ne
  Pre: (C1 != 0) && (C2 %u C1) == 0
  %a = mul nuw i8 %x, C1
  %r = icmp ne i8 %a, C2
    =>
  %r = icmp ne i8 %x, C2 /u C1
The file was modifiedllvm/test/Transforms/InstCombine/icmp-mul.ll (diff)
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCompares.cpp (diff)