[llvm] Avoid resolving `.incbin` during symbol collection (#172920)
With IO sandboxing enabled, Clang requires all FS accesses happen
through the one "true" VFS instance. That instance is currently not
being propagated into the assembly parser, and doing so would be super
involved. This triggers sandbox violations whenever an `.incbin`
directive is encountered, since the parser needs the VFS to open the
file.
However, it seems that `asm()` directives are only parsed to get the
symbols of an LLVM module, which cannot be affected by `.incbin`
directives. This PR adds an option to the asm parser to avoid resolving
`.incbin` directives when collecting module symbols, avoiding the
sandbox violation.
[SemaHLSL] Warn when a local resource is re-assigned to non-unique global resource (#182101)
Generate a warning whenever a local resource is (re-)assigned such that
it is not guaranteed to map to a single unique global resource.
An error is not generated during sema because simple DCE or constant
folding might resolve the assignment to be to a unique global resource.
Instead, an error will be reported when trying to resolve the resource
access in the `dxil-resource-access` pass, implemented
[here](https://github.com/llvm/llvm-project/pull/182106).
Resolves https://github.com/llvm/llvm-project/issues/179303.
[HIP] Fix wrong triple being passed to offload-bundler (#184195)
Summary:
I made a previous fix that stopped us from hard-coding x64 host in the
HIP fatbinaries we made. However, this then triggered this failure where
we were passing the wrong host triple. Now we will use the aux-triple
for offloading toolchains.
[SelectionDAG] Pass DemandedElts to isKnownNeverZero for extend nodes (#183624)
Fixes #183042
This patch updates `SelectionDAG::isKnownNeverZero` to forward the
`DemandedElts` mask when analyzing `ISD::ZERO_EXTEND` and
`ISD::SIGN_EXTEND` nodes.
[mlir][acc] Replace terminators with scf.yield in wrapMultiBlockRegionWithSCFExecuteRegion (#183758)
When wrapping a multi-block region in `scf.execute_region`, replace
`func::ReturnOp` (if flang `convertFuncReturn` is set) and
`acc::YieldOp` in all the blocks with `scf.yield` so the region has a
valid SCF terminator.
[HWASan] [MTE] support double lifetime.end in same BB
We can just ignore the second one, because it will always be a no-op.
Reviewers: pcc, usama54321, vitalybuka
Reviewed By: vitalybuka
Pull Request: https://github.com/llvm/llvm-project/pull/183809
[HLSL] Reintroduce dx.disable_optimizations to set DisableOptimization Shader Flag (#180069)
This patch removes optnone from HLSL entry functions and instead uses
`dx.disable_optimizations` module flag to know when to enable
`DisableOptimization` Shader Flag. This is part of: #167936
---------
Co-authored-by: Joao Saffran <jderezende at microsoft.com>
[DAG] isKnownNeverZero - add ISD::SRA/SRL DemandedElts handling and tests (#183577)
This patch updates `SelectionDAG::isKnownNeverZero` to support
`ISD::SRA`/`ISD::SRL` by forwarding the `DemandedElts` mask to its
operands.
Fixes #183046
[lldb] Batch breakpoint step-over for threads stopped at the same BP (#183412)
When multiple threads are stopped at the same breakpoint, LLDB currently
steps each thread over the breakpoint one at a time. Each step requires
disabling the breakpoint, single-stepping one thread, and re-enabling
it, resulting in N disable/enable cycles and N individual vCont packets
for N threads. This is a common scenario for hot breakpoints in
multithreaded programs and scales poorly.
This patch batches the step-over so that all threads at the same
breakpoint site are stepped together in a single vCont packet, with the
breakpoint disabled once at the start and re-enabled once after the last
thread finishes.
At the top of WillResume, any leftover StepOverBreakpoint plans from a
previous cycle are popped with their re-enable side effect suppressed
via SetReenabledBreakpointSite, giving a clean slate.
SetupToStepOverBreakpointIfNeeded then creates fresh plans for all
threads that still need to step over a breakpoint, and these are grouped
[49 lines not shown]
[NVPTX] Refactor NVPTXLowerArgs and move helpers to NVPTXUtilities (#183686)
A couple of refactoring changes to simplify `NVPTXLowerArgs` and reduce
unnecessary coupling to `NVPTXTargetLowering`:
- Move `getFunctionParamOptimizedAlign`, `getFunctionArgumentAlignment`,
and `getFunctionByValParamAlign` from `NVPTXTargetLowering` to
`NVPTXUtilities` as free functions. These don't use any TLI state and
were only member functions because they called each other. This also
lets `getArgumentAlignment` become file-static in
`NVPTXISelLowering.cpp`, and removes the `NVPTXTargetLowering`
dependency from `NVPTXLowerArgs` for byval alignment.
- Split the CUDA kernel pointer-marking logic out of `NVPTXLowerArgs`
into a new `NVPTXMarkKernelPtrsGlobal` pass. This code (marking pointers
loaded from byval params as global, handling int-to-ptr patterns) is
conceptually independent of the argument lowering and was guarded by a
`DrvInterface == CUDA` check that is now at pipeline scheduling time.
The new pass is a simple `FunctionPass` with no `TargetMachine`
dependency.
[AMDGPU] Make the options consistent across 3 RA pipelines(NFC)
Adding the missing option for the wwm-regalloc in the test
attr-amdgpu-flat-work-group-size-vgpr-limit.ll. The existing
test already specifies -sgpr-regalloc=fast & -vgpr-regalloc=fast
to ensure that the fast register allocator is preferred over
the default greedy allocator. For consistency, the same
preference should also be applied to the wwm-regalloc pipeline.
[HLSL][Matrix] Make Matrix InitListExprs and AST row-major order, and respect /Zpr and /Zpc in codegen (#182904)
Fixes #166410 and #181902
This PR makes matrix initializer lists be kept in row-major order in
InitListExpr and the AST for HLSL by not reordering the element indices
in `InitListChecker::CheckMatrixType` in `clang/lib/Sema/SemaInit.cpp`.
This PR also makes the codegen respect /Zpr and /Zpc during codegen for
matrix initializer lists by adding a vector shuffle to
`VisitInitListExpr` in `clang/lib/CodeGen/CGExprScalar.cpp`.
Assisted-by: claude-opus-4.6
---------
Co-authored-by: Farzon Lotfi <farzonl at gmail.com>
[flang][runtime] Emit "Infinity" rather than "Inf" when required (#183359)
The ISO Fortran standard requires that numeric output editing produce
the full word "Infinity", rather than my current "Inf", when the output
field is wide enough to hold it. Comply.
[clang-tidy] Nominate myself as a maintainer (#183173)
For the past ~8 months, I've been regularly working on clang-tidy, doing
features and cleanups, fixing issues, and reviewing PRs. I'm passionate
about the project, and I'd like to step up to be a maintainer for it!
[clang][analyzer] Add taintedness to argv (#178054)
If the execution environment is untrusted, we assume that the argv, argc
and envp parameters of the main function are attacker controlled values
and set them as taint analysis sources.
[llvm][DebugInfo] Emit DW_LNAME_Assembly for DWARFv6 assembly CUs (#183897)
Use the new DWARFv6 language code for assembly CUs. While we have a
`DW_LANG_Assembly` pre-DWARFv6 I kept the `DW_LANG_Mips_Assembler`
pre-DWARFv6 for now (I added a FIXME if we want to address it).