Skip to content

Revert "[X86] Improve @gotpcrel on local symbol tests" #141021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

mariusz-sikora-at-amd
Copy link
Contributor

This reverts commit de09523.

This test is failing:

llvm/test/LTO/X86/cfi_jt_aliases.ll:30:23: error: CHECK-FULL-OD-NEXT: expected string not found in input
; CHECK-FULL-OD-NEXT: jmp {{.*}} <a>
                      ^
<stdin>:26:29: note: scanning from here
0000000000000040 <a.cfi_jt>:
                            ^
<stdin>:27:21: note: possible intended match here
 40: e9 00 00 00 00 jmp 0x45 <a.cfi_jt+0x5>

@llvmbot llvmbot added backend:X86 mc Machine (object) code LTO Link time optimization (regular/full LTO or ThinLTO) labels May 22, 2025
@llvmbot
Copy link
Member

llvmbot commented May 22, 2025

@llvm/pr-subscribers-backend-x86
@llvm/pr-subscribers-mc

@llvm/pr-subscribers-lto

Author: Mariusz Sikora (mariusz-sikora-at-amd)

Changes

This reverts commit de09523.

This test is failing:

llvm/test/LTO/X86/cfi_jt_aliases.ll:30:23: error: CHECK-FULL-OD-NEXT: expected string not found in input
; CHECK-FULL-OD-NEXT: jmp {{.*}} &lt;a&gt;
                      ^
&lt;stdin&gt;:26:29: note: scanning from here
0000000000000040 &lt;a.cfi_jt&gt;:
                            ^
&lt;stdin&gt;:27:21: note: possible intended match here
 40: e9 00 00 00 00 jmp 0x45 &lt;a.cfi_jt+0x5&gt;

Full diff: https://github.com/llvm/llvm-project/pull/141021.diff

2 Files Affected:

  • (modified) llvm/test/LTO/X86/cfi_jt_aliases.ll (+6-6)
  • (modified) llvm/test/MC/X86/gotpcrelx.s (+5-5)
diff --git a/llvm/test/LTO/X86/cfi_jt_aliases.ll b/llvm/test/LTO/X86/cfi_jt_aliases.ll
index e544602c35660..c58d2cc020872 100644
--- a/llvm/test/LTO/X86/cfi_jt_aliases.ll
+++ b/llvm/test/LTO/X86/cfi_jt_aliases.ll
@@ -27,14 +27,14 @@
 ; CHECK-THIN-RE-NEXT: FUNC GLOBAL HIDDEN {{[0-9]+}} c.cfi_jt
 
 ; CHECK-FULL-OD:      a.cfi_jt>:
-; CHECK-FULL-OD-NEXT: jmp {{.*}} <a>
-; CHECK-FULL-OD-NEXT: int3
+; CHECK-FULL-OD:      jmp {{.*}} <a.cfi_jt
+; CHECK-FULL-OD-NEXT: R_X86_64_PLT32 .La$local
 ; CHECK-FULL-OD:      b.cfi_jt>:
-; CHECK-FULL-OD-NEXT: jmp {{.*}} <b>
-; CHECK-FULL-OD-NEXT: int3
+; CHECK-FULL-OD:      jmp {{.*}} <b.cfi_jt
+; CHECK-FULL-OD-NEXT: R_X86_64_PLT32 .Lb$local
 ; CHECK-FULL-OD:      c.cfi_jt>:
-; CHECK-FULL-OD-NEXT: jmp {{.*}} <c>
-; CHECK-FULL-OD-NEXT: int3
+; CHECK-FULL-OD:      jmp {{.*}} <c.cfi_jt
+; CHECK-FULL-OD-NEXT: R_X86_64_PLT32 .Lc$local
 
 ; CHECK-THIN-OD:      a.cfi_jt>:
 ; CHECK-THIN-OD:      jmp {{.*}} <a.cfi_jt
diff --git a/llvm/test/MC/X86/gotpcrelx.s b/llvm/test/MC/X86/gotpcrelx.s
index 0de0c919458db..e88c514b22690 100644
--- a/llvm/test/MC/X86/gotpcrelx.s
+++ b/llvm/test/MC/X86/gotpcrelx.s
@@ -5,8 +5,8 @@
 
 # COMMON:     Relocations [
 # COMMON-NEXT:  Section ({{.*}}) .rela.text {
-# CHECK-NEXT:     R_X86_64_GOTPCRELX .text 0xFFFFFFFFFFFFFFFC
-# CHECK-NEXT:     R_X86_64_GOTPCRELX test 0xFFFFFFFFFFFFFFFC
+# CHECK-NEXT:     R_X86_64_GOTPCRELX mov
+# CHECK-NEXT:     R_X86_64_GOTPCRELX test
 # CHECK-NEXT:     R_X86_64_GOTPCRELX adc
 # CHECK-NEXT:     R_X86_64_GOTPCRELX add
 # CHECK-NEXT:     R_X86_64_GOTPCRELX and
@@ -49,8 +49,8 @@
 # CHECK-NEXT:     R_X86_64_CODE_4_GOTPCRELX xor
 # CHECK-NEXT:   }
 
-# NORELAX-NEXT:     R_X86_64_GOTPCREL .text 0xFFFFFFFFFFFFFFFC
-# NORELAX-NEXT:     R_X86_64_GOTPCREL test 0xFFFFFFFFFFFFFFFC
+# NORELAX-NEXT:     R_X86_64_GOTPCREL mov
+# NORELAX-NEXT:     R_X86_64_GOTPCREL test
 # NORELAX-NEXT:     R_X86_64_GOTPCREL adc
 # NORELAX-NEXT:     R_X86_64_GOTPCREL add
 # NORELAX-NEXT:     R_X86_64_GOTPCREL and
@@ -93,7 +93,7 @@
 # NORELAX-NEXT:     R_X86_64_GOTPCREL xor
 # NORELAX-NEXT:   }
 
-movl .text@GOTPCREL(%rip), %eax
+movl mov@GOTPCREL(%rip), %eax
 test %eax, test@GOTPCREL(%rip)
 adc adc@GOTPCREL(%rip), %eax
 add add@GOTPCREL(%rip), %eax

@mariusz-sikora-at-amd
Copy link
Contributor Author

Hi @MaskRay, I can reproduce this locally. Can you check this ?

@mariusz-sikora-at-amd
Copy link
Contributor Author

I see that llvm CI is also failing on this test:
https://github.com/llvm/llvm-project/actions/runs/15180554253/job/42688963812#annotation:4:100380

@mariusz-sikora-at-amd
Copy link
Contributor Author

Reverted here: 50c4506

@MaskRay
Copy link
Member

MaskRay commented May 22, 2025

Thanks. I shouldn't haven included the llvm/test/LTO/X86/cfi_jt_aliases.ll change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 LTO Link time optimization (regular/full LTO or ThinLTO) mc Machine (object) code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants