[LoopInfo] Replace raw loop-container accessors with semantic operations (#210653)
getBlocksVector, mutable getBlocksSet, getSubLoopsVector, and
getTopLevelLoopsVector expose LoopInfo's internal containers, so every
caller open-codes loop-nest surgery, keeps the block vector and set in
sync by hand, and freezes the representation. Replace them with two
LoopInfoBase operations:
* removeBlocksIf(LoopT &, Pred): drop matching blocks from a loop.
* takeChildrenIf(LoopT *Parent, Pred): detach and return matching
children, clearing their parent; a null Parent means the top level.
Both preserve the relative order of what remains. Mutation inside
LoopInfoBase also lets the analysis repair derived state once per edit
and finish a multi-step edit before any query observes it, which an
accessor returning a container cannot.
For the same reason, move hasNoExitBlocks, getExitEdges, and
getUniqueLatchExitBlock onto LoopInfoBase.
[7 lines not shown]
[TTI] Fix haveFastClmul to access inherited DL via thisT() (#210647)
haveFastClmul() called DL.getIndexType()/DL.getAllocaAddrSpace()
directly, relying on the `using TargetTransformInfoImplBase::DL;`
declaration in BasicTTIImplBase to bring the inherited DataLayout
reference into scope. Because DL is reached through a two-level
dependent base chain (BasicTTIImplBase<T> ->
TargetTransformInfoImplCRTPBase<T>-> TargetTransformInfoImplBase), some
compilers (observed with GCC 8.5.0) mis-resolve the member access and
reject the code with a misleading diagnostic naming
TargetTransformInfoImplBase rather than DataLayout.
Access DL via thisT()->DL instead, matching the pattern already used
elsewhere in this file (e.g. getABITypeAlign() call sites), which forces
lookup to be deferred to instantiation time and avoids the
compiler-version-dependent behavior.
misc/libspnav: fix spnav.pc
From the PR:
Working on cad/horizon-eda, I noticed that libspnav
is not found: this is caused by an un-portable SED
script, producing an incomplete file.
PR: 296024
[clang] Remove stale TransformTypeTraits.def entry from module map (#210878)
Commit 2a33792a2ec1 ("[clang][NFC] move traits to tablegen", #201491)
deleted clang/include/clang/Basic/TransformTypeTraits.def in favor of a
tablegen-generated clang/Basic/Traits.inc. The stale module map entry
broke module builds. Renaming it to "clang/Basic/Traits.inc" doesn't
seem to work, ('clang/Basic/Traits.inc' not found) but the build
succeeds with the entry dropped entirely.
Assisted-by: Claude Sonnet 5
rdar://182772346
[RISCV] Run EarlyMachineLICM before VLOptimizer to hoist constant splats (#210028)
RISCVVLOptimizer runs before the machine SSA optimization passes. This
includes EarlyMachineLICM, which causes previously loop invariant
vmv.v.i/vmv.v.x/vfmv.v.f splats to use a loop variant VL defined by a
PseudoVSETVLI. This prevents splats from being hoisted out:
https://godbolt.org/z/Wf49roo7s
This fixes it by adding another pass of EarlyMachineLICM before
RISCVVLOptimizer.
As measured on llvm-test-suite w/ `-march=rva23u64 -O3` this increases
the number of vector splat instructions hoisted by MachineLICM by 4.4x,
from 2140 to 9327.
Compile time wise, the number of instructions executed increases geomean
+0.2% on CTMark for -O3. -O0 builds are unaffected.
Two other approaches were considered:
[10 lines not shown]
[libc][cpp::string] Don't allocate a string in operator=(string_view)
This PR:
- Updates `opreator=(string_view)` to avoid allocating a temporary string: https://github.com/llvm/llvm-project/blob/67ebc4b221c3e94028b33004cd5cd08deee95048/libc/src/__support/CPP/string.h#L106-L108
- Changes `operator+=(const string&)` to accept a `string_view` so that strings may be appended without allocation.
- Adds asserts to make it clear that `cpp::string` does not support self assignment. Currently, `cpp::string s = "abc"; s = s;` will zero out the string.
18259 Panic when running 'zpool split'
Reviewed by: Gordon Ross <Gordon.W.Ross at gmail.com>
Approved by: Robert Mustacchi <rm+illumos at fingolfin.org>
[mlir][LLVMIR] Add export coverage for retained local variables (#209911)
Adds export coverage for a retained local variable case where MLIR may
contain separate `DILocalVariableAttr`s for the same source-level
variable.
A local variable can appear both in a `DISubprogram`'s `retainedNodes`
and in a debug intrinsic such as `dbg.value` or `dbg.declare`. During
import, the `retainedNodes` path may see the variable while the
containing subprogram is represented by a self-recursive placeholder,
while the debug intrinsic path later sees the finalized subprogram. This
can produce two MLIR local variable attrs with different subprogram
scopes.
The exported LLVM IR debug metadata is still canonical for this case:
both the debug intrinsic and the subprogram `retainedNodes` reference
the same `DILocalVariable` metadata node. This patch adds regression
coverage for that export behavior without extending the recursive
debug-info machinery.
firewall: pluginify filter_core_get_default_nat_outbound_networks() #10539
Bring a bit of structure into this legacy code: move the "plugin"
parts to its own "oubound_net" run target, collect it with the new
filter_auto_source_nat() and just iterate over it from the code
that needs this. We do all of this to provide a possible configd
target to expose the actual automatic rules skeleton to the MVC
source NAT GUI.
# pluginctl -r outbound_nat
{
"pf": {
"wan": {
"lan": "LAN networks",
"lo0": "Loopback networks",
"127.0.0.0/8": "127.0.0.0/8"
}
}
}
[RISCV] Don't transfer (select c, t, f) to Zicond when optimizing for size (#163501)
The Zicond form of (select c, t, f), (or (czero_eqz t, c),
(czero_nez f, c)), has no compressed encodings and is always 12 bytes.
The branch form (branch + mv) is at most 8 bytes, and with the C
extension
4 bytes when the branch compresses (c.mv always does) or 6 bytes when it
does not; it shrinks further when a condition is shared across selects.
Since it is never larger by byte count, skip the Zicond transform under
optsize via !DAG.shouldOptForSize().
Fixes https://github.com/llvm/llvm-project/issues/158633.