[clang][bytecode] Don't check instance pointers for mutability (#205820)
The instance pointer being mutable is perfectly fine, we just can't read
anything from it.
This regresses a test case in `cxx11.cpp` where we now diagnose an extra
frame for `U(g1.u)`, but this seems correct since the read is happening
in the copy constructor of `U`.
[SPIR-V] Fix correction shift for i8 bitreverse in shader mode (#203829)
selectBitreverse16 hardcoded the post-reverse shift to 16, but it also
handles i8, where the reversed bits land in [31:24] and a shift of 16
truncated to always 0
Compute the shift as `32 - bitwidth` instead
[lldb][DIL] Fix infinite loop parsing cv-qualifiers in a C-style cast (#205087)
`ParseBuiltinType` loops over identifier tokens to assemble a builtin type
name. When it encountered the "const" or "volatile" qualifier it executed
`continue` to skip the qualifier without first advancing the lexer, so the loop
re-examined the same token forever. Any cast expression beginning with a
cv-qualifier therefore hung the parser before any evaluation took place.
Advance past the qualifier token before continuing the loop.
Reproduce (hangs forever before the fix):
```
$ ./bin/lldb ./bin/lldb
(lldb) breakpoint set -n main
(lldb) run
(lldb) frame variable '(const int)1'
```
[4 lines not shown]
[RISCV] Add assembler support to lower `la/lla` to `qc.e.li` (#205782)
This patch updates the `RISCVAsmParser::emitLoadLocalAddress` function
to enable lowering of the `la/lla` pseudos to `qc.e.li` from the
Qualcomm uC Xqcili extension.
[CIR] Add invariant attribute to cir.load (#204283)
Model LLVM's `!invariant.load` metadata on `cir.load` via an optional
`invariant` UnitAttr, lower it to the `llvm.load isInvariant` flag.
Update existing `LoadOp::create` call sites with new parameter.
[libc++] Cast 0 to `__locale_t` in `text_encoding.cpp` (#205882)
- As mentioned
https://github.com/llvm/llvm-project/pull/141312#issuecomment-4799649766,
platforms which define `locale_t` as not a pointer fail would fail to
compile. This should fix the picolibc case.
- As an aside, also disable the `encoding.pass.cpp` test for llvm-libc
as that also uses `__get_locale_encoding()`
[X86] Add target verifier with subtarget-dependent checks
Add an X86 TargetVerify, registered by triple, so the target-independent
TargetVerifierPass dispatches to it for X86 modules.
These checks depend on the features in a function's target-cpu /
target-features attributes, which the generic triple-only IR verifier
cannot see. The MCSubtargetInfo is built from those attributes, so no
TargetMachine is needed and the pass runs from generic pipelines:
- x86 instruction-set intrinsics (llvm.x86.avx/avx2/avx512.*) require
the matching AVX/AVX2/AVX-512 feature.
- 128/256-bit AVX-512 intrinsics additionally require AVX512VL.
- The x86_amx type requires AMX-TILE.
[DAGCombiner] Fold multiplication through vp_merge into `partial_reduce_*mla` (#205890)
DAGCombiner is already doing this right now:
```
partial_reduce_*mla(acc, sel(p, mul(*ext(a), *ext(b)), splat(0)), splat(1))
-> partial_reduce_*mla(acc, sel(p, a, splat(0)), b)
```
We should be able to have drop-in support for vp_merge (not for
vp_select though) as the select in the pattern above. This patch adds
such support.
The test is checking whether RISC-V's Zvdot4a8i instruction is
generated, as it depends on this pattern to fold away not just the
multiplication but also the sign / zero extensions.
[Hexagon] Add ShadowCallStack support (#200508)
Implement the software ShadowCallStack for Hexagon.
On Hexagon, r19 is used as the shadow stack pointer (reserved via
-ffixed-r19). On function entry the LR (r31) is saved to the shadow
stack and the pointer is advanced; on exit the LR is restored from the
shadow stack before returning.
Prologue sequence:
r19 = add(r19, #4)
memw(r19+#-4) = r31
Epilogue sequence (between deallocframe/jumpr r31):
r31 = memw(r19+#-4)
r19 = add(r19, #-4)
[5 lines not shown]
Make getaddrinfo(3) check hnok_lenient() earlier.
r1.60 added special handling for localhost names; this was done before the
hnok_lenient() check, ensure this validation applies to localhost names too.
ok florian
[AMDGPU] Fix overlapping insert crash during rewrite-agpr-copy-mfma
Fixes https://github.com/llvm/llvm-project/issues/204224
Guard against a possibly wrong interference result for a discontiguous
stack slot interval by using the entire range.
A spilled stack slot can have a discontiguous live interval, e.g. a single
value live across several disjoint segments:
[a, b) [c, d) ........gap........ [e, f)
with gaps where the slot is dead. The interference check previously only
considered the covered segments, so it could pick a PhysReg that is free
within them but busy inside a gap. Unspilling replaces the slot with a vreg
whose recomputed interval is continuous over [a, f) (it fills the gaps),
so assigning that PhysReg could overlap the value live in the gap and trip
the "Overlapping insert" assertion in LiveRegMatrix::assign. Checking
interference over the whole [a, f) hull avoids this.
[2 lines not shown]
[llubi] Add support for byval pointer arguments (#201852)
This patch adds support for the byval attribute. The hidden copy is
implemented as memcpy with the allocation size of the specified type.
See https://github.com/llvm/llvm-project/pull/205576 for more
information.
Revert "[Instrumentor] Add runtime examples: [1/N] A flop counter" (#205960)
This reverts commit 61cbfabb7ade682a64f516c871b2bacb1e3e324a.
Fails compiler-rt standalone builds, though, locally it works fine :(