[PATCH] D87312: [IRSim] Letting call instructions be legal for similarity identification.

Jon Roelofs via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 17:15:24 PDT 2020


jroelofs added inline comments.


================
Comment at: llvm/lib/Analysis/IRSimilarityIdentifier.cpp:48
+  if (isa<CallInst>(A.Inst) && isa<CallInst>(B.Inst)) {
+    if (cast<CallInst>(A.Inst)->getCalledFunction()->getName().str() !=
+        cast<CallInst>(B.Inst)->getCalledFunction()->getName().str())
----------------
Maybe you ought to have a test that exercises the indirect call case, since `getCalledFunction()` will return nullptr for that.

Might also be useful to define a short helper function that extracts the name, since you'll be repeating the same logic twice for A/B.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87312



More information about the llvm-commits mailing list