8000 Hunk cherry-pick from 8a2198773e: fix InterceptorEnabled visibility. by MorthimerMcMare · Pull Request #50 · focs-lab/llvm-project · GitHub
[go: up one dir, main page]

Skip to content

Hunk cherry-pick from 8a2198773e: fix InterceptorEnabled visibility. #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

MorthimerMcMare
Copy link

No description provided.

* Flow-sensitive aggressive EA
* Regression tests
* Make EA BB-wise, not function-wise
* Updated tests accordingly
* Updated TSan integration: BB-wise
* Updated TSan integration: use getUnderlyingEscapingObject instead getUnderlyingObject
* Fixed transitivity issue when merging EAs
…ring

* Considering external 'already escaped' objects: pointer arguments, global variables
* Consider aliasing when adding escaping objects
* Refactoring: EscapeState and AliasRelationTy
1. Simplified getEscapeKindForPtrOpnd
2. Add use getUnderlyingMayEscObjectsNew  in getEscapeKindForPtrOpnd
3. Use getUnderlyingMayEscObjectsNew in TSan
* Finishing propagation of IPA function escape info through callgraph
* Added IPA EA print
* Added simple IPA EA test
* Refactoring (mostly with auto inspection)
* Switched TSan tests to global EA
* Fixed bug in isExternalEscapedObject
* Added support of variadic functions
* Fixed InstrOmitted logic
apaznikov and others added 28 commits December 13, 2024 17:04
# Conflicts:
#	llvm/include/llvm/Analysis/EscapeAnalysis.h
#	llvm/lib/Analysis/EscapeAnalysis.cpp
#	llvm/test/Analysis/EscapeAnalysis/ipa-recursive.ll
Refactored multiple functions in escape analysis to streamline object escape detection and alias handling. Unified redundant logic by introducing `getExtObjStatus` and `getExtObjStatusWithArgLookup`, and minimized duplicate or unnecessary computations. This improves code maintainability and clarity for object escape tracking.
Reorganized methods and declarations in the EscapeAnalysis class, enhancing code structure and consistency. Moved function definitions to the corresponding .cpp file and updated naming conventions for better clarity. These changes streamline the codebase for better future maintainability and understanding.
This commit refactors Escape Analysis to include interprocedural tracking of returning escaped values. It introduces new data structures, `IPAFuncEscInfo`, to capture argument escapes and return escape status. Additionally, associated tests have been added to validate the updated analysis.
Introduce functions to evaluate argument escape statuses based on call sites, streamline call graph traversal logic, and separate internal and external escape analysis. Simplify debugging outputs and remove unused static functions for better maintainability.
Added infrastructure for top-down argument escape tracking, including new maps and methods like `getArgEscStatusFromCallers`. Defined debug utilities and enhanced call graph traversal to handle top-down analysis. Reorganized function signatures and updated escape summaries for better clarity and consistency.
Introduce the `isFuncPassedToObjCSelector` function to identify functions used in Objective-C selectors. Enhance debugging output in escape analysis for better traceability. Modify loop processing in `getFullEscapedForBBReason` to skip empty predecessors.
…-down traversal.

This commit removes unnecessary debug prints from `EscapeAnalysis.cpp` to clean up the code. It also refines the escape analysis by ensuring entry blocks are excluded from specific checks and adds a comprehensive test case (`ipa-top-bottom.ll`) to validate top-bottom call graph traversal.
Replaced the assertion checking local functions with a more accurate condition ensuring the function exists and is not a declaration. This prevents potential crashes when analyzing external or undefined functions.
…ddAlias

Replaced raw Value* handling with UnderlObjInfo to improve clarity and add support for LoadInst flags. Removed redundant utility functions, consolidated underlying object handling, and adjusted escape analysis workflow for more accurate alias and escape tracking.
…points to the escaped objects) not escape itself

Replaced "AliasRelation" with generalized "PointsTo" relationship for escape analysis and refactored related methods for consistency.
…-- DEBUG

Introduced the `InterceptorEnabled` global variable to allow runtime control of memory function interception. Updated the `memset` interceptor to check this flag before performing interception logic. Adjustments were also made to relevant LLVM and ThreadSanitizer components to initialize and utilize this new control mechanism.
This adds a globally accessible `InterceptorEnabled` variable to control interceptor behavior dynamically. The changes ensure interceptors can be selectively disabled during specific instructions, with proper restoration of the state afterward. This improves flexibility in handling memory intrinsics and thread sanitization instrumentation.
Refactored escape analysis for better modularity by introducing `isSafeExternalCall` and integrating pointer escape checks into `instrumentInterceptedCalls`. Added handling for intercepted functions like `strcmp`, `strlen`, and `memchr` in `ThreadSanitizer`, optimizing instrumentation by disabling interceptors when arguments are confirmed safe. Enabled debugging outputs to assist in development and analysis.
@MorthimerMcMare
Copy link
Author

Wrong target branch for pull request...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0