Revert " [KnownFPClass] add applyInputSemantics to handle NSZ and the input denormal mode" (#244087)
Reverts https://github.com/llvm/llvm-project/pull/242439, which I
committed without approval.
There are no in-tree users, so this revert is NFC.
netipsec: Set the outer IPv6 flow label from the SA
Tunnel mode encapsulation leaves the flow label of the outer IPv6 header
zero. ESP and AH have no transport ports (UDP-encapsulated ESP has them, but
the same pair for every SA), so devices that hash IPv6 headers to spread
traffic, link aggregates and ECMP routers alike, see no difference between
the security associations of two gateways and put all of their tunnels on
one path. lagg(4)'s own header hash does the same: for IPv6 its layer 4
input is the flow label.
Set the label to the low 20 bits of the SA's flow ID, the hash of its SPI
that the previous change introduced. Each SA then carries one label for its
lifetime; SPIs are unique within the SADB, so distinct SAs carry distinct
labels unless the 20-bit hashes collide. A hasher that includes the flow
label then spreads SAs over its paths while keeping the packets of each SA
on one, which avoids reordering their sequence numbers across paths. A rekey
starts a new SA and a new label. The label is set whether or not
net.inet.ipsec.sa_flowid is enabled: that sysctl governs the local transmit
queue selection, this label what the network sees. In a bundle whose tunnel
[29 lines not shown]
RegisterCoalescer: Drop unused value numbers after joining
Erasing a pruned IMPLICIT_DEF marks its value number unused but leaves
it in NewVNInfo, and LiveRange::join only skipped null entries, so the
joined range kept a dead value number. Skip unused entries in join and
size valnos to the number actually kept. pruneSubRegValues similarly
only marked the pruned subrange value unused, so remove it instead.
The resulting live intervals now will have the same value numbers as a
fresh LiveIntervals computation.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
ARM: Expand atomic load/store orderings without barriers in IR (#243135)
Targets without native atomics or barriers marked i32 ATOMIC_LOAD and
ATOMIC_STORE as Custom so it could change the lowering based on the
ordering. Orderings stronger than monotonic would use the legalizer's
expansion to ATOMIC_CMP_SWAP/ATOMIC_SWAP libcalls.
Make this ordering decision in the IR expansion hooks instead since
those are expressive enough to represent the ordering constraint. This
moves the handling to AtomicExpand instead of the DAG legalizer. This
is kind of a workaround, ideally the same hook would be used by both
paths. This allows setting accurate LibCall actions on
ATOMIC_LOAD/ATOMIC_STORE.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[libc][GPU] Add target-specific folder for SPIR-V to use pure float versions (#243024)
Follow math functions' approach to add target-specific folder in
libc/src/complex/. Currently, only SPIR-V targets use it but it works
for all GPU targets once they want to add some specific versions for
c99-complex math functions such as relying on some hardware instructions
in the implementation for better performance.
The reason providing SPIR-V specific version for cabsf and cargf is the
generic versions used for all GPUs for these 2 functions use 'double'
type in the implementation but 'double' is not guaranteed to be
available in core SPIR-V specs, so these 2 function will fail on any
GPUs without 'double' support, one example is Intel DG2 GPU which
exposed this issue in our pre-ci. So, we use float version atan2f and
hypotf based on integer in SPIR-V specific implementation, these 2
functions are already available in libc.
---------
Signed-off-by: jinge90 <ge.jin at intel.com>
[win][aarch64] Permit shrink-wrapping for realigned stack frames (#244060)
Removes the restriction and adds tests, no additional changes were
required.
Assisted-by: GPT-6.2 Sol
[Clang][LifetimeSafety] Avoid typed Allocate<FactType> before new (#238333)
FactManager::createFact allocated storage for polymorphic Fact
subclasses via FactAllocator.Allocate<FactType>() before constructing
the FactType object with placement new.
AllocatorBase::Allocate<T> casts the raw void * buffer returned by
Allocate(sizeof(T), alignof(T)) to T * using static_cast<T *>. Because
FactType derives from the polymorphic Fact class, compiling with Control
Flow Integrity (-fsanitize=cfi-unrelated-cast) instruments
static_cast<FactType *> to verify the vtable pointer at the returned
address before placement new has initialized the object's vtable,
causing a runtime CFI failure on uninitialized BumpPtrAllocator memory.
Use the untyped FactAllocator.Allocate(sizeof(FactType),
alignof(FactType)) overload and pass the resulting void * directly to
placement new so the FactType * pointer is only formed by the placement
new expression after the vtable pointer is initialized.
[4 lines not shown]
[Analysis] Avoid typed Allocate<T> before new in ConstructionContext (#238330)
ConstructionContext::create<T> allocated storage for ConstructionContext
subclasses via C.getAllocator().Allocate<T>() before constructing the T
instance with placement new.
AllocatorBase::Allocate<T> casts the newly allocated raw void * buffer
to T * via static_cast<T *>. Because ConstructionContext is a
polymorphic class hierarchy, building with Control Flow Integrity
(-fsanitize=cfi-unrelated-cast) instruments static_cast<T *> to check
the vtable pointer in the uninitialized BumpPtrAllocator memory before
placement new has run the constructor, trapping at runtime.
Allocate raw storage with C.getAllocator().Allocate(sizeof(T),
alignof(T)) and pass the void * buffer directly to placement new so the
typed T * pointer is produced only after construction.
Ref #238329
[2 lines not shown]
editors/openoffice-devel: address sanitizer
Add ASAN option to build with address sanitizer, for real this time.
Commit 606fcd8f5c267140316de3355fafc3601bc1ec3a missed Makefile.
Mark the ASAN option broken because the makedepend build tool has an
ASAN failure early in the build.
No PORTREVISON bump because the package is unchanged.
Fixes: 606fcd8f5c26
[CGData][Outliner] Publish locally unprofitable outliner candidates (#223125)
Publish short sequences rejected by local outlining so their counts can
be combined across code generation partitions. Keep target legality and
positive savings at each call site; read mode accounts for frame costs
using the merged count.
Preserve distinct sequence hashes across reruns and recount surviving
sites in the final instruction mapping. This retains surviving
singletons and excludes sites consumed by local outlining.
Use existing outlined CGData and disable the feature by default, with a
maximum of three instructions. Initial discovery still requires local
repetition.
On a large iOS binary, this saved about 1 MB out of a 128 MB __TEXT
segment.
Assisted by Claude and Codex
[libc] Accept 't' in the fopen mode and reject unknown characters (#236968)
`fopen(path, "rt")` failed, because FileMode treated any character it
did not know as an invalid mode. 't' is the text mode flag of the
Windows C runtime and is the default on Linux, so programs written for
Windows pass it.
This accepts 't' and ignores it, as 'e' is accepted although it is Linux
specific. It also fixes the parser being order dependent: an unknown
character cleared the mode, but a later known one set bits again, so
"rt" failed while "rtb" succeeded. An unknown character now makes the
mode invalid wherever it is.
AI disclosure: this patch was written with Claude Code. I reviewed the
change. The new FileMode tests cover 't' in every position, unknown
characters in the middle and at the end, and the order dependence.
Assisted-by: Claude
AMDGPU: Clear stale kills when merging v_mov_b16 pairs
SIPostRA16BitMovFolding can insert the merged 32-bit instruction after
an instruction that kills the first mov's source, which then reads a
register the verifier considers dead:
$vgpr7_lo16 = V_MOV_B16_t16_e32 $vgpr5_lo16
$vgpr16 = V_PERM_B32_e64 killed $vgpr5, $vgpr6, ...
$vgpr7_hi16 = V_MOV_B16_t16_e32 killed $vgpr6_lo16
=>
$vgpr16 = V_PERM_B32_e64 killed $vgpr5, $vgpr6, ...
$vgpr7 = V_PERM_B32_e64 $vgpr6, $vgpr5, ...
Clear kill flags of the first mov's source between the first mov and
the insertion point.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Check the resolved path in filesystem permission changes
The path checks of filesystem.chown, filesystem.setperm and
filesystem.setacl compared filesystem.stat's realpath, which keeps ".."
components for anything that is not itself a symlink, and matched
prefixes without a component boundary. Check os.path.realpath() of the
path instead, and compare whole path components.
Also fix the schema name in the "Must be an absolute path" error.
[InstCombine] Fix demanded classes for fpext/fptrunc under flushing denormal modes (#236656)
Fixes https://github.com/llvm/llvm-project/issues/219300
Follow-up to https://github.com/llvm/llvm-project/pull/225188
Adds denormal mode handling to `SimplifyDemandedUseFPClass` for `fpext`
and `fptrunc`/`fptrunc_round`.
Conservatively assumes that the denormal mode is dynamic if either the
`src` or `dst` denormal mode is not IEEE for both output/input.
AI Disclosure:
I used Claude Opus 5 to help write the tests.