[PATCH] D65402: [Attributor][MustExec] Deduce dereferenceable and nonnull attribute using MustBeExecutedContextExplorer

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 22 14:48:51 PDT 2019


jdoerfert added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:702
+};
+
 /// Helper class for generic replication: function returned -> cs returned.
----------------
I have the feeling the logic you add here works not only for arguments but other positions too, right? If so, we should make it a helper class that can be reused. In the generic case you can use `getIRPosition().getCtxI()` for the program point.

I'm also still unsure if we should not somehow "filter" the explored instructions based on the uses of the associated value. Maybe we could do the following:
- In `accumulatePredOnMustBeExecutedContext` you take another method that yields "interesting" instructions we would like to visit if they are in the must-be-executed-context (MBECtx).
- The function for deref would look at the uses of the associated value and ask for the users. If the user was found, it can transitively ask for its user (if it wants to). If the user was not found, we do not go further (would require path exploration).
- If the asked for user is not in the visited set of the MBECtxIterator, we visit more instructions until we explored the context or we found the instruction we are looking for.

Does this make sense?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65402/new/

https://reviews.llvm.org/D65402





More information about the llvm-commits mailing list