[llvm] [LLVM] Slay undead copysign code (PR #111269)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 31 15:58:40 PDT 2024


================
@@ -1,9 +1,84 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
 ; RUN: llc -verify-machineinstrs < %s -mcpu=ppc | FileCheck %s
 
+; Previously we checked that loops that used CTR would not be used around a libm call to copysignl
+; but now that copysignl is no longer emitted by LLVM in most cases, this stands as a tombstone.
+
 target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32"
 target triple = "powerpc-unknown-linux-gnu"
 
 define ppc_fp128 @foo(ptr nocapture %n, ppc_fp128 %d) nounwind readonly {
+; CHECK-LABEL: foo:
+; CHECK:       # %bb.0: # %entry
+; CHECK-NEXT:    stwu 1, -112(1)
+; CHECK-NEXT:    stfd 2, 80(1)
+; CHECK-NEXT:    li 3, 2048
+; CHECK-NEXT:    lwz 4, 84(1)
+; CHECK-NEXT:    stfd 1, 88(1)
+; CHECK-NEXT:    stw 4, 100(1)
+; CHECK-NEXT:    lwz 4, 80(1)
+; CHECK-NEXT:    stw 4, 96(1)
+; CHECK-NEXT:    lwz 4, 92(1)
+; CHECK-NEXT:    lfd 1, 96(1)
+; CHECK-NEXT:    stw 4, 108(1)
+; CHECK-NEXT:    lwz 4, 88(1)
+; CHECK-NEXT:    stw 4, 104(1)
+; CHECK-NEXT:    lfd 0, 104(1)
+; CHECK-NEXT:    mtctr 3
----------------
workingjubilee wrote:

when I said "the test seems irrelevant", we now emit an MTCTR instruction here, but the copysignl call we were guarding against is nowhere to be found, sooo

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


More information about the llvm-commits mailing list