LLVM/project 4ceb487llvm/lib/Target/AArch64 AArch64SchedNeoverseV3AE.td, llvm/test/tools/llvm-mca/AArch64/Neoverse V3AE-sve-instructions.s

[AArch64] Improve scheduling info for WHILE instruction (#219122)

They should have a throughput of 2, only using a single M microop.
DeltaFile
+37-37llvm/test/tools/llvm-mca/AArch64/Neoverse/V3AE-sve-instructions.s
+2-7llvm/lib/Target/AArch64/AArch64SchedNeoverseV3AE.td
+39-442 files

LLVM/project e8ae577clang/include/clang/CIR/Dialect/IR CIRCUDAAttrs.td CIRTypes.td

[CIR] Use the modern enum case classes

The `I32EnumAttrCase` family carries an `Attr` half, and an `IntegerAttr`
predicate with it, that a CIR enum has no use for now that the enums derive
from `EnumInfo`. Upstream says of those forms that they "are not needed when
using the newer `EnumCase` form".

Rename all 198 of them to `I32EnumCase`, `I32BitEnumCaseNone`,
`I32BitEnumCaseBit` and `BitEnumCaseGroup`. The group class drops its width
prefix because the modern spelling takes the width from its cases.

NFC, mechanical.
DeltaFile
+140-140clang/include/clang/CIR/Dialect/IR/CIROps.td
+43-43clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+8-8clang/include/clang/CIR/Dialect/IR/CIREnumAttr.td
+4-4clang/include/clang/CIR/Dialect/IR/CIRTypes.td
+3-3clang/include/clang/CIR/Dialect/IR/CIRCUDAAttrs.td
+198-1985 files

LLVM/project a3948edclang/include/clang/CIR/Dialect/IR CIRAttrs.td, clang/test/CIR/CodeGen callsite-inline-attributes.cpp

[CIR] Drop the redundant suffix from the inline kind mnemonic

inline_kind was the one CIR enum attribute mnemonic still repeating what its
C++ enum class name says. The attribute now spells
`#cir.inline<always_inline>`. The operation argument keeps the name
inline_kind, since that is the accessor name, so the printed form reads
`inline_kind = #cir.inline<always_inline>`.

The enum's summary also becomes "inline kind" rather than the camelCase
"inlineKind", which is what generated docs show now that CIR_InlineKindAttr
no longer overrides it.

25 CHECK lines change across four test files. Nine are in an
aarch64-registered-target test, unsupported in an X86-only build, but the
substitution matches the two CIR tests that do run.
DeltaFile
+9-9clang/test/CodeGen/AArch64/sme-inline-callees-streaming-attrs.c
+9-9clang/test/CIR/CodeGen/callsite-inline-attributes.cpp
+6-6clang/test/CIR/IR/inline-attrs.cir
+2-3clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+2-2clang/test/CIR/IR/invalid-call.cir
+28-295 files

LLVM/project 6568f16clang/include/clang/CIR/Dialect/IR CIRCUDAAttrs.td

[CIR] Record why the CUDA registration attribute parses itself

hasCustomAssemblyFormat with no explanation invites the question of whether a
declarative assemblyFormat would do. It would not. The three flags print as
presence-only keywords and parse in any order, while an optional group
anchored on a `bool` parameter parses and prints a value, so the group would
spell `extern true`. MLIR has no presence-only flag for `bool` in an
attribute format, unlike UnitAttr in an operation format. struct(params)
round-trips but spells the attribute
`<device_side_name = "i", kind = Variable, isExtern = true>` instead of
`<i, Variable, extern>`.

NFC.
DeltaFile
+5-0clang/include/clang/CIR/Dialect/IR/CIRCUDAAttrs.td
+5-01 files

LLVM/project 36edf40clang/utils/TableGen CIRLoweringEmitter.cpp

[CIR] Derive lowering attr names from cppClassName, not the def name

CIRLoweringEmitter built its CXX_ABI_ALWAYS_LEGAL_ATTRS entries with
GetOpCppClassName, which splits the TableGen def name at the first
underscore. That works only while every def is named CIR_<CppClassName>Attr.
When one is not, the emitter writes an `isa<>` for a class that does not
exist, and the failure lands as a compile error in generated code.

Attributes carry the authoritative name in cppClassName, which
GenerateAttrToValueVisitor was already reading. Factor that out as
GetAttrCppClassRef and use it for both attribute paths. GetOpCppClassName
stays for operations.

NFC, and checkable. No CIR attribute overrides cppClassName, so the generated
CIRLowering.inc is byte-identical.
DeltaFile
+16-10clang/utils/TableGen/CIRLoweringEmitter.cpp
+16-101 files

LLVM/project 3f1d018clang/include/clang/CIR/Dialect/IR CIREnumAttr.td CIROps.td

[CIR] Drop dead ceremony around the CIR enum attributes

Five things that no longer earn their place in the CIR enum attribute
machinery.

CIR_CleanupKindAttr carried three. Its cppClassName restated the default
AttrDef already derives. Its skipDefaultBuilders plus hand-written
AttrBuilder existed only to default $value to CleanupKind::All, which no
caller relies on, so the generated builders stayed suppressed for nothing.
And its summary and description restated the name, overriding the enum's own
"cleanup kind" that EnumAttr would otherwise inherit. The isNormal, isEH and
isNormalAndEH helpers stay.

CIR_TLSModelAttr's summary restated its name the same way, so only that goes.
CIR_DefaultValuedEnumParameter has never had a user.

NFC.
DeltaFile
+0-16clang/include/clang/CIR/Dialect/IR/CIROps.td
+0-5clang/include/clang/CIR/Dialect/IR/CIREnumAttr.td
+0-212 files

LLVM/project 09b2e46clang/include/clang/CIR/Dialect/IR CIRTypes.td CIRCUDAAttrs.td, clang/test/CIR/IR invalid-lang-attr.cir

[CIR] Move the CIR enums off the legacy EnumAttrInfo hierarchy

MLIR has two enum hierarchies. `EnumAttrInfo` doubles as an `IntegerAttr`
constraint, so every CIR enum had to clear `genSpecializedAttr` to say it did
not want one. `EnumInfo` describes a C++ enum and nothing more.

Derive the CIR bases from `I32Enum`, `I64Enum` and `I32BitEnum`, and widen
`CIR_EnumAttr` to the `EnumInfo` that upstream `EnumAttr` already takes. The
flag no longer exists to clear. `FPClassTestEnum` gets unquoted printing from
`BitEnumBase` rather than overriding `printBitEnumQuoted`, and
`CIR_KnownFuncKind` drops a `parameterPrinter` the generated `operator<<`
now covers, still spelling `#cir.func_identity<"std::find">`.

AMDGPU wraps an `I32Enum` in an `EnumAttr` with this same bracketed format.
Parsing moves to the generated `FieldParser`, whose diagnostic names the
accepted spellings, so two `expected-error` lines change. Generated attribute
code drops 16 KB as 28 inlined parsers collapse into it.
DeltaFile
+33-73clang/include/clang/CIR/Dialect/IR/CIROps.td
+23-53clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+13-9clang/include/clang/CIR/Dialect/IR/CIREnumAttr.td
+2-4clang/include/clang/CIR/Dialect/IR/CIRCUDAAttrs.td
+1-3clang/include/clang/CIR/Dialect/IR/CIRTypes.td
+1-1clang/test/CIR/IR/invalid-lang-attr.cir
+73-1431 files not shown
+74-1447 files

LLVM/project 1a656bellvm/lib/Analysis ScalarEvolution.cpp, llvm/test/Analysis/ScalarEvolution exhaustive-trip-counts.ll

[SCEV] Complete instr-types in CanConstantFold (#218874)

Match the types in the ConstantFolder. This allows us to compute more
trip counts.

Assisted-by: AI, for test cases
DeltaFile
+102-0llvm/test/Analysis/ScalarEvolution/exhaustive-trip-counts.ll
+3-3llvm/lib/Analysis/ScalarEvolution.cpp
+105-32 files

LLVM/project 2b36039flang/docs ReleaseNotes.md, flang/lib/Frontend TextDiagnosticPrinter.cpp

[flang] Remove directory path from compiler remarks (#212669)

flang prefixes optimization remarks with the full path to the
sourcefile. This is not handled by some test frameworks that compare
compiler output to a reference. Change remarks to only display the
source filename.

$ flang -O3 -Rpass=loop-vectorize constr26.f90
home/users/john/test/constr26.f90:6:3: remark: vectorized loop
(vectorization width: 4, interleaved count: 1) [-Rpass=loop-vectorize]

after this change:

$ flang -O3 -Rpass=loop-vectorize constr26.f90
constr26.f90:6:3: remark: vectorized loop (vectorization width: 4,
interleaved count: 1) [-Rpass=loop-vectorize]

gnu fortran output:


    [9 lines not shown]
DeltaFile
+12-11flang/lib/Frontend/TextDiagnosticPrinter.cpp
+16-0flang/test/Driver/optimization-remark.f90
+5-0flang/docs/ReleaseNotes.md
+3-1flang/lib/Lower/Bridge.cpp
+36-124 files

LLVM/project 2087cc3llvm/utils profcheck-xfail.txt

[Profcheck] Update XFail list (#220933)

To get the bot back to green while we work on fixing. SimplifyCFG fix
landed in #220811, but it wasn't reviewed so reverting for now.
DeltaFile
+2-0llvm/utils/profcheck-xfail.txt
+2-01 files

LLVM/project 2ea93caclang/lib/Driver Driver.cpp, clang/lib/Driver/ToolChains Clang.cpp SPIRV.cpp

[clang][SYCL] Enable -fno-gpu-rdc for SYCL (#218089)

Activate non-relocatable SYCL device code compilation for a single
device architecture. Support for multiple device architectures will be
added in the next PR.

Driver:
- In BuildOffloadingActions, when SYCL non-RDC is selected, package the
translation unit's device images and hand them to clang-linker-wrapper
as a LinkerWrapperJobAction producing the TY_SYCL_FATBIN type. The
wrapper finalizes the images and emits the fat binary.
- Include that fat binary into the host compilation via
-foffload-include-binary, so it is embedded and registered at compile
time and the final clang-linker-wrapper performs no SYCL device link.
- Generalize the --emit-fatbin-only handling in tools::LinkerWrapper to
the new type.
- Add a buildLinker() override to SYCLToolChain. This lets the driver to
construct a device link job at compile time.
- -fno-gpu-rdc with more than one device triple is diagnosed in the

    [18 lines not shown]
DeltaFile
+85-0clang/test/Driver/sycl-offload-jit.cpp
+68-0libsycl/test/basic/no_rdc_multi_tu.cpp
+31-10clang/lib/Driver/Driver.cpp
+37-0clang/test/Driver/sycl-nordc-fatbin.cpp
+9-4clang/lib/Driver/ToolChains/Clang.cpp
+13-0clang/lib/Driver/ToolChains/SPIRV.cpp
+243-145 files not shown
+259-1611 files

LLVM/project d3132d0mlir/include/mlir/Dialect/Linalg/IR LinalgNamedStructuredOps.yaml, mlir/lib/Dialect/Linalg/Transforms NamedToElementwise.cpp CategoryToNamedOp.cpp

[MLIR][Linalg] Remove ternary named op

Removes the named op `select` from the Linalg dialect.

I have also updated the ElementwiseOp builder to simplify the default
case: kind + no affine map.

Depends on both unary and binary removal branches.

Ref:
https://discourse.llvm.org/t/rfc-update-semantics-of-linalg-named-operations-unary-binary-ternary/91531
DeltaFile
+0-61mlir/lib/Dialect/Linalg/Transforms/CategoryToNamedOp.cpp
+0-57mlir/lib/Dialect/Linalg/Transforms/NamedToElementwise.cpp
+0-57mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
+0-48mlir/test/Dialect/Linalg/named-ops.mlir
+0-48mlir/test/Dialect/Linalg/named-ops-fail.mlir
+0-26mlir/test/Dialect/Linalg/generalize-named-ops.mlir
+0-2979 files not shown
+16-37315 files

LLVM/project 1831383clang/lib/StaticAnalyzer/Checkers/WebKit PtrTypesSemantics.cpp ASTUtils.cpp, clang/test/Analysis/Checkers/WebKit mock-types.h unchecked-call-arg.cpp

[alpha.webkit.UncheckedCallArgsChecker] Treat copyRef() in a call argument as safe (#220882)

Treat calling a non-trivial function with the result of copyRef() or any
other function which returns a safe pointer type as an argument as safe.
DeltaFile
+23-0clang/test/Analysis/Checkers/WebKit/unchecked-call-arg.cpp
+3-0clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
+3-0clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp
+1-0clang/test/Analysis/Checkers/WebKit/mock-types.h
+30-04 files

LLVM/project 70cd176libc/src/__support/math CMakeLists.txt roundf.h, libc/test/src/math/smoke RoundTest.h

[libc][math] Do not use __builtin_round* with clang on x86 by default. (#220739)

`__builtin_round`/`__builtin_roundf` expansion for x86-64 using SSE4.1
rounding
instruction by clang is only correct for the default rounding mode.

See https://github.com/llvm/llvm-project/issues/140252
DeltaFile
+33-33libc/test/src/math/smoke/RoundTest.h
+11-1libc/src/__support/math/roundf.h
+11-1libc/src/__support/math/round.h
+4-1libc/src/__support/math/CMakeLists.txt
+59-364 files

LLVM/project a163485clang/include/clang/CIR/Dialect/IR CIROps.td, clang/test/CIR/CodeGenBuiltins builtin-isinf-sign.c builtin-isfpclass.c

[CIR] Migrate the FPClassTest bit enum and unquote its flags

cir.is_fp_class printed its flags inconsistently. Single-bit values came out
bare, as in `fcSNan`, while group values and combinations came out quoted, as
in `"fcInf"` and `"fcSNan|fcNegInf"`. That comes from I32BitEnumAttr setting
printBitEnumQuoted, which EnumAttr.td keeps only for backwards compatibility.

Clearing the bit and using the `enum` directive selects the separator-aware
parser and printer, so every value now spells unquoted:

  cir.is_fp_class %x, fcSNan|fcNegInf : (!cir.float) -> !cir.bool

The enum also drops its specialized IntegerAttr for a CIR_EnumAttr wrapper,
giving it the standalone spelling `#cir.fp_class<fcSNan|fcNegInf>`. This
changes operation syntax, so it updates 37 CHECK lines.
DeltaFile
+20-20clang/test/CIR/CodeGenBuiltins/builtin-fpclassify.c
+16-16clang/test/CIR/CodeGenBuiltins/builtin-isfpclass.c
+18-2clang/test/CIR/IR/enum-attrs.cir
+12-2clang/include/clang/CIR/Dialect/IR/CIROps.td
+1-1clang/test/CIR/CodeGenBuiltins/builtin-isinf-sign.c
+67-415 files

LLVM/project d9cdc41clang/include/clang/CIR/Dialect/IR CIRAttrs.td CIROps.td, clang/test/CIR/IR enum-attrs.cir

[CIR] Migrate GlobalLinkageKind, CallingConv and SideEffect off IntegerAttr

GlobalLinkageKind, CallingConv and SideEffect generated IntegerAttr
subclasses with no dialect spelling of their own. Each now sets
genSpecializedAttr = 0 and gains a CIR_EnumAttr wrapper, and cir.global wraps
$linkage in `enum()`. GlobalLinkageKind spells `#cir.linkage<internal>`,
dropping both the `global_` prefix and the `_kind` suffix.

cir.func and cir.call print all three by hand, but they stream
stringifyGlobalLinkageKind(getLinkage()) and friends, which take the enum
rather than the attribute, so those sites are unchanged.

Operation syntax is unchanged.
DeltaFile
+31-0clang/test/CIR/IR/enum-attrs.cir
+17-8clang/include/clang/CIR/Dialect/IR/CIROps.td
+4-0clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+52-83 files

LLVM/project 0a5fd34clang/include/clang/CIR/Dialect/IR CIRCUDAAttrs.td CIROps.td, clang/test/CIR/IR enum-attrs.cir

[CIR] Migrate seven operation enums off IntegerAttr

CastKind, DynamicCastKind, CmpOpKind, ComplexRangeKind, InitCatchKind,
CaseOpKind and AwaitKind generated IntegerAttr subclasses. The operations
printed them symbolically, but in an attribute dictionary `cir.cast bitcast`
was stored as `kind = 1 : i32`.

Each enum now sets genSpecializedAttr = 0 and gains a CIR_EnumAttr wrapper,
and the operations wrap the argument in `enum()` to keep the bare keyword,
giving spellings like `#cir.cast<bitcast>`. Mnemonics drop the suffix the C++
class name carries. DynamicCastKind spells out `dynamic_cast`, since
`dyn_cast` is taken by the operation and by `#cir.dyn_cast_info`.

CUDADeviceVarKind gets no wrapper, being only a raw parameter of
CIR_CUDAVarRegistrationInfoAttr.

Operation syntax is unchanged, and enum-attrs.cir covers the new spellings.
DeltaFile
+86-0clang/test/CIR/IR/enum-attrs.cir
+57-25clang/include/clang/CIR/Dialect/IR/CIROps.td
+4-3clang/include/clang/CIR/Dialect/IR/CIRCUDAAttrs.td
+147-283 files

LLVM/project 26e5464clang/include/clang/CIR/Dialect/IR CIROps.td, clang/test/CIR/IR enum-attrs.cir

[CIR] Migrate MemOrder and SyncScopeKind off IntegerAttr

MemOrder and SyncScopeKind, the enums the atomic operations share, generated
IntegerAttr subclasses with no dialect spelling of their own.

Both now set genSpecializedAttr = 0 and gain CIR_EnumAttr wrappers, spelling
`#cir.mem_order<seq_cst>` and `#cir.sync_scope<system>`, and the atomic
operations wrap their arguments in `enum()` to keep the bare keyword.

`enum()` works as an optional-group anchor, so the `syncscope` and `atomic`
groups on cir.load and cir.store are unaffected. Operation syntax is
unchanged.
DeltaFile
+38-30clang/include/clang/CIR/Dialect/IR/CIROps.td
+24-2clang/test/CIR/IR/enum-attrs.cir
+62-322 files

LLVM/project 3e7ba0bclang/include/clang/CIR/Dialect/IR CIROps.td, clang/test/CIR/IR enum-attrs.cir

[CIR] Migrate AssumeBundleKind, AtomicFetchKind and AsmFlavor off IntegerAttr

AssumeBundleKind, AtomicFetchKind and AsmFlavor generated IntegerAttr
subclasses with no dialect spelling of their own. Each now sets
genSpecializedAttr = 0 and gains a CIR_EnumAttr wrapper.

Unlike the other CIR operation enums, these three are reached through
hand-written parsers and printers, so they needed checking individually.
cir.atomic.fetch references $binop declaratively and gains an `enum()`
wrapper. The other two need no change, since printAssumeBundle is already
typed on cir::AssumeBundleKindAttr and InlineAsmOp::print streams the enum
rather than the attribute.

Operation syntax is unchanged.
DeltaFile
+28-0clang/test/CIR/IR/enum-attrs.cir
+19-6clang/include/clang/CIR/Dialect/IR/CIROps.td
+47-62 files

LLVM/project a078515clang/include/clang/CIR/Dialect/IR CIREnumAttr.td CIROps.td, clang/test/CIR/IR invalid-loop-cleanup.cir cleanup-scope.cir

[CIR] Give the cleanup kind a proper standalone attribute spelling

CleanupKindAttr overrode its assembly format to a bare `$value` so
`cir.cleanup.scope` would print `cleanup all`. The cost was that the
attribute had no readable standalone form, falling back to
`#cir<cleanup_kind all>`.

The `enum($attr)` operation directive removes the tradeoff. The attribute
keeps CIR_EnumAttr's bracketed default and now spells `#cir.cleanup<all>`,
while the operations ask for the bare keyword. The mnemonic drops the `_kind`
suffix the C++ class name carries.

Operation syntax is unchanged. invalid-loop-cleanup.cir now gets one
diagnostic from the enum parser instead of two.
DeltaFile
+21-0clang/test/CIR/IR/cleanup-scope.cir
+4-8clang/include/clang/CIR/Dialect/IR/CIROps.td
+2-4clang/test/CIR/IR/invalid-loop-cleanup.cir
+5-0clang/include/clang/CIR/Dialect/IR/CIREnumAttr.td
+32-124 files

LLVM/project 4fdd805clang/include/clang/CIR/Dialect/IR CIRAttrs.td, clang/lib/CIR/CodeGen CIRGenModule.h CIRGenModule.cpp

[CIR] Delete the unused cir::VisibilityAttr

CIR_VisibilityAttr had no users. `cir.global` and `cir.func` carry visibility
as `EnumProp<CIR_VisibilityKind>`, a property rather than an attribute, so
nothing ever built or printed the attribute.

Its only consumer was CIRGenModule::getGlobalVisibilityAttrFromDecl, itself
never called, and that was the only caller of
getGlobalVisibilityKindFromClangVisibility, so all three go together. The
similar getCIRVisibilityKind does have a caller and stays, as does
CIR_VisibilityKind, which the property is built from.

This also removes one of the two attributes overriding their assembly format
to a bare `$value`.
DeltaFile
+1-28clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+0-26clang/lib/CIR/CodeGen/CIRGenModule.cpp
+0-3clang/lib/CIR/CodeGen/CIRGenModule.h
+1-573 files

LLVM/project 95f863fclang/lib/CIR/Dialect/IR CIRAttrs.cpp, clang/test/CIR/CodeGenOpenCL kernel-arg-info-single-as.cl kernel-arg-info.cl

[CIR] Drop lang_address_space's custom parenthesized attribute format

CIR_LangAddressSpaceAttr overrode its assembly format to
`(` custom<AddressSpaceValue>($value) `)`. The parentheses defeated the
dialect's `#cir.mnemonic<...>` syntax, so the attribute printed as
`#cir<lang_address_space(offload_global)>`. It now uses the bracketed
CIR_EnumAttr default and spells `#cir.lang_address_space<offload_global>`.

The `lang_address_space(x)` spelling inside `!cir.ptr` and `cir.global` is
unaffected, since that goes through MemorySpaceAttrInterface in CIRTypes.cpp.
The attribute-level pair in CIRAttrs.cpp was only reachable from the deleted
format, so it goes away.
DeltaFile
+14-14clang/test/CIR/CodeGenOpenCL/kernel-arg-info.cl
+0-20clang/lib/CIR/Dialect/IR/CIRAttrs.cpp
+6-6clang/test/CIR/IR/invalid-opencl-kernel-arg-metadata.cir
+4-4clang/test/CIR/IR/opencl-kernel-arg-metadata.cir
+3-3clang/test/CIR/CodeGenOpenCL/kernel-arg-info-single-as.cl
+2-2clang/test/CIR/Lowering/opencl-kernel-arg-metadata.cir
+29-491 files not shown
+29-537 files

LLVM/project 84dff6cclang/test/CIR/CodeGen global-tls-dynamic-vs-static.cpp global-tls-dyn-init.cpp

[CIR] Print cir.global's TLS model without naked angle brackets

`cir.global` printed `tls_model = <tls_dyn>`. Those brackets were the
leftover delimiters of `#cir.tls_model<tls_dyn>` after the printer stripped
the dialect prefix and mnemonic, so one enum had two spellings and the
per-global one was not something anyone would write by hand.

Wrapping the argument in the `enum` directive prints the symbolic value on
its own:

  cir.global external tls_model = tls_dyn @a = #cir.int<5> : !s32i

The standalone attribute is unchanged. invalid-tls.cir now gets one
diagnostic from the enum parser instead of two.
DeltaFile
+24-24clang/test/CIR/CodeGen/tls-model.cpp
+16-16clang/test/CIR/CodeGen/tls-model-func-scope.cpp
+14-14clang/test/CIR/CodeGen/global-tls-simple-init.cpp
+13-13clang/test/CIR/CodeGen/thread-local-in-func.cpp
+9-9clang/test/CIR/CodeGen/global-tls-dynamic-vs-static.cpp
+9-9clang/test/CIR/CodeGen/global-tls-dyn-init.cpp
+85-856 files not shown
+113-11412 files

LLVM/project bf5cee8llvm/lib/Transforms/Utils SimplifyCFG.cpp, llvm/test/Transforms/SimplifyCFG switch-select-remap.ll

Revert "[SimplifyCFG] Fix profcheck failure from #213302"

This reverts commit e3df0332a876362cdfc13caf19bbac73bdbba362.
DeltaFile
+49-55llvm/test/Transforms/SimplifyCFG/switch-select-remap.ll
+2-29llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+51-842 files

LLVM/project 1c47080llvm/include/llvm/Analysis InstructionSimplify.h, llvm/lib/Analysis InstructionSimplify.cpp

InstSimplify: Fold nonnull addrspacecast of null to poison (#217905)

Perform the definitional fold if the source value is null
in the default address space.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+69-0llvm/test/Transforms/InstSimplify/addrspacecast-nonnull.ll
+23-0llvm/lib/Analysis/InstructionSimplify.cpp
+4-0llvm/include/llvm/Analysis/InstructionSimplify.h
+96-03 files

LLVM/project e3df033llvm/lib/Transforms/Utils SimplifyCFG.cpp, llvm/test/Transforms/SimplifyCFG switch-select-remap.ll

[SimplifyCFG] Fix profcheck failure from #213302

This patch fixes the profcheck failure from that patch by explicitly
updating the branch weights given we can infer what the values should
be.

Reviewers: dtcxzyw, nikic

Pull Request: https://github.com/llvm/llvm-project/pull/220811
DeltaFile
+55-49llvm/test/Transforms/SimplifyCFG/switch-select-remap.ll
+29-2llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+84-512 files

LLVM/project 1f5bea8llvm/include/llvm/ADT SmallVector.h, llvm/unittests/ADT SmallVectorTest.cpp

[ADT] Allow SmallVector move construction without move assignment (#220571)

Move-construct inline elements directly instead of using move
assignment.

This avoids requiring element types to be move-assignable.

Reland #219934 

The first version routed inline move construction through
append(move_iterator, move_iterator). For trivially copyable elements,
the iterator adapters bypassed SmallVector's raw-pointer memcpy path and
instantiated append, distance, uninitialized_copy, and iterator helpers
for each element type. This duplicated move-assignment machinery when it
was already instantiated in the same translation unit.

Use the old assignment path only for trivially move-assignable elements.
For other elements, reserve storage and use raw-pointer
uninitialized_move. This avoids generic iterator machinery and preserves

    [8 lines not shown]
DeltaFile
+77-0llvm/unittests/ADT/SmallVectorTest.cpp
+33-4llvm/include/llvm/ADT/SmallVector.h
+110-42 files

LLVM/project c05004dllvm/lib/Target/AMDGPU AMDGPULegalizerInfo.cpp AMDGPUAttributor.cpp, llvm/test/Bitcode amdgcn-addrspacecast-nonnull.ll

AMDGPU: Remove llvm.amdgcn.addrspacecast.nonnull

The intrinsic is fully replaced by the nonnull flag on addrspacecast,
so remove it.

Old bitcode/IR is autoupgraded, though this is very conservative. This
intrinsic was only inserted by the backend, and hopefully nobody was
directly emitting it.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+0-68llvm/test/CodeGen/AMDGPU/llvm.amdgcn.addrspacecast.nonnull.ll
+5-36llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+33-0llvm/test/Bitcode/amdgcn-addrspacecast-nonnull.ll
+1-26llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
+12-12llvm/test/CodeGen/AMDGPU/attributor-flatscratchinit-undefined-behavior.ll
+5-13llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+56-15510 files not shown
+86-19216 files

LLVM/project abff931llvm/lib/Target/AMDGPU AMDGPUCodeGenPrepare.cpp, llvm/test/CodeGen/AMDGPU codegen-prepare-addrspacecast-non-null.ll

AMDGPU: Set the addrspacecast nonnull flag instead of the intrinsic

AMDGPUCodeGenPrepare proved the source of certain flat<->local/private
addrspacecasts non-null and rewrote them to
llvm.amdgcn.addrspacecast.nonnull. Now that the flag is honored in
codegen, set it in place on the existing instruction instead.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+15-10llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
+12-12llvm/test/CodeGen/AMDGPU/codegen-prepare-addrspacecast-non-null.ll
+27-222 files

LLVM/project 55f1dcallvm/include/llvm/CodeGen SelectionDAGNodes.h, llvm/lib/CodeGen/SelectionDAG SelectionDAG.cpp LegalizeVectorTypes.cpp

AMDGPU: Use the addrspacecast nonnull flag in codegen

Plumb the nonnull flag through to the backend so a flagged addrspacecast
lowers without the runtime null check, matching what
llvm.amdgcn.addrspacecast.nonnull already provides.

Add the NonNull MIFlag with MIR printer/parser support (including the
MIRPrinter path and update_mir_test_checks) so it round-trips on
G_ADDRSPACE_CAST, and preserve it through SelectionDAG vector
scalarization and splitting.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+299-0llvm/test/CodeGen/AMDGPU/addrspacecast-nonnull.ll
+23-0llvm/test/CodeGen/MIR/AMDGPU/addrspacecast-nonnull.mir
+8-6llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+7-6llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+9-4llvm/include/llvm/CodeGen/SelectionDAGNodes.h
+8-4llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+354-2010 files not shown
+382-2516 files