[PATCH] D46326: ThinLTO+CFI: short-circuit direct calls to jump table entries

Vlad Tsyrklevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 1 14:25:56 PDT 2018


vlad.tsyrklevich added a comment.

Ditto Eli's comments. Also adding a `FDecl->replaceDirectCalls(F)` in the else block after line 1016 seems like it would also correctly rewrite direct calls for the other two cases (external functions, and local functions declared in the current TU.)



================
Comment at: llvm/include/llvm/IR/Value.h:309
+  /// replaceDirectCalls - Go through the uses list for this definition and
+  /// make each use, which is a direct function call.
+  void replaceDirectCalls(Value *New);
----------------
s/make/replace/


================
Comment at: llvm/lib/Transforms/IPO/LowerTypeTests.cpp:977
+  }
+  else if (F->isDeclarationForLinker() && !isDefinition) {
     // Declaration of an external function.
----------------
LLVM style nit: same as line as the brace above.


https://reviews.llvm.org/D46326





More information about the llvm-commits mailing list