forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Closed
MorthimerMcMare
wants to merge
68
commits into
focs-lab:main
from
MorthimerMcMare:tsan-with-ea-enable-disable-tsan-instr
Closed
Hunk cherry-pick from 8a2198773e: fix InterceptorEnabled visibility. #50
MorthimerMcMare
wants to merge
68
commits into
focs-lab:main
from
MorthimerMcMare:tsan-with-ea-enable-disable-tsan-instr
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 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
…rogress), added PHI-tests
…gMayEscapeObjectsNew
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
# 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.
…ack detailed escape reasons.
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.
…considered case of Loaded pointers)
…-- 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.
Wrong target branch for pull request... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.