[X86] isGuaranteedNotToBeUndefOrPoison - enable disabled cases (#248080)
#245048 left PCMPEQ and some truncation and conversion opcodes
commented out in isGuaranteedNotToBeUndefOrPoisonForTargetNode until
they had test coverage. Since then a VZEXT_MOVL after them is kept,
because the known-zero upper elements aren't proven free of undef or
poison. That costs a movq, or a vpxor and vpblendd for the saturating
truncates.
Enable them. computeKnownBitsForTargetNode already lists the same
truncation and conversion opcodes as zeroing their upper elements, and
PCMPEQ is elementwise like PCMPGT and can't create undef or poison.
Assisted-by: Claude Code (Claude Opus 5.5)
Hexagon: Track condset source kills without kill flags in ExpandCondsets (#243176)
Kill flags are no longer allowed on virtual registers, but this pass
was relying on them as intra-pass scratch state to decide which
transfers can be predicated and cleared them at the end with
clearKillFlags. Record the killing source operands in a pass-local set
instead. This also drops the kill recomputation in the final liveness
update, whose result was only ever discarded.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[flang][OpenMP] Unify reduction identifier symbol resolution (#246112)
TASK_REDUCTION and IN_REDUCTION never resolved procedure-designator
reduction identifiers while ordinary REDUCTION did. Resolve all three
using the same helper.
Assisted-by: AI
NAS-145585 / 28.0.0-BETA.1 / Fix iSCSI test typos and isns error masking (#20360)
Calling `c.deregister_initiator()` in failed connection `finally` block
will always fail and mask the real error.
[SPARC] Add more tests for dynamic v2i32 vector extracts (#239917)
Follow-up to #222348. Cover the original extract_v2i8 reproducer,
which reaches the custom lowering through v2i8 -> v2i32 type
promotion, as well as v2i16, an illegal i64 index and an extract
from a bitcast f64. Also run the test for sparcel.
Assisted-by: Claude Opus 5.5
[AMDGPU] Keep soft waitcnts unchanged until SIInsertWaitcnts converges (#244689)
On the first visit to a loop header, a soft waitcnt whose `lgkmcnt`
simplifies away but whose `vmcnt` is still needed was rewritten and
promoted (or merged into a preceding hard wait). The revisit through the
back edge then lost the `lgkmcnt(0)`, so the `s_barrier` after a release
fence no longer waited for the loop's LDS store. Like #220357, keep soft
waitcnts unchanged until the pass converges, and let a hard waitcnt
carry what each visit needs.
gfx950 runtime reproducer: 20/20 launches read stale LDS before, 0/20
after. Other test changes: in 14 tests the wait moves past meta
instructions (emitted code unchanged), and `expand-waitcnt-profiling.ll`
now expands the release-fence wait on gfx9-gfx11.
Fixes: LCOMPILER-3291
Assisted-by: Claude Opus 5.5
[InstSimplify] Avoid unnecessary flag drops in unused select operands (#248387)
In simplifyWithOpsReplaced(), if the select has a constant condition,
don't simplify the non-demanded value operand. This avoid unnecessarily
dropping its flags.
Fixes a regression from
https://github.com/llvm/llvm-project/pull/247632.
[Attributor] Don't seed functions without exact definitions in the light pass (#241934)
attributor-light seeded AAs for every function, including those without
an exact definition (e.g. `linkonce_odr`), which is most functions in
C++ code. Skip them to save compile time, as `FunctionAttrs` does. The
full Attributor still seeds them.
This loses some attributes on these functions and on call sites inside
them (see the `nonnull.ll` change).
CTMark objects are unchanged.
With `-attributor-enable=light`, a full `clang -O3` compile of
tramp3d-v4 takes 12% fewer instructions.
Running only attributor-light on CTMark bitcode: tramp3d-v4 -23%,
kimwitu++ -4%, sqlite3 -0.5%.
Co-authored-by: Matt Arsenault <Matthew.Arsenault at amd.com>
Assisted-by: Claude Opus 5.5
[AST] Avoid base-to-derived cast in Redeclarable constructor (#238335)
Redeclarable<decl_type>::Redeclarable previously initialized First by
evaluating static_cast<decl_type *>(this) inside the Redeclarable base
class constructor.
At the point where the Redeclarable base subobject constructor runs, the
derived decl_type constructor has not yet begun execution and the object
vtable pointer has not yet been updated to decl_type. When compiled with
Control Flow Integrity enabled for derived casts
(-fsanitize=cfi-derived-cast), downcasting this from Redeclarable<T> *
to decl_type * during base class construction fails the CFI vtable check
at runtime.
Pass the derived this pointer (which already has static type decl_type
*) directly from each CRTP subclass constructor to Redeclarable(const
ASTContext &Ctx, decl_type *First). This avoids any base-to-derived
downcast during construction while keeping getFirstDecl() a branchless
load. Add a unit test in DeclTest verifying getFirstDecl(),
[2 lines not shown]