[llvm] f81ccb5 - [ExecutionEngine] Re-enable JIT tests on PowerPC.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Sun May 21 16:12:45 PDT 2023


Author: Lang Hames
Date: 2023-05-21T16:12:06-07:00
New Revision: f81ccb520927247b02708873567428d6988e2a07

URL: https://github.com/llvm/llvm-project/commit/f81ccb520927247b02708873567428d6988e2a07
DIFF: https://github.com/llvm/llvm-project/commit/f81ccb520927247b02708873567428d6988e2a07.diff

LOG: [ExecutionEngine] Re-enable JIT tests on PowerPC.

These were previously re-enabled in d771f54107c, but had to be disabled again
in 2060a72b4d7 due to test failures.

This is a next step to landing https://reviews.llvm.org/D148192, which adds
a skeleton JITLink backend for PowerPC.

The fixes for those failures were (1) to explicitly specify IsLittleEndian =
true for the MachO YAML testcases, (2) disable some example tests for examples
that aren't supported on PowerPC yet, and (3) fixing the endianness of a
relocation read/write (for ELF R_AARCH64_TSTBR14) in RuntimeDyldELF.

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
    llvm/test/Examples/OrcV2Examples/lljit-with-remote-debugging.test
    llvm/test/Examples/OrcV2Examples/lljit-with-thinlto-summaries.test
    llvm/test/Examples/OrcV2Examples/orcv2-cbindings-lazy.test
    llvm/test/ExecutionEngine/JITLink/x86-64/MachO-duplicate-local.test
    llvm/test/ExecutionEngine/JITLink/x86-64/MachO_ehframe_bad_fde_cie-ptr_out-of-range.test
    llvm/test/ExecutionEngine/JITLink/x86-64/MachO_ehframe_bad_fde_pc-begin_out-of-range.test
    llvm/test/ExecutionEngine/lit.local.cfg

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
index 762f51f541885..d439b1b4ebfbf 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
@@ -479,7 +479,9 @@ void RuntimeDyldELF::resolveAArch64Relocation(const SectionEntry &Section,
 
     assert(isInt<16>(BranchImm));
 
-    *TargetPtr &= 0xfff8001fU;
+    uint32_t RawInstr = *(support::little32_t *)TargetPtr;
+    *(support::little32_t *)TargetPtr = RawInstr & 0xfff8001fU;
+
     // Immediate:15:2 goes in bits 18:5 of TBZ, TBNZ
     or32le(TargetPtr, (BranchImm & 0x0000FFFC) << 3);
     break;

diff  --git a/llvm/test/Examples/OrcV2Examples/lljit-with-remote-debugging.test b/llvm/test/Examples/OrcV2Examples/lljit-with-remote-debugging.test
index d34208136c3e2..b0b33503a1eec 100644
--- a/llvm/test/Examples/OrcV2Examples/lljit-with-remote-debugging.test
+++ b/llvm/test/Examples/OrcV2Examples/lljit-with-remote-debugging.test
@@ -2,6 +2,7 @@
 # Instructions for debugging can be found in LLJITWithRemoteDebugging.cpp
 
 # REQUIRES: default_triple
+# UNSUPPORTED: target=powerpc64{{.*}}
 
 # RUN: LLJITWithRemoteDebugging %p/Inputs/argc_sub1_elf.ll | FileCheck --check-prefix=CHECK0 %s
 # CHECK0: Parsing input IR code from: {{.*}}/Inputs/argc_sub1_elf.ll

diff  --git a/llvm/test/Examples/OrcV2Examples/lljit-with-thinlto-summaries.test b/llvm/test/Examples/OrcV2Examples/lljit-with-thinlto-summaries.test
index ec4c8dd421430..b97f8ab06db73 100644
--- a/llvm/test/Examples/OrcV2Examples/lljit-with-thinlto-summaries.test
+++ b/llvm/test/Examples/OrcV2Examples/lljit-with-thinlto-summaries.test
@@ -3,6 +3,7 @@
 # RUN: opt -module-summary %p/Inputs/bar-mod.ll -o %T/bar-mod.bc
 
 # REQUIRES: default_triple
+# UNSUPPORTED: target=powerpc64{{.*}}
 
 # RUN: llvm-lto -thinlto -o %T/main-foo-bar %T/main-mod.bc %T/foo-mod.bc %T/bar-mod.bc
 

diff  --git a/llvm/test/Examples/OrcV2Examples/orcv2-cbindings-lazy.test b/llvm/test/Examples/OrcV2Examples/orcv2-cbindings-lazy.test
index b8e8f53361ea9..e34551c0c2c00 100644
--- a/llvm/test/Examples/OrcV2Examples/orcv2-cbindings-lazy.test
+++ b/llvm/test/Examples/OrcV2Examples/orcv2-cbindings-lazy.test
@@ -1,5 +1,7 @@
 # RUN: OrcV2CBindingsLazy 2>&1 | FileCheck -check-prefix=THIS %s
 # RUN: OrcV2CBindingsLazy 0 2>&1 | FileCheck -check-prefix=OTHER %s
 
+# UNSUPPORTED: target=powerpc64{{.*}}
+
 # THIS: entry(1) = 1
 # OTHER: entry(2) = 2

diff  --git a/llvm/test/ExecutionEngine/JITLink/x86-64/MachO-duplicate-local.test b/llvm/test/ExecutionEngine/JITLink/x86-64/MachO-duplicate-local.test
index c82e852a80dc0..5860f1b23d506 100644
--- a/llvm/test/ExecutionEngine/JITLink/x86-64/MachO-duplicate-local.test
+++ b/llvm/test/ExecutionEngine/JITLink/x86-64/MachO-duplicate-local.test
@@ -12,6 +12,7 @@
 # CHECK-NEXT:   target = _foo
 
 --- !mach-o
+IsLittleEndian:    true
 FileHeader:
   magic:           0xFEEDFACF
   cputype:         0x1000007

diff  --git a/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_ehframe_bad_fde_cie-ptr_out-of-range.test b/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_ehframe_bad_fde_cie-ptr_out-of-range.test
index 1bd01e127f540..21dc093c4e049 100644
--- a/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_ehframe_bad_fde_cie-ptr_out-of-range.test
+++ b/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_ehframe_bad_fde_cie-ptr_out-of-range.test
@@ -6,6 +6,7 @@
 # CHECK: llvm-jitlink error: No CIE found at address
 
 --- !mach-o
+IsLittleEndian:    true
 FileHeader:
   magic:           0xFEEDFACF
   cputype:         0x1000007

diff  --git a/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_ehframe_bad_fde_pc-begin_out-of-range.test b/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_ehframe_bad_fde_pc-begin_out-of-range.test
index 0a845c9d296cf..8c082e61cb72e 100644
--- a/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_ehframe_bad_fde_pc-begin_out-of-range.test
+++ b/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_ehframe_bad_fde_pc-begin_out-of-range.test
@@ -6,6 +6,7 @@
 # CHECK: llvm-jitlink error: No symbol or block covering address
 
 --- !mach-o
+IsLittleEndian:    true
 FileHeader:
   magic:           0xFEEDFACF
   cputype:         0x1000007

diff  --git a/llvm/test/ExecutionEngine/lit.local.cfg b/llvm/test/ExecutionEngine/lit.local.cfg
index 59f7cdb62deae..c748de14c8409 100644
--- a/llvm/test/ExecutionEngine/lit.local.cfg
+++ b/llvm/test/ExecutionEngine/lit.local.cfg
@@ -1,4 +1,4 @@
-if config.root.native_target in ["Sparc", "PowerPC", "SystemZ", "Hexagon", "RISCV"]:
+if config.root.native_target in ['Sparc', 'SystemZ', 'Hexagon', 'RISCV']:
     config.unsupported = True
 
 # ExecutionEngine tests are not expected to pass in a cross-compilation setup.


        


More information about the llvm-commits mailing list