[llvm] [Test][ORC][JITLink] Preserve rbx in the test `ExecutionEngine/JITLink/x86-64/ELF_vtune.s` (PR #86472)

Wu Yingcong via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 7 18:29:25 PDT 2024


https://github.com/yingcong-wu updated https://github.com/llvm/llvm-project/pull/86472

>From d203fedc15f081fda3177866d060ccf2d9385048 Mon Sep 17 00:00:00 2001
From: "Wu, Yingcong" <yingcong.wu at intel.com>
Date: Mon, 25 Mar 2024 00:57:15 -0700
Subject: [PATCH 1/2] preserve rbp

---
 llvm/test/ExecutionEngine/JITLink/x86-64/ELF_vtune.s | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_vtune.s b/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_vtune.s
index 1c95bde51e1211..b734457c1ad7f7 100644
--- a/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_vtune.s
+++ b/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_vtune.s
@@ -20,12 +20,14 @@ main:
         .cfi_def_cfa_offset 16
         .cfi_offset 6, -16
         movq    %rsp, %rbp
+        pushq   %rbx
         .cfi_def_cfa_register 6
-        movl    %edi, -4(%rbp)
+        movl    %edi, -8(%rbp)
         movq    %rsi, -16(%rbp)
-        movl    -4(%rbp), %ebx
+        movl    -8(%rbp), %ebx
         addl    $1, %ebx
-	movl   $0, %eax
+        movl    $0, %eax
+        popq    %rbx
         popq    %rbp
         .cfi_def_cfa 7, 8
         ret

>From 7923ba790e92578bf04f267b8b096362019855d5 Mon Sep 17 00:00:00 2001
From: "Wu, Yingcong" <yingcong.wu at intel.com>
Date: Sun, 7 Apr 2024 18:29:13 -0700
Subject: [PATCH 2/2] fix overlap bug

---
 llvm/test/ExecutionEngine/JITLink/x86-64/ELF_vtune.s | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_vtune.s b/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_vtune.s
index b734457c1ad7f7..2b77658d867978 100644
--- a/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_vtune.s
+++ b/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_vtune.s
@@ -22,9 +22,9 @@ main:
         movq    %rsp, %rbp
         pushq   %rbx
         .cfi_def_cfa_register 6
-        movl    %edi, -8(%rbp)
-        movq    %rsi, -16(%rbp)
-        movl    -8(%rbp), %ebx
+        movl    %edi, -12(%rbp)
+        movq    %rsi, -20(%rbp)
+        movl    -12(%rbp), %ebx
         addl    $1, %ebx
         movl    $0, %eax
         popq    %rbx



More information about the llvm-commits mailing list