[PATCH] D134915: Do not emit JCC to __x86_indirect_thunk

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 11:08:43 PDT 2022


nickdesaulniers added a comment.

Thanks for the patch!



================
Comment at: llvm/lib/Target/X86/X86InstrInfo.cpp:2950
+    // Kernel patches thunk calls in runtime, these should never be conditional.
+    auto Target = TailCall.getOperand(0);
+    if (Target.isSymbol()) {
----------------
const MachineOperand &


================
Comment at: llvm/test/CodeGen/X86/jcc-indirect-thunk-kernel.ll:1
+; RUN: llc < %s -O2 -mtriple=x86_64-unknown-linux-gnu -x86-indirect-branch-tracking --code-model=kernel | FileCheck %s --check-prefix=CHECK-KERNEL-JCC-THUNK
+
----------------
If you don't have multiple run lines with different check-prefixes, then check prefixes are unnecessary. Please drop this flag, then just use the implicit default `; CHECK: ` below.


================
Comment at: llvm/test/CodeGen/X86/jcc-indirect-thunk-kernel.ll:1
+; RUN: llc < %s -O2 -mtriple=x86_64-unknown-linux-gnu -x86-indirect-branch-tracking --code-model=kernel | FileCheck %s --check-prefix=CHECK-KERNEL-JCC-THUNK
+
----------------
nickdesaulniers wrote:
> If you don't have multiple run lines with different check-prefixes, then check prefixes are unnecessary. Please drop this flag, then just use the implicit default `; CHECK: ` below.
Consider using `update_llc_test_checks.py llvm/test/CodeGen/X86/jcc-indirect-thunk-kernel.ll` process this file.


================
Comment at: llvm/test/CodeGen/X86/jcc-indirect-thunk-kernel.ll:1
+; RUN: llc < %s -O2 -mtriple=x86_64-unknown-linux-gnu -x86-indirect-branch-tracking --code-model=kernel | FileCheck %s --check-prefix=CHECK-KERNEL-JCC-THUNK
+
----------------
nickdesaulniers wrote:
> nickdesaulniers wrote:
> > If you don't have multiple run lines with different check-prefixes, then check prefixes are unnecessary. Please drop this flag, then just use the implicit default `; CHECK: ` below.
> Consider using `update_llc_test_checks.py llvm/test/CodeGen/X86/jcc-indirect-thunk-kernel.ll` process this file.
does `-x86-indirect-branch-tracking` make a difference to this test?


================
Comment at: llvm/test/CodeGen/X86/jcc-indirect-thunk-kernel.ll:9
+
+; Function Attrs: cold noredzone nounwind null_pointer_is_valid optsize sspstrong
+define dso_local void @foo(void()** %something) #0 {
----------------
delete this line.


================
Comment at: llvm/test/CodeGen/X86/jcc-indirect-thunk-kernel.ll:24
+
+attributes #0 = { nounwind uwtable optsize "target-cpu"="x86-64" "target-features"="+retpoline-indirect-calls,+retpoline-external-thunk" }
+attributes #1 = { nounwind }
----------------
can these attributes be reduced?


================
Comment at: llvm/test/CodeGen/X86/jcc-indirect-thunk-kernel.ll:25
+attributes #0 = { nounwind uwtable optsize "target-cpu"="x86-64" "target-features"="+retpoline-indirect-calls,+retpoline-external-thunk" }
+attributes #1 = { nounwind }
----------------
delete this attribute


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134915



More information about the llvm-commits mailing list