LLVM/project aeefb10llvm/lib/IR Metadata.cpp, llvm/unittests/IR MetadataTest.cpp

[IR] Simplify ValueAsMetadata::handleRAUW. NFC (#223301)

Metadata refers to a Value through its unique ValueAsMetadata wrapper.
When a Value is RAUW'd, handleRAUW reuses the old value's wrapper for
the new value if the new value has none yet; otherwise it moves the uses
to the new value's wrapper, with special cases for a local becoming a
constant, a constant becoming a local, and a value moving to another
function.

Always move the uses (or drop them in the last two cases) and delete the
old wrapper, so that a ValueAsMetadata wraps the same value for its
whole life.

Instruction counts for SLPVectorizer.cpp and X86ISelLowering.cpp at -O2
-g are unchanged (-0.04%, -0.01%).

Aided by Opus 5
DeltaFile
+13-36llvm/lib/IR/Metadata.cpp
+5-0llvm/unittests/IR/MetadataTest.cpp
+18-362 files

LLVM/project bdf664clibc/src/pthread pthread_attr_setschedparam.h pthread_attr_getschedparam.h, libc/test/src/pthread pthread_attr_test.cpp

[libc] Implement pthread_attr_[gs]etschedparam (#222991)

This patch implements pthread_attr_setschedparam and
pthread_attr_getschedparam.

Like the schedpolicy patch, this commit only operates on the
pthread_attr_t object and does not attempt to install scheduling
parameters when creating a new thread.

I also don't attempt to validate the priority value here. The valid
priority range depends on the scheduling policy (which may not even be
set yet or could change later), and we can let the kernel validate the
parameters when creating the thread or setting scheduler settings.

While in there:
- update the file headers to the modern llvm format
- use proxy headers instead of direct pthread.h inclusion

Assisted-by: Gemini
DeltaFile
+28-0libc/test/src/pthread/pthread_attr_test.cpp
+14-8libc/src/pthread/pthread_attr_setschedparam.cpp
+14-8libc/src/pthread/pthread_attr_getschedparam.cpp
+9-3libc/src/pthread/pthread_attr_setschedparam.h
+9-3libc/src/pthread/pthread_attr_getschedparam.h
+10-2libc/src/pthread/CMakeLists.txt
+84-247 files not shown
+98-2613 files

LLVM/project f0f76dbllvm/lib/ExecutionEngine/Orc EHFrameRegistrationPlugin.cpp

[ORC] Resolve EHFrame registration symbols via lookupAndApply (#223304)

EHFrameRegistrationPlugin::Create resolved its register/deregister
alloc-action addresses with EPC.getBootstrapSymbols. For consistency,
switch to lookupAndApply/recordAddr on the bootstrap JITDylib instead.
DeltaFile
+7-5llvm/lib/ExecutionEngine/Orc/EHFrameRegistrationPlugin.cpp
+7-51 files

LLVM/project 5fa8331clang/lib/Basic/Targets Sparc.h, clang/test/Driver sparc-as.c

[SPARC] Add LEON5 processor (#222912)

Same target exists in GCC.
DeltaFile
+4-0llvm/lib/Target/Sparc/Sparc.td
+4-0clang/test/Driver/sparc-as.c
+2-1clang/lib/Basic/Targets/Sparc.h
+1-0llvm/test/MC/Sparc/leon-pwrpsr-instruction.s
+1-0llvm/test/CodeGen/SPARC/readcycle.ll
+1-0llvm/test/CodeGen/SPARC/LeonCASAInstructionUT.ll
+13-13 files not shown
+16-19 files

LLVM/project 72d0333orc-rt CMakeLists.txt, orc-rt/lib/bedrock CMakeLists.txt

[orc-rt] Add ORC_RT_BEDROCK_LIBRARY_TYPE (STATIC/SHARED) (#223288)

Add CMake options to build bedrock as either a static or shared library.
Default is static.

This is CMake infrastructure only. Shared library builds aren't actually
useable yet: bedrock doesn't export its C++ API, and its C API is
insufficient to do anything interesting. Tools and test code are updated
to link against the -object libraries directly, since they use the
(unexported) C++ API.
DeltaFile
+16-0orc-rt/CMakeLists.txt
+7-3orc-rt/test/tools/CMakeLists.txt
+4-3orc-rt/test/unit/CMakeLists.txt
+4-1orc-rt/tools/ogre/CMakeLists.txt
+1-1orc-rt/lib/bedrock/CMakeLists.txt
+32-85 files

LLVM/project bdd1cccclang/test/Headers __clang_hip_math.hip, libc/test/src/math/exhaustive cos.wc sin.wc

rebase

Created using spr 1.3.8-beta.1
DeltaFile
+1,091,085-0libc/test/src/math/exhaustive/sin.wc
+1,090,178-0libc/test/src/math/exhaustive/cos.wc
+704-704clang/test/Headers/__clang_hip_math.hip
+541-522llvm/test/CodeGen/NVPTX/cmpxchg.ll
+0-906llvm/tools/llc/llcdriver.cpp
+906-0llvm/tools/llc/lib/llcdriver.cpp
+2,183,414-2,132418 files not shown
+2,200,628-6,697424 files

LLVM/project 96aaf95clang/test/Headers __clang_hip_math.hip, libc/test/src/math/exhaustive cos.wc sin.wc

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.8-beta.1

[skip ci]
DeltaFile
+1,091,085-0libc/test/src/math/exhaustive/sin.wc
+1,090,178-0libc/test/src/math/exhaustive/cos.wc
+704-704clang/test/Headers/__clang_hip_math.hip
+541-522llvm/test/CodeGen/NVPTX/cmpxchg.ll
+0-906llvm/tools/llc/llcdriver.cpp
+906-0llvm/tools/llc/lib/llcdriver.cpp
+2,183,414-2,132418 files not shown
+2,200,628-6,697424 files

LLVM/project ac10783clang/test/Headers __clang_hip_math.hip, libc/test/src/math/exhaustive cos.wc sin.wc

clang-format

Created using spr 1.3.8-beta.1
DeltaFile
+1,091,085-0libc/test/src/math/exhaustive/sin.wc
+1,090,178-0libc/test/src/math/exhaustive/cos.wc
+704-704clang/test/Headers/__clang_hip_math.hip
+541-522llvm/test/CodeGen/NVPTX/cmpxchg.ll
+0-906llvm/tools/llc/llcdriver.cpp
+906-0llvm/tools/llc/lib/llcdriver.cpp
+2,183,414-2,132422 files not shown
+2,200,640-6,769428 files

LLVM/project 0858aabclang/test/Headers __clang_hip_math.hip, libc/test/src/math/exhaustive cos.wc sin.wc

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.8-beta.1

[skip ci]
DeltaFile
+1,091,085-0libc/test/src/math/exhaustive/sin.wc
+1,090,178-0libc/test/src/math/exhaustive/cos.wc
+704-704clang/test/Headers/__clang_hip_math.hip
+541-522llvm/test/CodeGen/NVPTX/cmpxchg.ll
+0-906llvm/tools/llc/llcdriver.cpp
+906-0llvm/tools/llc/lib/llcdriver.cpp
+2,183,414-2,132422 files not shown
+2,200,631-6,761428 files

LLVM/project b97cb24llvm/lib/Target/RISCV/MCTargetDesc RISCVBaseInfo.cpp, llvm/lib/TargetParser RISCVISAInfo.cpp

rebase

Created using spr 1.3.8-beta.1
DeltaFile
+34-0llvm/unittests/Target/RISCV/RISCVBaseInfoTest.cpp
+10-7llvm/lib/TargetParser/RISCVISAInfo.cpp
+16-0llvm/unittests/TargetParser/RISCVISAInfoTest.cpp
+9-2llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp
+10-0llvm/utils/TableGen/InstrInfoEmitter.cpp
+2-2llvm/test/CodeGen/RISCV/rvy/rvy-invalid-operands.mir
+81-112 files not shown
+84-128 files

LLVM/project dbddb0dllvm/lib/Target/RISCV/MCTargetDesc RISCVBaseInfo.cpp, llvm/lib/TargetParser RISCVISAInfo.cpp

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.8-beta.1

[skip ci]
DeltaFile
+34-0llvm/unittests/Target/RISCV/RISCVBaseInfoTest.cpp
+10-7llvm/lib/TargetParser/RISCVISAInfo.cpp
+16-0llvm/unittests/TargetParser/RISCVISAInfoTest.cpp
+9-2llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp
+10-0llvm/utils/TableGen/InstrInfoEmitter.cpp
+2-2llvm/test/CodeGen/RISCV/rvy/rvy-invalid-operands.mir
+81-112 files not shown
+84-128 files

LLVM/project 75cb490llvm/test/TableGen RegClassByHwMode.td, llvm/utils/TableGen AsmMatcherEmitter.cpp

[𝘀𝗽𝗿] initial version

Created using spr 1.3.8-beta.1
DeltaFile
+67-55llvm/utils/TableGen/AsmMatcherEmitter.cpp
+36-28llvm/test/TableGen/RegClassByHwMode.td
+103-832 files

LLVM/project e806adfclang/test/CIR/CodeGen atomic.c, llvm/test/CodeGen/RISCV condbinops.ll select.ll

drop the fake vendor extension, use feature flag instead and rebase

Created using spr 1.3.8-beta.1
DeltaFile
+0-1,202llvm/test/CodeGen/RISCV/condops.ll
+0-455llvm/test/CodeGen/RISCV/zicond-opts.ll
+0-407llvm/test/CodeGen/RISCV/select.ll
+215-0clang/test/CIR/CodeGen/atomic.c
+67-55llvm/utils/TableGen/AsmMatcherEmitter.cpp
+0-115llvm/test/CodeGen/RISCV/condbinops.ll
+282-2,234115 files not shown
+1,797-2,782121 files

LLVM/project 53f620eclang/test/CIR/CodeGen atomic.c, llvm/test/CodeGen/RISCV condbinops.ll select.ll

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.8-beta.1

[skip ci]
DeltaFile
+0-1,202llvm/test/CodeGen/RISCV/condops.ll
+0-455llvm/test/CodeGen/RISCV/zicond-opts.ll
+0-407llvm/test/CodeGen/RISCV/select.ll
+215-0clang/test/CIR/CodeGen/atomic.c
+67-55llvm/utils/TableGen/AsmMatcherEmitter.cpp
+0-115llvm/test/CodeGen/RISCV/condbinops.ll
+282-2,234104 files not shown
+1,700-2,691110 files

LLVM/project 10b2437orc-rt/test/unit CMakeLists.txt

[orc-rt] Build RTTICrossDylibTestLib with ORC_RT_COMPILE_FLAGS (#223144)

Without ORC_RT_COMPILE_FLAGS, the test library builds with C++ RTTI on
by default. This leads to link errors when the ORC runtime is built with
C++ RTTI turned off.
DeltaFile
+1-0orc-rt/test/unit/CMakeLists.txt
+1-01 files

LLVM/project a92db5fllvm/test/TableGen RegisterByHwMode.td, llvm/utils/TableGen InstrInfoEmitter.cpp

[TableGen] Declare <TargetName>RegClassByHwModeTables in MC header (#223292)

When a target uses RegClassByHwMode in CompressPat, the generated
functions reference <TargetName>RegClassByHwModeTables.

Declare it under GET_INSTRINFO_MC_HELPER_DECLS (<Target>MCTargetDesc.h)
so it is visible to MC-layer users such as RISCVBaseInfo.cpp.

Fixes: 700d1f029d00 ("[TableGen] Support RegClassByHwMode in
CompressPat")
DeltaFile
+10-0llvm/utils/TableGen/InstrInfoEmitter.cpp
+2-0llvm/test/TableGen/RegisterByHwMode.td
+12-02 files

LLVM/project dbac421libc/test/src/math/exhaustive sin_test.cpp CMakeLists.txt, libc/utils/mathtools wc_to_bin.py

[libc][math] Fix fast path with small inputs for double precision sin/cos. (#221012)

https://github.com/llvm/llvm-project/pull/201748 added a fast branch for
small inputs to double precision sin/cos,
but the Ziv error bounds were too tight.

Fixes in this PR:
- Updating the Ziv error bounds to accommodate rounding errors.
- Copy binary64 sin/cos hard-to-round cases from the CORE-MATH project.
- Add python tool to convert textual hard to round cases to binary
files, and add those binary files.
- Add hard-to-round tests for double precision sin/cos in the exhaustive
test folder.

Fixes https://github.com/llvm/llvm-project/issues/220934.

Assisted-by: Gemini is used to generate the worst-case text-to-binary
tool.
DeltaFile
+1,091,085-0libc/test/src/math/exhaustive/sin.wc
+1,090,178-0libc/test/src/math/exhaustive/cos.wc
+330-0libc/test/src/math/exhaustive/worst_case_test.h
+302-0libc/utils/mathtools/wc_to_bin.py
+44-0libc/test/src/math/exhaustive/CMakeLists.txt
+26-0libc/test/src/math/exhaustive/sin_test.cpp
+2,181,965-010 files not shown
+2,182,045-716 files

LLVM/project 291b60allvm/test/MC/LoongArch/Relocations sub-expr.s

[LoongArch][test] Test 1- and 2-byte subtraction relocations. NFC (#222825)

Add MC tests for 1- and 2-byte subtraction relocations enabled by
#211754.
DeltaFile
+24-2llvm/test/MC/LoongArch/Relocations/sub-expr.s
+24-21 files

LLVM/project 9e70d8fclang/test/SemaCXX blocks.cpp

[Clang][NFC] add additional test coverage for default argument parsing errors (#222556)

Fixes #115280
DeltaFile
+10-0clang/test/SemaCXX/blocks.cpp
+10-01 files

LLVM/project 6d7e7fbllvm/lib/Transforms/InstCombine InstCombineCasts.cpp, llvm/test/Transforms/InstCombine uitofp.ll

[InstCombine] Fold uitofp of masked truncations (#222592)

Fold an unsigned integer-to-floating-point conversion of a masked
truncation by widening the mask and eliminating the truncation:

`uitofp((trunc X) & C)` → `uitofp(X & zext(C))`

Apply the fold when the intermediate instructions have one use and
widening the integer operation is desirable.

This reduces the instruction count on both AMDGPU and NVPTX.

AMDGPU example: https://godbolt.org/z/rTYhM61ce
NVPTX example: https://godbolt.org/z/fWhsrne19
DeltaFile
+129-0llvm/test/Transforms/InstCombine/uitofp.ll
+20-0llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
+149-02 files

LLVM/project 32a0ee2llvm/docs TypeMetadata.md QualGroup.md

[LLVM][docs] Convert remaining batch 11 tables to MyST
DeltaFile
+109-98llvm/docs/ScudoHardenedAllocator.md
+39-41llvm/docs/QualGroup.md
+19-23llvm/docs/TypeMetadata.md
+167-1623 files

LLVM/project 8986fcallvm/docs SecurityTransparencyReports.md VectorizationPlan.md, llvm/docs/Proposals GitHubMove.md TestSuite.md

[LLVM][docs] Finish MyST migration for remaining docs (batch 11)
DeltaFile
+92-93llvm/docs/Projects.md
+86-85llvm/docs/Proposals/TestSuite.md
+62-62llvm/docs/TableGen/ProgRef.md
+53-51llvm/docs/VectorizationPlan.md
+52-44llvm/docs/SecurityTransparencyReports.md
+48-44llvm/docs/Proposals/GitHubMove.md
+393-37919 files not shown
+532-53325 files

LLVM/project 2cc0aefllvm/docs Statepoints.md YamlIO.md, llvm/docs/Proposals GitHubMove.md

[LLVM][docs] Convert remaining reST docs with rst2myst (batch 11)
DeltaFile
+1,431-1,308llvm/docs/TableGen/ProgRef.md
+682-725llvm/docs/YamlIO.md
+620-706llvm/docs/TableGen/BackEnds.md
+615-612llvm/docs/Proposals/GitHubMove.md
+412-498llvm/docs/TableGen/BackGuide.md
+329-361llvm/docs/Statepoints.md
+4,089-4,21024 files not shown
+6,892-7,46230 files

LLVM/project a13af68llvm/docs/Proposals GitHubMove.rst GitHubMove.md, llvm/docs/TableGen BackEnds.rst BackEnds.md

[LLVM][docs] Rename reST docs to Markdown (batch 11)
DeltaFile
+0-2,287llvm/docs/TableGen/ProgRef.rst
+2,287-0llvm/docs/TableGen/ProgRef.md
+0-1,213llvm/docs/TableGen/BackEnds.rst
+1,213-0llvm/docs/TableGen/BackEnds.md
+0-1,083llvm/docs/Proposals/GitHubMove.rst
+1,083-0llvm/docs/Proposals/GitHubMove.md
+4,583-4,58354 files not shown
+14,002-14,00260 files

LLVM/project 1b0b6b1llvm/docs CodeReview.md CIBestPractices.md

[LLVM][docs] Address batch 10 Markdown review feedback
DeltaFile
+72-372llvm/docs/ConvergenceAndUniformity.md
+23-27llvm/docs/ConvergentOperations.md
+17-18llvm/docs/GitBisecting.md
+12-12llvm/docs/CIBestPractices.md
+4-4llvm/docs/CodeReview.md
+128-4335 files

LLVM/project 63d2e62clang/include/clang/Lex Preprocessor.h MacroInfo.h, clang/lib/Lex PPMacroExpansion.cpp

[clang][Lex] Unique ModuleMacros with a UniquingSet (NFC) (#223270)

This patch migrates ModuleMacros in Preprocessor from llvm::FoldingSet
to llvm::UniquingSet.

ModuleMacro keys on a pair of Module * and const IdentifierInfo *.
Switching to UniquingSet allows us to look up macros with a typed key,
eliminating FoldingSetNodeID serialization at lookup sites and removing
ModuleMacro::Profile.

Assisted-by: Antigravity
DeltaFile
+3-9clang/include/clang/Lex/MacroInfo.h
+2-8clang/lib/Lex/PPMacroExpansion.cpp
+1-1clang/include/clang/Lex/Preprocessor.h
+6-183 files

LLVM/project bce20f5clang/test/Preprocessor riscv-target-features.c, llvm/lib/Target/RISCV RISCVFeatures.td

[RISCV][MC] Add experimental Smidctrl, Ssidctrl, Smnip, and Ssnip support (#218108)

Add experimental MC support for Smidctrl, Ssidctrl, Smnip, and Ssnip
extensions.

This completes MC support for the ACLIC v0.20 extensions.
DeltaFile
+46-0clang/test/Preprocessor/riscv-target-features.c
+42-0llvm/test/MC/RISCV/supervisor-csr-names.s
+42-0llvm/test/MC/RISCV/machine-csr-names.s
+18-0llvm/lib/Target/RISCV/RISCVFeatures.td
+16-0llvm/test/CodeGen/RISCV/attributes.ll
+12-0llvm/test/MC/RISCV/attribute-arch.s
+176-06 files not shown
+198-812 files

LLVM/project c577c6clldb/test/Shell/Unwind signal-frame-undefined-ra.test, lldb/test/Shell/Unwind/Inputs signal-frame-undefined-ra.s

[lldb] Test undefined return addresses in signal frames (#223046)

Signal-frame CFI can explicitly mark its return-address register
undefined to represent a terminal synthetic context. This is useful for
contexts such as newly created FreeBSD kernel threads that do not have
an interrupted caller.

Verify that LLDB keeps the signal frame in the backtrace and terminates
the unwind without creating a caller.

Assisted-by: GPT
DeltaFile
+19-0lldb/test/Shell/Unwind/Inputs/signal-frame-undefined-ra.s
+18-0lldb/test/Shell/Unwind/signal-frame-undefined-ra.test
+37-02 files

LLVM/project 462535bllvm/test/Transforms/InstCombine known-bits.ll known-bits-bitcast-from-fp.ll

[InstCombine][NFC] Move bitcast from float tests into their own file (#223196)
DeltaFile
+360-0llvm/test/Transforms/InstCombine/known-bits-bitcast-from-fp.ll
+0-358llvm/test/Transforms/InstCombine/known-bits.ll
+360-3582 files

LLVM/project 0c4e1a6llvm/lib/Transforms/Vectorize VPlanUtils.cpp VPlan.h, llvm/unittests/Transforms/Vectorize VPlanTest.cpp

[VPlan] Set the containing plan when creating blocks (NFC). (#223269)

Now that we funnel all VP block creation through VPlan helpers, make
sure the Plan field is set for each block. This means we can remove the
CFG walk to find a Plan's entry.

Also drop an assertion in VPSlotTracker::getOrCreateName: a block now
knows its plan as soon as it is created.

This has a very small positive compile-time impact.
DeltaFile
+2-35llvm/lib/Transforms/Vectorize/VPlan.cpp
+9-7llvm/lib/Transforms/Vectorize/VPlan.h
+2-2llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
+3-1llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+16-454 files