[llvm] 44856d9 - ARM: Add test which shows overriding shouldRewriteCopySrc does something

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon May 5 08:32:42 PDT 2025


Author: Matt Arsenault
Date: 2025-05-05T17:32:37+02:00
New Revision: 44856d957e3a878e1f15d5ab0009bff9c4d87e6d

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

LOG: ARM: Add test which shows overriding shouldRewriteCopySrc does something

Split out from #125219

Added: 
    llvm/test/CodeGen/ARM/shouldRewriteCopySrc.ll

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/ARM/shouldRewriteCopySrc.ll b/llvm/test/CodeGen/ARM/shouldRewriteCopySrc.ll
new file mode 100644
index 0000000000000..e653aaa316fed
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/shouldRewriteCopySrc.ll
@@ -0,0 +1,28 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc -mtriple=arm-none-eabihf -mcpu=cortex-a55 < %s | FileCheck %s
+
+; Test that the override of shouldRewriteCopySrc does something
+
+define float @shouldRewriteCopySrc(double %arg) #0 {
+; CHECK-LABEL: shouldRewriteCopySrc:
+; CHECK:       @ %bb.0: @ %bb
+; CHECK-NEXT:    .vsave {d8, d9, d10, d11, d12, d13, d14, d15}
+; CHECK-NEXT:    vpush {d8, d9, d10, d11, d12, d13, d14, d15}
+; CHECK-NEXT:    vadd.f64 d16, d0, d0
+; CHECK-NEXT:    @APP
+; CHECK-NEXT:    nop
+; CHECK-NEXT:    @NO_APP
+; CHECK-NEXT:    vmov r0, r1, d16
+; CHECK-NEXT:    vmov s0, r0
+; CHECK-NEXT:    vpop {d8, d9, d10, d11, d12, d13, d14, d15}
+; CHECK-NEXT:    bx lr
+bb:
+  %i = fadd double %arg, %arg
+  tail call void asm sideeffect "nop", "~{q0},~{q1},~{q2},~{q3},~{q4},~{q5},~{q6},~{q7}"() #0
+  %i1 = bitcast double %i to i64
+  %i2 = trunc i64 %i1 to i32
+  %i3 = bitcast i32 %i2 to float
+  ret float %i3
+}
+
+attributes #0 = { nounwind }


        


More information about the llvm-commits mailing list