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

Dmitry Mikulin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 3 11:31:01 PDT 2018


dmikulin marked an inline comment as done.
dmikulin added a comment.

>> No, that statement is doing the reverse of what you're doing. It's replacing directs calls to a function to calls to the jumptable entry. (F/FDecl have different meanings in the 2 other cases than how you're using them.)
> 
> Sounds like we need to skip direct calls in replaceUsesExceptBlockAddr(). Make it replaceUsesExceptBlockAddrOrDirectCalls()

Hmm... This broke some tests, test/Transforms/LowerTypeTests/import-icall.ll to be specific. A direct call to @external, which is a CfiFunctionDecl, is expected to go through a jump table entry. With my change it doesn't.
Playing a bit more with thin and full LTO, it looks like a direct external call to a function with the same type as function pointers used in the program, will go through a jump table entry even in full LTO. Is this by design?


https://reviews.llvm.org/D46326





More information about the llvm-commits mailing list