[PM] Make InvalidateAllAnalysesPass Optional (#196956)
Similar reasoning to 221a24e94f7b03ea881df34cc8867c58ac8fdb52. Making
this required means we end up with assertion failures in the LPM around
LCSSA.
This is a bit unfortunate given it would be nice to ensure we can
trivially invalidate analyses on optnone functions, but this matches the
old behavior and prevents and assertion failure for now.
[clang][NFC] Mark CWG988 as implemented and add a test (#196889)
[CWG988](https://wg21.link/cwg988) specifies that reference collapsing
is performed when trying to form a reference to a `decltype`. Clang
implements this since 2.7: https://godbolt.org/z/vYzKbv8x7 (and I
checked a few versions after that to make sure there were no
regressions).
[flang] Remove legacy (non-HLFIR) lowering and related options (#196205)
Drop the user-facing options that selected the legacy non-HLFIR lowering
path, the always-true `LowerToHighLevelFIR` lowering option, and the
descriptor-discretization debug switch:
- `-flang-experimental-hlfir` and `-flang-deprecated-no-hlfir` (flang
driver and `-fc1`)
- `-hlfir` / `--hlfir` (bbc)
- `--use-desc-for-alloc` (bbc, debug)
Remove every `if (lowerToHighLevelFIR()) { ... } else { ... }` branch in
`lib/Lower/`, keeping the HLFIR side. Delete the now-unused legacy
helpers in `Bridge.cpp` (`copyVarFIR`, both
`genNoHLFIRPointerAssignment`
overloads, the legacy block of `genAssignment`) and the always-empty
`createMutableProperties` together with its four dead helpers in
`Allocatable.cpp`. Drop the corresponding `alwaysUseBox` parameter from
`createMutableBox`.
[4 lines not shown]
[NFC][LLVM] Namespace cleanup in LegacyPassManagerTest (#196811)
Remove llvm namespace surrounding the entire file, and remove extra
indentation of the code within the anonymous namespace.
[lldb] Release output lock across blocking el_wgetc in DisplayCompletions (#196686)
DisplayCompletions held m_output_stream_sp->Lock() across the blocking
el_wgetc() call used by the "More (Y/n/a)" pager. Because the lock is a
recursive_mutex, this worked when Editline::Interrupt() ran on the same
thread (the synchronous SIGINT handler), but deadlocks when Interrupt()
runs on another thread: it blocks on the lock and can never call
InterruptRead() to wake the editor thread.
Mirror the pattern already used by Editline::GetCharacter: drop the lock
across the blocking read and reacquire it afterward. The status check
and the "^C\n" / "\n" prints stay under the lock.
[StackColoring] Treat all stack slots as conservative with `returns_twice` call-sites (#196542)
Do not merge stack slots on disjoint paths if the function may call
setjmp/sigsetjmp, as the current algorithm defaults to computing
liveness analysis from the actual uses propagated through the CFG,
rather than leveraging lifetime markers, thus making it unsound with
`returns_twice` calls.
Fixes: https://github.com/llvm/llvm-project/issues/196468.
AMDGPU/GlobalISel: Switch to extended LLTs
Switch is required to be able to translate bfloat.
After the switch most of the codegen patterns now require explicit
type on register to match instead of LLT::scalar.
So we can still use LLT::scalar for type checks but new instructions
created during lowerings/combines need to use propper extended LLT.
inst select test sources fully switched to i32/f32 so patterns can match
for legalizer and regbanklegalize left as is (should probably be switched
as well)
New functionality worth noting is f16 and bitcast lowering to i32
f16 = g_bitcast i16
->
i32 = g_anyext i16
f16 = g_trunc i32
f16 = trunc i32 is legal
[clang][AST] Teach `CXXTypeidExpr::isMostDerived` to use `isEffectivelyFinal` (#196544)
Resolves #196476.
When a class is marked final, typeid on references to that type can be
resolved at compile time since the most-derived type is statically
known.
[CIR] Implement Namespace/global TLS CIR CodeGen (#196332)
Unlike local TLS, global TLS functions need to be initialized upon their
first use in a thread.
First, all attempts to 'get' said TLS global are replaced with calls to
a 'wrapper' function, which calls an 'init' alias function, then returns
the global. While classic codegen manages to omit this in simple cases
sometimes, this CIR implementation doesn't attempt to do such constant
folding/inlining. The call to the 'init' is omitted if there is no
ctor/dtor setup required, so sometimes the wrapper is just a 'no-op'
(intentionally!).
There are also two types of 'global' TLS functions: unordered, and
ordered. Unordered are typically variable templates, and their 'init'
function initializes JUST them. The rest are ordered, which requires all
ordered initializations to happen as soon as any happen.
The Wrapper:
[25 lines not shown]
AMDGPU/GlobalISel: Switch to extended LLTs
Switch is required to be able to translate bfloat.
After the switch most of the codegen patterns now require explicit
type on register to match instead of LLT::scalar.
So we can still use LLT::scalar for type checks but new instructions
created during lowerings/combines need to use propper extended LLT.
inst select test sources fully switched to i32/f32 so patterns can match
for legalizer and regbanklegalize left as is (should probably be switched
as well)
New functionality worth noting is f16 and bitcast lowering to i32
f16 = g_bitcast i16
->
i32 = g_anyext i16
f16 = g_trunc i32
f16 = trunc i32 is legal
[clang][bytecode] Fix a crash in Descriptor::getElemDataSize() (#196929)
`FIXED_SIZE_INT_TYPE_SWITCH` does not handle `PT_Bool`, handle it
explicitly before.
[clang][OpenMP 6.0][CodeGen] Codegen for declare_target 'local' clause (#196431)
Implement code generation for the OpenMP 6.0 declare_target 'local'
clause, which creates device-only variables with per-device static
storage.
A 'local' variable exists in the device image with its static
initializer and is always accessed directly by device code. This is the
same as 'to'/'enter' without unified shared memory, except that no
offload entry is registered.
Using 'device_type(nohost)' with 'local' is not yet supported. Sema
generates a warning and converts it to 'device_type(any)'.
Testing:
- Updated tests:
clang/test/OpenMP/declare_target_messages.cpp
clang/test/OpenMP/declare_target_ast_print.cpp
- New tests:
[2 lines not shown]
[gn] port 07b5dfe9473c6 + deps (LLVMABI dep in clang) (#196944)
Also adds build files for llvm/lib/ABI, which was dead code before
07b5dfe9473c6 (at least in the GN build).
[AMDGPU] Replace vdst_in opcode exclusion list with position check
Use getNamedOperandIdx to detect if vdst_in has already been added
by a prior converter, instead of maintaining a hardcoded opcode list.
[LV] Add test showing lack of gather/scatter can prevent if-convert
This introduces a new force-target-supports-gather-scatter-ops CLI
option for testing, as well a new isLegalMaskedLoadOrStore() helper.