7 Commits

Author SHA1 Message Date
S. VenkataKeerthy
741136a8ac
[NFC][IR2Vec] Removing Dimension from Embedder::Create (#142486)
This PR removes the necessity to know the dimension of the embeddings while invoking `Embedder::Create`. Having the `Dimension` parameter introduces complexities in downstream consumers. 

(Tracking issue - #141817)
2025-06-02 15:05:11 -07:00
S. VenkataKeerthy
494c82e709
[IR2Vec] Support for lazy computation of BB Embeddings (#142033)
This PR exposes interfaces to compute embeddings at BB level. This would be necessary for delta patching the embeddings in MLInliner (#141836).

(Tracking issue - #141817)
2025-05-29 15:29:55 -07:00
S. VenkataKeerthy
e74b45e078
[IR2Vec] Adding unit tests (#141873)
This PR adds unit tests for IR2Vec

(Tracking issue - #141817)
2025-05-29 13:35:29 -07:00
S. VenkataKeerthy
3581e9bb4c
[NFC][IR2Vec] Refactoring for Stateless Embedding Computation (#141811)
Currently, users have to invoke two APIs: `computeEmbeddings()` followed
by getters to access the embeddings. This PR refactors the code to
reduce this *stateful* access of APIs. Users can now directly invoke
getters; Internally, getters would compute the embeddings.
2025-05-28 12:19:02 -07:00
Kazu Hirata
0918361d8b
[Analysis] Remove unused includes (NFC) (#141319)
These are identified by misc-include-cleaner.  I've filtered out those
that break builds.  Also, I'm staying away from llvm-config.h,
config.h, and Compiler.h, which likely cause platform- or
compiler-specific build failures.
2025-05-23 23:59:56 -07:00
Kazu Hirata
30a9d9d25b [Analysis] Fix warnings
This patch fixes:

  llvm/lib/Analysis/IR2Vec.cpp:76:3: error: default label in switch
  which covers all enumeration values
  [-Werror,-Wcovered-switch-default]

  llvm/lib/Analysis/IR2Vec.cpp:218:12: error: unused variable 'Dim'
  [-Werror,-Wunused-variable]
2025-05-22 10:12:25 -07:00
S. VenkataKeerthy
58ab005d8d
Adding IR2Vec as an analysis pass (#134004)
This PR introduces IR2Vec as an analysis pass. The changes include:
- Logic for generating Symbolic encodings.
- 75D learned vocabulary.
- lit tests.

Here is the link to the RFC -
https://discourse.llvm.org/t/rfc-enhancing-mlgo-inlining-with-ir2vec-embeddings

Acknowledgements: contributors -
https://github.com/IITH-Compilers/IR2Vec/graphs/contributors

---------

Co-authored-by: svkeerthy <venkatakeerthy@google.com>
Co-authored-by: Mircea Trofin <mtrofin@google.com>
2025-05-22 09:50:21 -07:00