[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 15 16:30:30 PDT 2018


vlad.tsyrklevich accepted this revision.
vlad.tsyrklevich added a comment.
This revision is now accepted and ready to land.

LGTM but I'd like to see what @pcc has to say.



================
Comment at: llvm/lib/Transforms/IPO/LowerTypeTests.cpp:1221
                        GlobalValue::ExternalWeakLinkage, "", &M);
-  F->replaceAllUsesWith(PlaceholderFn);
+  replaceCfiUses(F, PlaceholderFn);
 
----------------
dmikulin wrote:
> vlad.tsyrklevich wrote:
> > This logic is slightly different because it skips block addresses. Is it possible that a local weak function would exist that would cause an exception by not being replaced here?
> We had to special case blockaddr before and I felt that since they don't refer to function entry points (correct?), they should not be routed through jump tables and should be skipped here as well. Or, if this case never occurs,  at least it should be safe to skip.
I think you're right, the RAUW would replace the expression with a conditional so blockaddr would not work as is.


https://reviews.llvm.org/D46326





More information about the llvm-commits mailing list