clang: Add BoundArch argument to addClangTargetOptions (#196504)
addClangTargetOptions already has an OffloadKind argument,
but it kind of doesn't make sense for any function to know the
OffloadKind, but not the associated BoundArch.
The current process is kind of convoluted. TranslateArgs
synthesizes a -mcpu argument from BoundArch, and later
addClangTargetOptions re-parses that -mcpu argument each
time it wants the architecture. Add this argument so this
can be cleaned up in a future change.
Co-authored-by: Claude Sonnet 4 <noreply at anthropic.com>
[mlir][acc] Add acc.predicate_region for redundant/single semantics (#203011)
Add acc.predicate_region, an intermediate codegen operation that groups
statements at intermediate points in a loop nest within
acc.compute_region. OpenACC distinguishes partitioned loop execution
from single and redundant execution at nest transitions: for example,
gang-redundant code runs on all gangs but not as partitioned gang-loop
iterations, and worker-single or vector-single code runs on one worker
or vector lane rather than across the full worker or vector partition.
This grouping marks code whose execution scope differs from surrounding
partitioned loops, so predication and synchronization can be applied
correctly during lowering.
[flang][semantic] parser node types and rewrite for explicit-shape-bounds-spec (#188447)
This commit lays the groundwork for semantic analysis of rank-1 integer array expressions being used as bounds in a declaration with explicit bounds.
Enumeration Type Lowering: FIR code generation (PR 9)
Maps enumeration types to i32 at the FIR level. Intercepts enumeration
DerivedTypeSpec in ConvertType to produce IntegerType, lowers
enumeration constructors/constants, and generates NEXT/PREVIOUS/HUGE
intrinsic lowering with STAT boundary handling and error termination.
Files from original PR 9 plus PR 7/8 lowering additions (PREVIOUS,
STAT, void-cast fixes).
Enumeration Type Sem-3: Intrinsics + I/O + Module Files (PRs 6-8)
Adds enumeration type intrinsics (HUGE, NEXT, PREVIOUS, INT) with
constant folding, STAT argument support with boundary detection,
formatted I/O rejection for enumeration types, module file round-trip
support, and runtime STAT_ENUM_BOUNDARY error code.
Files from original PRs 6-8 (including PREVIOUS intrinsic from PR 7).
[APINotes] Early return when no apinotes files are loaded
When no APINotes readers are available, let's not spend time trying to
determine the current decl's context or do other redundant work.
Resolves https://github.com/llvm/llvm-project/issues/202214
[MLIR][LLVM] Preserve unknown function metadata on import
Import non-debug function metadata without a kind-specific dialect conversion into LLVMFuncOp function_metadata. Preserve repeated metadata kinds through the generic carrier so LLVM IR import and export can round-trip those attachments.
[MLIR][LLVM] Translate LLVMFuncOp function metadata
Materialize LLVMFuncOp function_metadata through ModuleTranslation metadata conversion. Attach function metadata after module-level symbols are mapped so metadata references to functions, globals, aliases, and ifuncs can be resolved.
[MLIR][LLVM] Add function metadata to LLVMFuncOp
Add a generic LLVM dialect carrier for LLVM IR function metadata on LLVMFuncOp.
Represent attachments as an ordered list so repeated metadata kinds, such as
multiple type metadata attachments, can be preserved while keeping metadata names
language-agnostic.
[ids-check] Update the workflow and script (#199710)
In compnerd/ids#58, support was added to parse a header file using a
given source file's flags. This solves many of the issues we had
encountered with the `ids-check-helper.py` script and its corresponding
workflow.
* Update ids to the current version, which includes the `--main-file`
changes.
* Use a more recent LLVM compiler to build a subset of LLVM.
* Build a subset of LLVM targets to properly parse more header files.
* Use the `--main-file` argument when invoking `idt`.
* Add explicit overrides and exclude header lists.
This was tested on every public header in LLVM and forthcoming PRs will
land the changes found with the updated script. Once all of the headers
have been updated, the workflow will be re-enabled. This effort is
tracked in #109483.
[MLIR][LLVM] Preserve global value metadata operands on import
Import global value references inside LLVM metadata operands as LLVM dialect metadata symbol-reference attributes. Add llvm.read_register import coverage for function, global, alias, and nameless-global metadata operands.
[AMDGPU] Fix wrong truth table in BitOp3_Op for shared sub-expressions. (#198556)
When the LHS and RHS of a boolean node share a common sub-expression,
LHS recursion can decompose that shared node via the "replace parent
operator" mechanism in getOperandBits (Src[I] = Op where Src[I] == In).
This replaces the Src slot that RHS was originally mapped to with a
sub-operand. If RHS recursion then fails to re-derive its own
decomposition, RHSBits still refers to the old slot index — but the slot
now holds a different value, producing an incorrect truth table.
Fix this by tracking which Src slot RHS occupies before LHS recursion.
If RHS recursion fails and that specific slot was modified, roll back
Src and the bit assignments to the pre-recursion state.
Add a test to show a specific example.
Assisted-by: Cursor (Claude)
[MLIR][LLVM] Share LLVM metadata attribute translation
Share LLVM dialect metadata materialization through ModuleTranslation so named
metadata and metadata-as-value lowering use one conversion path. Resolve metadata
symbol references to functions, globals, aliases, and ifuncs, and diagnose
malformed required metadata before lowering.