[Bazel] Fix Host target's exported headers to include windows (#213018)
When PR# 201283 added windows os select to the build of the Host target,
it missed the exported headers since the CI checks run only linux and
mac (and I hadn't gotten to this in my slow slog of windows bazel lldb
support). I found when translating to BUCK and running into this
compilation error on windows for buck2 built lldb.
Still cannot build and claude tells me the exclude is necessary to avoid
a duplicate.
claude assisted with bazel rule creation
[SLP]Recalculate gather costs after tree trimming
Gather node costs are computed against the set of vectorized nodes
available for reuse. Tree trimming changes that set, but the costs were
not recalculated: a gather that reused a trimmed-away vectorized value
kept its 0 cost, and the node transformed to a gather matched the same
sibling gather for a free reuse, so the buildvector cost was lost and
unprofitable trees were vectorized.
Recalculate costs of all gather nodes after trimming.
Fixes #212983
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/213034
[libc] Add struct passwd type, pwd.yaml, and pwd_utils parser (#212421)
Added struct passwd type definition, pwd.yaml header specification, and
parse_passwd_line utility returning ErrorOr<struct passwd> for
colon-separated
password file parsing with hermetic unit tests.
Note: Additional POSIX pwd.h functions (getpwuid, getpwnam, getpwuid_r,
getpwnam_r, fgetpwent) are omitted from this initial change and will be
added in follow-up PRs.
* Added libc/include/llvm-libc-types/struct_passwd.h and proxy header
* Added libc/include/pwd.yaml header specification
* Added pwd_utils.h and pwd_utils.cpp implementing ErrorOr<struct
passwd> parse_passwd_line
* Added pwd.h to target public headers for linux architectures
* Added unit tests in libc/test/src/pwd/pwd_utils_test.cpp
Assisted-by: Automated tooling, human reviewed.
[llvm-calc-occupancy] Fix build after SGPR queries moved to TargetParser (#213023)
Urgent buildbot fix for #208727.
That PR was developed before #209848, which moved the SGPR count queries
into TargetParser and removed
`AMDGPU::IsaInfo::getAddressableNumSGPRs()`, so
`llvm-calc-occupancy.cpp` fails to compile on current `main`:
```
llvm-calc-occupancy.cpp:229:41: error: no member named 'getAddressableNumSGPRs' in namespace 'llvm::AMDGPU::IsaInfo'
```
This switches to the equivalent
`GCNSubtarget::getAddressableNumSGPRs()`, which forwards to the
TargetParser version. All other `IsaInfo::*` calls in the file were
checked against the new API and are unaffected.
Verified locally: `ninja llvm-calc-occupancy` builds clean,
`llvm/test/tools/llvm-calc-occupancy` passes, and the reported
addressable SGPR count is unchanged (102 on gfx90a).
[offload][lit] Add jit unittest (#212860)
Basic test for the JIT path.
Context: https://github.com/llvm/llvm-project/pull/212823
---------
Signed-off-by: Nick Sarnie <nick.sarnie at intel.com>
[OpenMP] Restore loop variable values after loop-transformation constructs. (#212853)
This PR relands #208533 which was reverted in #212832 due to test
failures with iterator-based loops.
Original Change:
#208533 fixes loop variable finalization for OpenMP 6.0
loop-transformations constructs: tile, stripe, reverse, interchange and
fuse to comply with spec requirement page 371, lines 19-21. The spec
requires that "After the execution of the loop-transforming construct,
the loop-iteration variables of any of its transformation-affected loops
have the values that they would have without the loop-transforming
directive".
What's Fixed in This Reland:
The original implementation attempted to finalize all loop variables,
including iterators in range-based for loops (CXXForRangeStmt). This
caused issues because the finalization formula `final_value =
lower_bound + num_iterations * step` only applies to arithmetic types
(integers, floats).
[SPIRV] Drive DebugFunctionDefinition placement via begin/endInstruction
Replace the SPIRV-specific notifyMachineInstructionEmitted() callback with
DebugHandlerBase::beginInstruction()/endInstruction().
Keep notifyEntryLabelEmitted() for the synthesized entry OpLabel, which
has no MachineInstr.
[Hexagon] Fix ISel error: LLVM: cannot select -fmaximum (#211283)
This patch adds a custom lowering for FMAXIMUM.
FMAXIMUM is NaN-propagating, and currently, we
don't have any hexagon instruction to support
that behaviour. The patch is also extended to
cover FMINIMUM as well.
Check if any of the inputs are NaN. If so,
propagate the NaN to the output, otherwise
return the maximum/minimum of the inputs,
using ISD::FMINNUM/ISD::FMAXNUM to run
Hexagon's F2_sfmin/F2_sfmax when no operand
is NaN. NaN is propagated (rather than
replaced with a new ConstantFP NaN node) to
avoid triggering a wrong C2_MUX selection in
ISD::SELECT.
[X86] Lower scalar bf16 arithmetic on AVX10.2 via packed ops (#212245)
Currently basic(fadd/fsub/fmul/fdiv/fsqrt/fma) bf16 operations, as they
are not natively supported, are expanded to f32 operations.
However with AVX10.2 there are packed versions for these operations
which should be used instead and are enabled with this PR.
Since there is no native bf16 register class I instead go through f16
since it matches its size and register class.
This conversion will end up getting optimized away leaving only the
intended packed operation.
I used AI to double check and expand on comments.