[llvm] [PowerPC] convert memmove to milicode call in 64-bit mode (PR #167334)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 10 07:53:27 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-powerpc

Author: zhijian lin (diggerlin)

<details>
<summary>Changes</summary>

 [TableGen: Allow defining sets of runtime libraries](https://github.com/llvm/llvm-project/pull/144978#top) break the conversion of bl memmove call to milicode bl .___memmove64[PR] in 64--bit mode, the patch fix the problem.
 
 we do not need to define the 

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


2 Files Affected:

- (modified) llvm/include/llvm/IR/RuntimeLibcalls.td (+1-1) 
- (modified) llvm/test/CodeGen/PowerPC/milicode64.ll (+1-1) 


``````````diff
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td
index 24c1b035d0dda..e3da058a3ce20 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -2333,7 +2333,7 @@ defset list<RuntimeLibcallImpl> PPCRuntimeLibcalls = {
 
 defset list<RuntimeLibcallImpl> PPC64AIXCallList = {
   def ___memcmp64 : RuntimeLibcallImpl<MEMCMP>;
-  def ___memmove64 : RuntimeLibcallImpl<MEMCPY>;
+  def ___memmove64 : RuntimeLibcallImpl<MEMMOVE>;
   def ___memset64 : RuntimeLibcallImpl<MEMSET>;
   def ___bzero64 : RuntimeLibcallImpl<BZERO>;
   def ___strlen64 : RuntimeLibcallImpl<STRLEN>;
diff --git a/llvm/test/CodeGen/PowerPC/milicode64.ll b/llvm/test/CodeGen/PowerPC/milicode64.ll
index f7814a424e0b9..2dbf4140a0fa4 100644
--- a/llvm/test/CodeGen/PowerPC/milicode64.ll
+++ b/llvm/test/CodeGen/PowerPC/milicode64.ll
@@ -156,7 +156,7 @@ define ptr @test_memmove(ptr noundef %destination, ptr noundef %source, i64 noun
 ; CHECK-AIX-64-P9-NEXT:    std r3, 128(r1)
 ; CHECK-AIX-64-P9-NEXT:    std r4, 120(r1)
 ; CHECK-AIX-64-P9-NEXT:    std r5, 112(r1)
-; CHECK-AIX-64-P9-NEXT:    bl .memmove[PR]
+; CHECK-AIX-64-P9-NEXT:    bl .___memmove64[PR]
 ; CHECK-AIX-64-P9-NEXT:    nop
 ; CHECK-AIX-64-P9-NEXT:    mr r3, r31
 ; CHECK-AIX-64-P9-NEXT:    ld r31, 136(r1) # 8-byte Folded Reload

``````````

</details>


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


More information about the llvm-commits mailing list