PowerPC: Fix combineRLWINM crash on an undef folding operand
Found by AI while working on something else.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
GlobalISel: Migrate misc. CombinerHelper def checks to MIPatternMatch (#216671)
Replace getVRegDef + cast/opcode-check idioms across CombinerHelper
with mi_match, adding named instruction binders and operand-form
matchers as needed.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
[analyzer] Remove irrelevant transitions in processCFGBlockEntrance (#216008)
My recent commit c76a617524fa62f85c1ff825b5d47885599c6482 cleaned up the
logic of `ExprEngine::processCFGBlockEntrance`, highlighting the fact
that it sometimes creates an extra transition that has no relevant
purpose. This commit removes this extra transition to simplify the code.
I'm confident that there was no logic that concretely looked for these
particular nodes; and this commit is a no-op if loop unrolling is
disabled (the default). Unless loop widening is also enabled, it can
only remove a node that is directly followed by a sink as its only
child.
However, this is not a NFC change, because changing the number of
exploded nodes can perturb the graph creation and traversal. I analyzed
a dozen open source projects with loop unrolling and widening both
enabled, and among almost 20.000 bug reports these perturbations caused
one new report and three lost reports, which is negligible (0.02%) and
acceptable.
[IVDescriptors] Implement MonotonicDescriptor
RFC link: https://discourse.llvm.org/t/rfc-loop-vectorization-of-compress-store-expand-load-patterns/86442
"Monotonic" variable is similar to induction variable, but its value is updated under some condition, e.g.:
```
int idx = 0;
for(int i = 0; i < n; ++i) {
// some uses of idx
if (cond)
++idx;
}
```
In this example, `i` is induction variable and `idx` is monotonic variable: it's updated only when cond == true. In LLVM IR, this looks like:
```
loop_header:
%monotonic_phi = [%start, %prehader], [ %chain_phi0, %latch]
step_bb:
[26 lines not shown]
[Flang][OpenMP] PoC module support for allocate directives
This patch implements partial support for `allocate` on Fortran
module variables, based on adding global constructor functions for each
impacted variable.
Shared as a proof of concept, because I have a few concerns about it:
1. It appears that Clang ignores `allocate` directives on global
variables instead. Is that the expected behavior?
2. The existing implementation for `allocate` in Flang doesn't
actually impact where the memory used for a variable resides. It
allocates/deallocates extra memory for it using OpenMP internal
compiler calls but then that storage is never used. The original
alloca is still used. This addition suffers from the same issue:
global constructors allocate extra memory that is never used to
update in any way the associated global variable or its users.
3. No `omp.allocate_free` (should be `omp.allocate.free`) can be added
by this approach.
4. The representation of `omp.allocate_dir` (should be `omp.allocate`)
[10 lines not shown]
[VPlan] Remove the unused CalculateTripCountMinusVF opcode (NFC) (#216675)
bcc272b3220f ("[LV] Remove DataAndControlFlowWithoutRuntimeCheck. NFC",
#183762) removed the only createNaryOp building this opcode, leaving
behind the enum entry and its cases for type inference, operand count,
scalar generation, lowering and printing. Nothing constructs it, so no
plan can contain it and no test prints it.
java/openjdk{8,11}: Remove USE_LDCONFIG from ports
OpenJDK loads the JVM and other JDK libraries explicitly from the
correct directories, so there's no need for adding them to ldconfig.
PR: 297282
Reviewed by: jrm
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58841
PowerPC: Fix MI peephole crash on an undef forwarding operand
Found by AI while working on something else.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
Support [[clang::lifetime_capture_by(X)]] in Plain Containers (#204361)
This PR implements support for `[[clang::lifetime_capture_by(X)]]` to
enable tracking lifetimes for plain structs and containers like
`std::vector` without requiring manual `[[gsl::Pointer]]` or
`[[gsl::Owner]]` annotations. The implementation extends the
`LifetimeAnnotatedOriginTypeCollector` to register types in capture_by
contracts for origin tracking.
This PR also enables the intra-procedural analysis in existing tests
using -Wlifetime-safety and updated expectations to handle the more
detailed flow-sensitive diagnostics.
```cpp
struct MyContainer {
const char* stored_ptr;
};
void captureInto(std::string_view v [[clang::lifetime_capture_by(c)]], MyContainer& c);
[22 lines not shown]
GlobalISel: Use MIPatternMatch in GIMatchTableExecutor (#216601)
Replace the getVRegDef + opcode-check idiom in isBaseWithConstantOffset
with mi_match using m_GPtrAdd and m_GConstant.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>