File tree Expand file tree Collapse file tree
jlm/llvm/opt/alias-analyses Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,6 +73,14 @@ static const bool ENABLE_FUNCTION_SIMPLE_ALLOCA_ALLOWLIST =
7373static const bool ENABLE_CALL_SIMPLE_ALLOCA_ALLOWLIST =
7474 !std::getenv(" JLM_DISABLE_CALL_SIMPLE_ALLOCA_ALLOWLIST" );
7575
76+ /* *
77+ * When creating a ModRefSet representing memory effects in external functions,
78+ * simple allocas can always be excluded, since they by definition cannot be
79+ * passed via external functions or otherwise be accessible from external modules.
80+ */
81+ static const bool ENABLE_EXTERN_SIMPLE_ALLOCA_ALLOWLIST =
82+ !std::getenv(" JLM_DISABLE_EXTERN_SIMPLE_ALLOCA_ALLOWLIST" );
83+
7684/* * \brief Region-aware mod/ref summarizer statistics
7785 *
7886 * The statistics collected when running the region-aware mod/ref summarizer.
@@ -919,6 +927,12 @@ RegionAwareModRefSummarizer::SummarizeModRefs(
919927
920928 removeSimpleAllocasAroundSetjmp ();
921929
930+ if (ENABLE_EXTERN_SIMPLE_ALLOCA_ALLOWLIST )
931+ {
932+ // Use an empty allowlist, since all simple allocas should be blocked
933+ addModRefSetSimpleAllocaAllowlist (ModRefSummary_->getExternModRefSet (), {});
934+ }
935+
922936 statistics->StartAnnotationStatistics ();
923937 // Go through and recursively annotate all functions, regions and nodes
924938 for (const auto & scc : Context_->SccFunctions )
You can’t perform that action at this time.
0 commit comments