[Mlir-commits] [mlir] [mlir] support non-interprocedural dataflow analyses (PR #75583)
William Moses
llvmlistbot at llvm.org
Fri Dec 15 10:15:37 PST 2023
================
@@ -54,12 +54,22 @@ LogicalResult AbstractDenseForwardDataFlowAnalysis::visit(ProgramPoint point) {
}
void AbstractDenseForwardDataFlowAnalysis::visitCallOperation(
- CallOpInterface call, AbstractDenseLattice *after) {
+ CallOpInterface call, const AbstractDenseLattice &before,
+ AbstractDenseLattice *after) {
+ // Allow for customizing the behavior of calls to external symbols, including
+ // when the analysis is explicitly marked as non-interprocedural.
+ auto callable =
+ dyn_cast_if_present<CallableOpInterface>(call.resolveCallable());
+ if (!getSolverConfig().isInterprocedural() ||
+ (callable && !callable.getCallableRegion())) {
----------------
wsmoses wrote:
Do we want to have something like if `!callable || !callable.getCallableRegion()` here. I ask because I'm not sure how this would work in the presense of indirect function calls, which perhaps have some information on an attribute, but also I worry may otherwise may not be visited correctly for the required conservative assumptions.
https://github.com/llvm/llvm-project/pull/75583
More information about the Mlir-commits
mailing list