[mlir][LLVM] Add a negative test for inttoptr(ptrtoint(x)) (#234397)
Folding `inttoptr(ptrtoint(x))` to `x` is incorrect even when the
intermediate integer is at least as wide as the pointer, because the
pointer produced by `inttoptr` may carry different provenance than `x`.
Add a negative canonicalization test, with a comment pointing to the
relevant references, so that the cast pair is documented as
intentionally not folded and future attempts are caught.
Attributor: Add only new attributes when manifesting
manifestAttrs collected the attributes to add in an AttrBuilder, then
copied the position's attribute set into another AttrBuilder to merge
them in. Collect them in an array and merge them into the set in one
pass. This requires the attributes passed to manifestAttrs to be sorted
like an attribute set, which all callers already do. The only one
passing more than one attribute is AMDGPUAttributor, whose implicit
argument attributes are sorted.
Instructions spent in amdgpu-attributor:
rocPRIM test_device_scan, gfx942: 770.2M -> 710.8M (-7.7%)
Blender Cycles HIP kernel, gfx1100: 380.0M -> 379.5M (-0.1%)
rocPRIM 16 tests, full LTO, closed world: 3019.8M -> 2855.9M (-5.4%)
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[CIR] Add missing MLIR TableGen dependencies to CIR CMake targets (#187692)
CIR targets include MLIR headers that depend on TableGen-generated .inc
files (BuiltinLocationAttributes.h.inc, BytecodeOpInterface.h.inc), but
do not declare build dependencies on the corresponding TableGen targets.
This causes intermittent build failures with parallel builds when the
.inc files have not yet been generated by the time CIR sources compile.
Add MLIRBuiltinLocationAttributesIncGen and
MLIRBytecodeOpInterfaceIncGen to DEPENDS in all affected CIR CMake
targets:
- clangCIRLoweringCommon
- clangCIRLoweringDirectToLLVM
- clangCIRFrontendAction
- MLIRCIRInterfaces
- MLIRCIR (Dialect/IR)
- MLIRCIRTransforms
- MLIRCIRTargetLowering
- CIROpenACCSupport
[2 lines not shown]
[Support][lld] Restore F_no_mmap; fix swapped --[no-]mmap-output-file
369c4093482210 renamed F_no_mmap to F_mmap without negating its use in
FileOutputBuffer::create, so the flag still selects the in-memory
(non-mmap) buffer. Flipping lld's default to false hid this for default
links, but --mmap-output-file and --no-mmap-output-file have done the
opposite of their names since LLVM 21.
F_no_mmap was correctly named: D69294 added it to avoid mmapping the
output on compressed btrfs. Restore the name and lld's default, and make
link-open-file.test exercise both modes.
Co-authored-by: Davis Rollman <drollman at meta.com>
Assisted-by: Claude
Merge tag 'acpi-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI support updates from Rafael Wysocki:
"The most significant change here is the rework of the core ACPI device
enumeration code to avoid initializing ACPI power management
prematurely for devices with unmet dependencies. This essentially is a
problem fix, but it requires taking PCI device enumeration ordering
into account among other things, so it is far from straightforward.
There was an attempt to do this in the 7.3 time frame that had to be
reverted, so this time it is done much more carefully.
There is also an ACPI thermal control update rearranging the code to
register thermal class cooling devices under specific parents, which
is visible in sysfs. This helps to figure out what is represented by
those devices much more easily, but it also allows the binding of
cooling devices to trip points in thermal zones to be adjusted so it
need not rely on specific cooling device data usage in thermal
drivers.
[215 lines not shown]
PPC: Fix extsw elimination when the input reads a subregister (#208052)
The EXTSW_32_64 sign-extend elimination previously assumed its input
was a full register value. It would then try using that value as the
source of the new (unnecessary) INSERT_SUBREG.
The new test would then hit this verifier error:
```
bb.0:
liveins: $x3
%0:g8rc = COPY killed $x3
%1:g8rc = RLDICL killed %0:g8rc, 0, 33
%3:g8rc = IMPLICIT_DEF
%2:g8rc = INSERT_SUBREG %3:g8rc(tied-def 0), %1:g8rc, %subreg.sub_32
$x3 = COPY killed %2:g8rc
BLR8 implicit $lr8, implicit $rm, implicit killed $x3
*** Bad machine code: INSERT_SUBREG expected inserted value to have equal or lesser size than the subreg it was inserted into ***
[7 lines not shown]
[lldb] Support objc_runtime_name annotations in DWARF (#233648)
An Objective-C class with a custom objc_runtime_name exports its
class, metaclass, and ivar offset symbols under the runtime name.
LLDB reconstructs the interface from DWARF with only the source name,
so expressions that reference such a class fail to find these
symbols.
This patch reads the DW_TAG_LLVM_annotation that clang now emits for
the runtime name and attaches an ObjCRuntimeNameAttr to the
reconstructed ObjCInterfaceDecl.
rdar://190472538
Assisted-by: Claude
Attributor: Add only new attributes when manifesting
manifestAttrs collected the attributes to add in an AttrBuilder, then
copied the position's attribute set into another AttrBuilder to merge
them in. Collect them in an array and merge them into the set in one
pass. This requires the attributes passed to manifestAttrs to be sorted
like an attribute set, which all callers already do. The only one
passing more than one attribute is AMDGPUAttributor, whose implicit
argument attributes are sorted.
Instructions spent in amdgpu-attributor:
rocPRIM test_device_scan, gfx942: 770.2M -> 710.8M (-7.7%)
Blender Cycles HIP kernel, gfx1100: 380.0M -> 379.5M (-0.1%)
rocPRIM 16 tests, full LTO, closed world: 3019.8M -> 2855.9M (-5.4%)
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
IR: Add attributes from an array to an attribute set
Add AttributeSet::addAttributes and AttributeList::addAttributesAtIndex
overloads taking an array of attributes sorted like an attribute set,
with distinct kinds. They merge the attributes into the set in one pass,
without first copying the set into an AttrBuilder and adding each
attribute to it.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[clang][DebugInfo] Record objc_runtime_name of ObjC interfaces (#233647)
An Objective-C class with a custom objc_runtime_name exports its class,
metaclass, and ivar offset symbols under the runtime name, but the debug
info only records the source name.
This causes problems in LLDB's expression evaluator since it will use
the name recorded in the debug info for any ObjC metadata symbols.
This patch uses DW_TAG_LLVM_annotation to record the runtime name in the
interface.
rdar://187396633
Assisted-by: Claude
[LLVM][docs] Unquote todo blocks in AMDGPU processor table
Four todo blocks in the processor table were wrapped in a blockquote left
over from the reST conversion.
LLM-aided
Merge main and amdgpu-md-rename into amdgpu-md-rewrite
Resolve the AMDGPUUsage.md conflict by translating the two upstream
AMDGPUUsage.rst edits (#232985, #233528) into the reviewed Markdown.
LLM-aided
Merge main into amdgpu-md-rename
Resolve the AMDGPUUsage.rst conflict by applying the two upstream edits
(#232985, #233528) to the renamed AMDGPUUsage.md.
LLM-aided
[clang][CIR] Build llvm-strings for check-clang
With CIR enabled, check-clang discovers the bytecode tests. They invoke
llvm-strings, but only check-clang-cir declares it as a dependency. Add it
to the common Clang test dependencies for non-standalone CIR builds so a
fresh check-clang build has the tool.
[flang][debuginfo] Emit DW_AT_type for DW_TAG_string_type DIEs [3/3] (#231960)
Use the new DIStringType type field to emit the DW_AT_type attribute on
DW_TAG_string_type DIEs generated by Flang's debug type generator,
enabling debuggers to identify the character type of Fortran strings.
Fixes #95440
[libc][cmake] Unify unit and hermetic test rules into add_libc_test (#233512)
- Consolidate _add_libc_unittest and add_libc_hermetic into mode-aware
add_libc_test and create_libc_test rules using llvm_libc_parse_arguments
and forward_arguments (#232089), keeping add_libc_unittest,
add_libc_hermetic, and add_fp_unittest as thin forwarding wrappers.
- Replace separate libc-unit-tests and libc-hermetic-tests with unified
libc-tests and libc-tests-build targets.
- Introduce add_libc_testsuite to create both <suite> and <suite>-build
targets wired into libc-tests and libc-tests-build.
- Move add_fp_unittest into LLVMLibCTestRules.cmake via the FP_TEST
option and rename MPFR/MPC helper libraries to follow standard libc
target naming (libc.utils.MPCommon, libc.utils.MPFRWrapper,
libc.utils.MPCWrapper).
- Streamline _add_libc_test_runner: replace $<TARGET_FILE:...> with
configure-time binary paths, fast-path .params generation, and define
test runner targets directly via add_custom_target(... COMMAND ...
JOB_POOL ...) instead of intermediate .cmd stamp rules.
- Update docs and GPU benchmarks to use the unified test targets and
[2 lines not shown]
[libc++] Disable automatic module scanning on ARM CI builders (#232947)
The ARM Buildkite toolchains do not expose clang-scan-deps to CMake.
When CMP0155 enables automatic scanning for libc++abi C++23 sources,
these standalone runtimes builds fail with the scanner set to NOTFOUND.
Pass CMAKE_CXX_SCAN_FOR_MODULES=OFF in the eight ARM job invocations,
including the no-exceptions variants, until their toolchains provide a
matching scanner. Keep the other CI configurations on their defaults.
See the issue tracking upgrading the bots:
https://github.com/llvm/llvm-project/issues/232946
Assisted-by: Codex