[PATCH] D158317: [IR] Add SturcturalHash printer pass

Aiden Grossman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 28 13:39:34 PDT 2023


aidengrossman added inline comments.


================
Comment at: llvm/test/Analysis/StructuralHash/structural-hash-printer.ll:17
+
+; CHECK: Module Hash: 39c8037f62da229
+; CHECK-NEXT: Function f1 Hash: b677567fe628d557
----------------
aeubanks wrote:
> seems unfortunate to hardcode specific hashes, can we instead do something like
> ```
> CHECK-NEXT: Function f1 Hash: [[H:([a-z0-9]{16})]]
> CHECK-NEXT: Function f2 Hash: [[H:([a-z0-9]{16})]]
> 
> DETAILED-NEXT: Function f1 Hash: [[H:([a-z0-9]{16})]]
> DETAILED-NOT: Function f2 Hash: [[H]]
> DETAILED-NEXT: Function f2 Hash: {{([a-z0-9]{16})}}
> ```
That is definitely an elegant way of doing that. I hadn't seen substitution blocks before. Thanks for pointing them out! I've left the exact detailed hash values in the other test file as I still think it's important to test that the values are stable across runs/machines matching the criteria to avoid accidentally hashing a pointer. If a different from of testing for that is desired, I can change it up though.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158317/new/

https://reviews.llvm.org/D158317



More information about the llvm-commits mailing list