[llvm] [X86] Fix TC_RETURN selection failure for Win+Thunk combination (PR #175977)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 14 11:15:39 PST 2026


================
@@ -0,0 +1,19 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
+; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s --check-prefix=64BIT
+; RUN: llc -mtriple=i686-unknown-linux-gnu < %s | FileCheck %s --check-prefix=32BIT
+
+define void @test(ptr %g) #0 {
+; 64BIT-LABEL: test:
+; 64BIT:       # %bb.0:
+; 64BIT-NEXT:    movq %rdi, %r11
+; 64BIT-NEXT:    jmp __x86_indirect_thunk_r11 # TAILCALL
+;
+; 32BIT-LABEL: test:
+; 32BIT:       # %bb.0:
+; 32BIT-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; 32BIT-NEXT:    jmp __x86_indirect_thunk_eax # TAILCALL
+  tail call void %g()
+  ret void
+}
+
+attributes #0 = { "target-features"="+retpoline-external-thunk" }
----------------
mahesh-attarde wrote:

BTW, Original issue https://github.com/llvm/llvm-project/issues/175965 has 
attribute `attributes #0 = { "target-features"="+retpoline-indirect-calls" }`

https://github.com/llvm/llvm-project/pull/175977


More information about the llvm-commits mailing list