[llubi] explain Byte.TagValue encoding trick (#201863)
This took me a while to understand in #185977 so let's make it more
explicit why `TagValue` can be so small.
[X86] Remove shouldCastAtomicLoadInIR; use DAG combine instead
Remove X86's shouldCastAtomicLoadInIR override that cast FP atomic
loads to integer at the IR level. Instead, handle this in a pre-legalize
DAG combine (combineAtomicLoad) that rewrites FP/FP-vector atomic loads
to integer atomic loads plus a bitcast.
This depends on #199310 which adds the necessary cmpxchg support for
non-integer atomic loads in AtomicExpand.
[LoopFusion] Remove unused DataLayout parameter (NFC) (#202009)
The LoopFuser constructor took a DataLayout reference that was never
stored or used, and run() computed it solely to pass it in. Drop both.
[X86][GlobalISel] Remove dependency on legal ruleset (#197374)
This fills in always legal rules, to remove the dependency on the legacy
ruleset. I'm not sure about the truncate rule but all tests pass. This
is not guaranteed to be all the rules, just the ones that appear in
tests.
[Clang] support C23 printf width length modifiers (#199991)
This patch adds `-Wformat` support for the C23 `wN` and `wfN` length
modifiers in `printf`/`scanf` format strings. #116962
Revert "[clang][driver][darwin] Hold onto full triples in Darwin SDKPlatformInfo (#200896)" (#202010)
This doesn't work for 32 bit arm because that usually gets converted to
thumb-apple-os, and that doesn't match arm-apple-os from
SDKSettings.json.
This reverts commit b89bb06afd069aa1b5e9f05ab692b3e6b41318c0.
[clang-format] Keep C++20 module/import decls on a single line (#199459)
This patch fixes #193676.
- Added `UnwrappedLineParser::parseModuleDecl()` to parse C++20 module
declarations.
- Adapted `parseCppModuleImport()` from #193834 and renamed it to
`parseImportDecl()`.
- Used the test cases from the same PR.
- Removed the invalid test cases and fixed an incorrect one in
`FormatTest.cpp`.
---------
Co-authored-by: Björn Schäpers <github at hazardy.de>
[CIR] Initialization of atomic aggregates with padding (#200668)
This patch adds support for the initialization of atomic aggregates with
padding. The changes include:
- During CIRGen, the type `_Atomic(T)` is represented by a CIR struct
`{T, sint8[padding_size]}` if the size of `_Atomic(T)` does not match
the size of `T`. `padding_size` is the difference between the size of
`_Atomic(T)` and `T`.
- CIRGen for the initialization process is updated to handle the
initialization of such CIR struct values.
[libc++] Assume that <atomic> is available (#199674)
We always define either `_LIBCPP_HAS_C_ATOMIC_IMP` or
`_LIBCPP_HAS_GCC_ATOMIC_IMP`, so we can remove any special handling of
not having an `<atomic>` header.
[TableGen] Recompute only the affected UberSet when inheriting reg units (#200962)
CodeGenRegBank::computeRegUnitWeights() runs a fixpoint over all registers;
normalizeWeight() calls the global computeUberWeights() -- which rescans
every UberRegSet, every register, and all of their register units -- each time
a register inherits register units from its subregisters.
Most of the time, we do better by just recomputing one register's
UberSet.
On AMDGPU (21266 registers) with this change, the "Compute reg unit
weights" phase drops from 3.19s to 0.70s (4.5x speedup) and
-gen-register-info improves overall from ~16.4s to ~14.0s.
Revert "[clang-cl] Add new option `/pathmap:<from>=<to>` to replace the path prefix <from> with <to>." (#201981)
Reverts llvm/llvm-project#198664
Causes test failures on
[llvm-clang-aarch64-darwin](https://lab.llvm.org/buildbot/#/builders/190)
bot.
Enforce an EdgeSet (implemented as a map) invariant: each map entry
represents at least one edge. That is, a map key should not exist if
the corresponding value is empty.
[clang-cl] Add new option `/pathmap:<from>=<to>` to replace the path prefix <from> with <to>. (#198664)
This option matches MSVC options and does the path substitution for the
file references in the preprocessor macros, debug and coverage information.
This option acts as a clang's ``-ffile-prefix-map=value`` and with some
known differences in behaviour with original CL's option that do not affect
the functionality:
* nomalizes the macro prefix map pathes -- removes `./` and uses the target's
platform-specific path separator character when exanding the preprocessor
macros -- ``-ffile-reproducible`` (but not the debug and coverage prefix maps).
* does not require ``/experimental:deterministic`` as by MSVC. It needed for
removing a hostname from a mangling hash gen, but clang-cl does not use
a hostname when generates the hashes.
Known issues:
* does not remap the pathes within PCH/PCM files.
[docs] Rewrite LangRef.md as Markdown
Tracking issue: #201242
This change migrates LangRef by itself, since it is quite a large
document with many idiosyncracies.
LangRef makes extensive use of definition lists, which apparently
require enabling the deflist MyST extension in Sphinx conf.py. In part
because definition list boundaries are controlled by indentation,
several of them required manual fixups to get the nesting right. Some of
the issues were pre-existing broken indentation, but this should now be
much better.
I have a verification script that tracks all anchors and ensures that
all previous anchors are carried over to the new document, so no
mid-document links are broken.
[CIR] Fix CIR Test failures after unnamed_addr restored to vtables (#201962)
We had previously removed the `unnamed_addr` keyword check from our
vtable checks for OGCG because it was temporarily not emitted in that
case. The OGCG output has been modified again, so we need to update our
checks again.
The CIR output has not changed.