[PATCH] D65402: [Attributor][MustExec] Deduce dereferenceable and nonnull attribute using MustBeExecutedContextExplorer
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 29 22:37:06 PDT 2019
jdoerfert added a comment.
I thought about this some more. I think you should move the explorer into the InformationCache and expose a query method like this:
void exploreMustExecuteContext(Instruction &I, SmallVectorImpl<Instruction *> &Worklist, std::function <bool(Instruction &I, bool /* MustBeExecutedWith */)> &QueryResultCallback);
The idea is:
- The InformationCache will make sure that the explore iterator is "incremented" if needed, e.g., intiially just run it until there is no more instruction to be found.
- The worklist will be populated by interesting instructions, most of the timer (transitive) users.
- The callback informs of the result and allows to re-populate the worklist. If it returns false, the exploration is aborted.
- The InformationCache will pop an instruction from the worklist, check if the explore iterator "contains" it, potentially increases the explored context, and return the result through the callback.
I think this will work well for most attributes we have now, what are your thoughts?
Also, do this exploration stuff for now only in the initialize method.
================
Comment at: llvm/test/Transforms/FunctionAttrs/nosync.ll:100
store atomic volatile i32 10, i32* %0 release, align 4
ret void
}
----------------
volatile loads/stores do not imply dereferenceability.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65402/new/
https://reviews.llvm.org/D65402
More information about the llvm-commits
mailing list