[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:28:18 PDT 2022


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


================
Comment at: llvm/test/CodeGen/X86/jcc-indirect-thunk-kernel.ll:5
+
+define dso_local void @foo(void()** %something) #0 {
+; CHECK-LABEL: foo:
----------------
nickdesaulniers wrote:
> I think if you remove one layer of indirection then you might be able to drop the load instruction below?
This is another weird one -- without the indirection, the jcc pattern is not generated, because the conditional (JE) is generated before the assignment of the function address to r11 and such assignment only happens if the conditional is met. With the indirection, the load takes the function address from memory and already places it on r11 before the condition is tested, what later makes room for fusing the pattern JE; JMP into JNE.


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

https://reviews.llvm.org/D134915



More information about the llvm-commits mailing list