Skip to content

Conversation

@rmrayakar
Copy link

This patch introduces a new SCC-level LLVM pass named SCCHighlightPass and a custom function attribute IsHighlighted.

  • The pass traverses the call graph using scc_iterator.
  • If any function in a strongly connected component (SCC) has the IsHighlighted attribute, the pass propagates this attribute to all other functions in the same SCC.
  • It then displays all functions with the IsHighlighted attribute in a well-formatted table that includes:
    • Demangled function name and full signature
    • Source filename and line number (from debug metadata)
    • Function size (LOC)

This pass aids in debugging and understanding call graph propagation from selectively marked functions.

Fixes #28

Commands Used to Run:

Step 1: Build the LLVM Plugin
Make sure you're in the root of the llvm-project directory and run:
cd build
ninja

Step 2: Run the custom LLVM pass from llvm-project directory
./build/bin/opt -load-pass-plugin ./build/lib/SCCHighlightPass.so -passes=highlight-scc -disable-output < llvm/test/Transforms/SCCHighlight/test.ll

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.

CallGraphSCCPass to analyze highlighted call chains

1 participant