[IRBuilder] Use ptrtoaddr in CreatePtrDiff() (#181855)
Make CreatePtrDiff() emit the pattern `ptrtoaddr(p1)-ptrtoaddr(p2)`.
This makes a few changes:
* The return type is now the address type instead of hardcoded to i64.
I've adjusted callers to deal with this where they didn't already.
* Don't use `ConstantExpr::getSizeOf()` and instead get the actual size
from DataLayout. These sizeof expressions will be removed as part of the
ptradd migration.
* Add a convenience overload without the element type, for the case
where you want a pure pointer difference.
I also adjusted some OpenMP code to consistently use zext for sizes, as
I had issues updating the test coverage otherwise (as we ended up
randomly picking zext or sext depending on the exact code path).
tr: fix class handling in unicode world
toupper/tolower logic was only handled for CCLASS_TOUPPER and
CCLASS_TOLOWER, add support for CCLASS ([:alpha:])
PR: 219900
MFC After: 1 week
(cherry picked from commit 625dc44832cd760be3d7242d8e21a530c7e32bfc)
tr: fix class handling in unicode world
toupper/tolower logic was only handled for CCLASS_TOUPPER and
CCLASS_TOLOWER, add support for CCLASS ([:alpha:])
PR: 219900
MFC After: 1 week
(cherry picked from commit 625dc44832cd760be3d7242d8e21a530c7e32bfc)
[Clang][HLSL] Start emitting structured GEP instruction (#177332)
StructuredGEP is a new LLVM intrinsic which will allow to emit proper
logical SPIR-V or DXIL. To properly stage this change going across FE,
BE and optimizations, this commits adds a new flag:
- `-fexperimental-emit-sgep`
When used, this flag will allow compatible frontends to emit the new
instructions. This will also allow us to migrate tests bit by bit,
adding the flag to each migrated test as we make progress on the
implementation.
Once the frontend migration complete, the flag will remain, and work on
the backend will start. Compatible backends like SPIR-V will first allow
both instructions, but then, depending on a target bit similar to
`requiresStructuredCFG`, will declare that they require the SGEP
instruction and will start enforcing it.
Once the whole chain completed, the flag will be defaulted to true and
removed, finishing the migration.
[LoopIdiomVectorize] Test all needles when vectorising find_first_of loops. (#179298)
Fixes #179187 - as described in the issue, the current FindFirstByte
transformation in LoopIdiomVectorizePass will incorrectly early-exit as
soon as a needle matching a search element is found, even if a previous
search element could match a subsequent needle.
This patch ensures all needles are tested before we return a matching
search element.
[mlirbc] Serialize dense elements attr i1 using packed (#182233)
Extra cost is in serialization layer localized while resulting in
smaller bytecode files, this also keeps the format compatible with what
was previously.
ncurses: merge update to ncurses 6.6
6.6 is ABI compatible with 6.5 (tested with abidiff)
Remove html documentation to ease updates
MFC After: 1 month
(cherry picked from commit 68ad2b0d7af2a3571c4abac9afa712f9b09b721c)
[llvm-readobj, ELF] Support reading binary with more than PN_XNUM segments.
FreeBSD coredump uses program headers to store mmap information. It is possible
for program to use more than PN_XNUM mmaps. Therefore, we implement the support
of PN_XNUM in readelf.
[AArch64] Fold MIN/MAX(Vec[0], Vec[1]) to VECREDUCE_MIN/MAX(Vec) (#181162)
If we have a lowering for `VECREDUCE_MIN/MAX` this is generally more
efficient than the scalar expansion.