[AArch64] Update the scheduling info for scvtf on Neoverse V3ae. (#219119)
These scalar instructions were being treated like vector operations, but
only require a single microop.
Revert "[SimplifyCFG] Fix profcheck failure from #213302" (#220932)
Reverts llvm/llvm-project#220811
This did not get reviewed. I thought I got a notification indicating the
PR was approved, but it was for a different PR.
[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.
[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.
[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.
[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.
[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.
[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.
[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
[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]
[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.
[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]
Redact uploaded license from the audit trail
This commit fixes an issue where `truenas.license.upload` recorded its license argument verbatim in the audit trail, because the field was never declared `Secret[...]`. Uploading needs FULL_ADMIN but audit records come back with SYSTEM_AUDIT_READ, so a read-only admin could pull out the blob a full admin installed, and the same record went to remote syslog and into debug bundles.
Marking the field `Secret[LongNonEmptyString]` means `check_annotations` stops accepting the old `license_: str` signature, and the `str(license_)` that went with it turned out to be wrong already: it stringified the `LongStringWrapper` and wrote `LongStringWrapper(<pem>)` into the license file. The daemon's PEM scan skips the leading garbage so nothing ever failed, but the on-disk copy never matched what was uploaded, which defeats the TNC heartbeat's raw_license comparison and makes every HA send_license add another wrapper layer. Unwrapping both boxes writes the PEM back byte for byte.
(cherry picked from commit a64faaf2ff66648e0712390439562a6c3f35be48)
Add a regression test for license redaction in the audit log
This commit adds changes to assert that every audit entry for `truenas.license.upload` records the redaction placeholder in place of the license, so that dropping `Secret[...]` from the field cannot quietly reopen the leak while CI stays green.
The test uploads nothing and is read-only. Whatever installed the license -- CI, TrueNAS Connect or an operator -- already went through the audited API and left the entry behind, so the entries themselves are what get inspected, and it skips when nothing has called the method. It asserts the shape of the placeholder rather than its exact text, which keeps it independent of how long the placeholder is and holds for a legacy base64 blob as much as for a v2 PEM: a legacy blob carries no PEM header, so matching on one would let a leaked legacy license through.
(cherry picked from commit 82d85cdd71c08d65b1101498b3de9e38a652e6b9)
Add a regression test for license redaction in the audit log
This commit adds changes to assert that every audit entry for `truenas.license.upload` records the redaction placeholder in place of the license, so that dropping `Secret[...]` from the field cannot quietly reopen the leak while CI stays green.
The test uploads nothing and is read-only. Whatever installed the license -- CI, TrueNAS Connect or an operator -- already went through the audited API and left the entry behind, so the entries themselves are what get inspected, and it skips when nothing has called the method. It asserts the shape of the placeholder rather than its exact text, which keeps it independent of how long the placeholder is and holds for a legacy base64 blob as much as for a v2 PEM: a legacy blob carries no PEM header, so matching on one would let a leaked legacy license through.
(cherry picked from commit 82d85cdd71c08d65b1101498b3de9e38a652e6b9)
Redact uploaded license from the audit trail
This commit fixes an issue where `truenas.license.upload` recorded its license argument verbatim in the audit trail, because the field was never declared `Secret[...]`. Uploading needs FULL_ADMIN but audit records come back with SYSTEM_AUDIT_READ, so a read-only admin could pull out the blob a full admin installed, and the same record went to remote syslog and into debug bundles.
Marking the field `Secret[LongNonEmptyString]` means `check_annotations` stops accepting the old `license_: str` signature, and the `str(license_)` that went with it turned out to be wrong already: it stringified the `LongStringWrapper` and wrote `LongStringWrapper(<pem>)` into the license file. The daemon's PEM scan skips the leading garbage so nothing ever failed, but the on-disk copy never matched what was uploaded, which defeats the TNC heartbeat's raw_license comparison and makes every HA send_license add another wrapper layer. Unwrapping both boxes writes the PEM back byte for byte.
(cherry picked from commit a64faaf2ff66648e0712390439562a6c3f35be48)
NAS-143057 / 26.0.0 / Redact uploaded license from the audit trail (#19603)
This commit fixes an issue where `truenas.license.upload` recorded its
license argument verbatim in the audit trail, because the field was
never declared `Secret[...]`. Uploading needs FULL_ADMIN but audit
records come back with SYSTEM_AUDIT_READ, so a read-only admin could
pull out the blob a full admin installed, and the same record went to
remote syslog and into debug bundles.
Marking the field `Secret[LongNonEmptyString]` means `check_annotations`
stops accepting the old `license_: str` signature, and the
`str(license_)` that went with it turned out to be wrong already: it
stringified the `LongStringWrapper` and wrote `LongStringWrapper(<pem>)`
into the license file. The daemon's PEM scan skips the leading garbage
so nothing ever failed, but the on-disk copy never matched what was
uploaded, which defeats the TNC heartbeat's raw_license comparison and
makes every HA send_license add another wrapper layer. Unwrapping both
boxes writes the PEM back byte for byte.
[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.
[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
[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.
[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.