[PATCH] D101553: [Loads] Ignore type test assume sequences inserted for devirtualization

Piotr Padlewski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 2 06:22:16 PDT 2021


Prazek added inline comments.


================
Comment at: llvm/lib/Analysis/Loads.cpp:633-643
+    // Ignore unrelated instruction types that in particular may only be
+    // inserted under special compile modes. The scan limit is set quite small
+    // (6 instructions) by default, so these can have an outsized effect on this
+    // optimization. Additionally, if these instructions are only applied when
+    // feeding back instrumentation PGO, different optimization can affect
+    // matching. Specifically, it is not uncommon to apply -g or whole program
+    // devirtualization (which results in bitcast / llvm.type.test / llvm.assume
----------------
nit: This comment (which is very useful) is a big duplication in code.  
What do you think of wrapping this chunk of code to a function, so that either logic, or the comment will not get out of sync?
Something like:

  if (isUnrelatedToLoadOrStore(Inst)) // Probably could be named better.
    continue;


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101553



More information about the llvm-commits mailing list