[PATCH] D134915: [X86] Do not emit JCC to __x86_indirect_thunk

Joao Moreira via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 12:17:40 PDT 2022


joaomoreira marked an inline comment as done.
joaomoreira added inline comments.


================
Comment at: llvm/test/CodeGen/X86/jcc-indirect-thunk-kernel.ll:28
+
+attributes #0 = { optsize "target-features"="+retpoline-indirect-calls,+retpoline-external-thunk" }
----------------
nickdesaulniers wrote:
> but optimize this fn for size?  Are either/any of these necessary?
yes -- while experimenting what I noticed is that optsize is what ends up forcing the sequence:

cmp
je 1f
jmp indirect_thunk
1:
ret

to be converted in:

cmp
jne indirect_thunk
ret

Also, we are only preventing the above for jcc tail calls that end up targeting the external thunk, thus we want the indirect call to be converted into a direct call to the thunk. Thus we want the retpoline-external-thunk too. I was under the impression that retpoline-indirect-calls was also necessary at first, but just re-tested it and it seems that this one can go away.


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

https://reviews.llvm.org/D134915



More information about the llvm-commits mailing list