[mlir] Add analysis filter in dataflow solver (#192998)
Adds an optional filtering control function to the dataflow solver's
initializeAndRun callback, which controls which analyses will be
initialized when running the solver. This makes it possible to reuse
existing dataflow solver instances that have already run to a fixpoint
without re-initializing all of the analyses that have already converged.
A new analysis and test pass is also added, which illustrates how the
filtering can be useful to run a staged analysis, which would not have
been possible before. The example analysis, called `BarAnalysis`,
depends on the converged state of the `FooAnalysis`. The Bar analysis is
a forward analysis that tracks, for each program point, whether any of
the preceding program points hold a `foo_state` that is divisible by 4.
In the example test, the control flow graph looks like the following:
```
entry-block
/ \
[29 lines not shown]
Re-apply: workflows: Use main-branch-only environment when using ISSUE_SUBSCRIBER_TOKEN (#179990) (#193801)
This way we can prevent the secret from being used in user branches.
We originally reverted this because it was spamming the PRs with
'deployment' messages. GitHub has added a new feature to disable these
messages, so it should be safe to re-apply this.
[CIR] Fix remaining (part 2) FlattenCFG rewriter contract violations (#192503)
Fix all 17 remaining MLIR expensive pattern check violations in
CIRFlattenCFGPass. Found by MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.
Fingerprint violations (patterns modifying IR without notifying
rewriter):
- Use rewriter.replaceAllUsesWith() instead of direct
replaceAllUsesWith() in replaceCallWithTryCall (tests: invoke-attrs.cpp,
try-catch.cpp, try-catch-all-with-cleanup.cpp)
- Use rewriter.modifyOpInPlace() for removeCleanupAttr() in TryOp
flattening (tests: flatten-try-op.cir, flatten-cleanup-scope-eh.cir,
flatten-throwing-in-cleanup.cir)
IR verification failures (invalid intermediate IR after pattern
application):
- Expand nested op checks in Switch, Loop, CleanupScope, and TryOp
flattening to include all structured CIR ops (ScopeOp, IfOp, TernaryOp,
etc.), not just CleanupScopeOp. Break/continue/return inside nested
[12 lines not shown]
[CIR] Add `__attribute__((annotate(...)))` support (#193329)
Implement end-to-end (Dialect, CIRGen, Lowering) support for
__attribute__((annotate(...))) on functions and global variables.
Dialect:
- cir::AnnotationAttr (#cir.annotation<name = "...", args = [...]>).
- $annotations on cir.func and cir.global (ArrayAttr of AnnotationAttr).
FuncOp gets a custom parser/printer entry; for GlobalOp it's tacked onto
the assemblyFormat.
CIRGen:
- Annotations are attached as deferred entries in CIRGenModule and
flushed at end-of-TU so the most up-to-date ValueDecl wins (decl
annotations + def annotations both stick).
- emitAnnotationArgs uniques arg ArrayAttrs via FoldingSetNodeID so two
functions with identical args share one ArrayAttr (and one .args
constant in LLVM lowering).
- addGlobalAnnotations supports both GlobalOp and FuncOp paths,
[10 lines not shown]
clang: Check -Xarch compatibility using Triple parsed architecture. (#189651)
This will allow recognizing any of the triple aliases for the
architecture. This will avoid test failures when the amdgcn triple top
level architecture is renamed.