[llvm] [PowerPC] Remove `NoNaNsFPMath` uses (PR #183449)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 26 04:48:57 PST 2026
https://github.com/paperchalice updated https://github.com/llvm/llvm-project/pull/183449
>From 0a8b3f81573131cdd4f8299e7dbbb2bed0ec3a6f Mon Sep 17 00:00:00 2001
From: PaperChalice <liujunchang97 at outlook.com>
Date: Thu, 26 Feb 2026 14:03:11 +0800
Subject: [PATCH] [PowerPC] Remove `NoNaNsFPMath` uses
---
llvm/lib/Target/PowerPC/PPC.td | 4 -
llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 4 +-
llvm/test/CodeGen/PowerPC/fmf-propagation.ll | 223 +------------------
3 files changed, 3 insertions(+), 228 deletions(-)
diff --git a/llvm/lib/Target/PowerPC/PPC.td b/llvm/lib/Target/PowerPC/PPC.td
index dc00aebe311f9..c0abbf6f50804 100644
--- a/llvm/lib/Target/PowerPC/PPC.td
+++ b/llvm/lib/Target/PowerPC/PPC.td
@@ -376,10 +376,6 @@ def HasSPE : Predicate<"Subtarget->hasSPE()">;
def HasICBT : Predicate<"Subtarget->hasICBT()">;
def HasPartwordAtomics : Predicate<"Subtarget->hasPartwordAtomics()">;
def HasQuadwordAtomics : Predicate<"Subtarget->hasQuadwordAtomics()">;
-def NoNaNsFPMath
- : Predicate<"Subtarget->getTargetMachine().Options.NoNaNsFPMath">;
-def NaNsFPMath
- : Predicate<"!Subtarget->getTargetMachine().Options.NoNaNsFPMath">;
def HasBPERMD : Predicate<"Subtarget->hasBPERMD()">;
def HasExtDiv : Predicate<"Subtarget->hasExtDiv()">;
def HasFPU : Predicate<"Subtarget->hasFPU()">;
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index 9a68d93cee3f2..84d26448a7f4f 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -8176,9 +8176,7 @@ SDValue PPCTargetLowering::LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const {
// general, fsel-based lowering of select is a finite-math-only optimization.
// For more information, see section F.3 of the 2.06 ISA specification.
// With ISA 3.0
- if (!Flags.hasNoInfs() ||
- (!DAG.getTarget().Options.NoNaNsFPMath && !Flags.hasNoNaNs()) ||
- ResVT == MVT::f128)
+ if (!Flags.hasNoInfs() || !Flags.hasNoNaNs() || ResVT == MVT::f128)
return Op;
// If the RHS of the comparison is a 0.0, we don't need to do the
diff --git a/llvm/test/CodeGen/PowerPC/fmf-propagation.ll b/llvm/test/CodeGen/PowerPC/fmf-propagation.ll
index 5ba9b1e28a45e..7a01e4b19f90f 100644
--- a/llvm/test/CodeGen/PowerPC/fmf-propagation.ll
+++ b/llvm/test/CodeGen/PowerPC/fmf-propagation.ll
@@ -1,13 +1,10 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; REQUIRES: asserts
-; RUN: llc < %s -mtriple=powerpc64le -debug-only=isel -o /dev/null 2>&1 | FileCheck %s --check-prefix=FMFDEBUG
-; RUN: llc < %s -mtriple=powerpc64le | FileCheck %s --check-prefix=FMF
-; RUN: llc < %s -mtriple=powerpc64le -debug-only=isel -o /dev/null 2>&1 -fp-contract=fast -enable-no-nans-fp-math | FileCheck %s --check-prefix=GLOBALDEBUG
-; RUN: llc < %s -mtriple=powerpc64le -fp-contract=fast -enable-no-nans-fp-math -enable-no-signed-zeros-fp-math | FileCheck %s --check-prefix=GLOBAL
+; RUN: llc < %s -mtriple=powerpc64le -debug-only=isel -o /dev/null 2>&1 | FileCheck %s --check-prefix=FMFDEBUG
+; RUN: llc < %s -mtriple=powerpc64le | FileCheck %s --check-prefix=FMF
; Test FP transforms using instruction/node-level fast-math-flags.
; We're also checking debug output to verify that FMF is propagated to the newly created nodes.
-; The run with the global unsafe param tests the pre-FMF behavior using regular instructions/nodes.
declare float @llvm.fma.f32(float, float, float)
declare float @llvm.sqrt.f32(float)
@@ -26,12 +23,6 @@ define float @fmul_fadd_contract1(float %x, float %y, float %z) {
; FMF-NEXT: xsmulsp 0, 1, 2
; FMF-NEXT: xsaddsp 1, 0, 3
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: fmul_fadd_contract1:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: xsmaddasp 3, 1, 2
-; GLOBAL-NEXT: fmr 1, 3
-; GLOBAL-NEXT: blr
%mul = fmul float %x, %y
%add = fadd contract float %mul, %z
ret float %add
@@ -49,12 +40,6 @@ define float @fmul_fadd_contract2(float %x, float %y, float %z) {
; FMF-NEXT: xsmulsp 0, 1, 2
; FMF-NEXT: xsaddsp 1, 0, 3
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: fmul_fadd_contract2:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: xsmaddasp 3, 1, 2
-; GLOBAL-NEXT: fmr 1, 3
-; GLOBAL-NEXT: blr
%mul = fmul contract float %x, %y
%add = fadd float %mul, %z
ret float %add
@@ -70,12 +55,6 @@ define float @fmul_fadd_contract3(float %x, float %y, float %z) {
; FMF-NEXT: xsmaddasp 3, 1, 2
; FMF-NEXT: fmr 1, 3
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: fmul_fadd_contract3:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: xsmaddasp 3, 1, 2
-; GLOBAL-NEXT: fmr 1, 3
-; GLOBAL-NEXT: blr
%mul = fmul contract float %x, %y
%add = fadd contract float %mul, %z
ret float %add
@@ -93,12 +72,6 @@ define float @fmul_fadd_reassoc1(float %x, float %y, float %z) {
; FMF-NEXT: xsmulsp 0, 1, 2
; FMF-NEXT: xsaddsp 1, 0, 3
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: fmul_fadd_reassoc1:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: xsmaddasp 3, 1, 2
-; GLOBAL-NEXT: fmr 1, 3
-; GLOBAL-NEXT: blr
%mul = fmul float %x, %y
%add = fadd reassoc float %mul, %z
ret float %add
@@ -115,12 +88,6 @@ define float @fmul_fadd_reassoc2(float %x, float %y, float %z) {
; FMF-NEXT: xsmulsp 0, 1, 2
; FMF-NEXT: xsaddsp 1, 0, 3
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: fmul_fadd_reassoc2:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: xsmaddasp 3, 1, 2
-; GLOBAL-NEXT: fmr 1, 3
-; GLOBAL-NEXT: blr
%mul = fmul reassoc float %x, %y
%add = fadd reassoc float %mul, %z
ret float %add
@@ -138,12 +105,6 @@ define float @fmul_fadd_fast1(float %x, float %y, float %z) {
; FMF-NEXT: xsmulsp 0, 1, 2
; FMF-NEXT: xsaddsp 1, 0, 3
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: fmul_fadd_fast1:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: xsmaddasp 3, 1, 2
-; GLOBAL-NEXT: fmr 1, 3
-; GLOBAL-NEXT: blr
%mul = fmul float %x, %y
%add = fadd fast float %mul, %z
ret float %add
@@ -161,12 +122,6 @@ define float @fmul_fadd_fast2(float %x, float %y, float %z) {
; FMF-NEXT: xsmaddasp 3, 1, 2
; FMF-NEXT: fmr 1, 3
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: fmul_fadd_fast2:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: xsmaddasp 3, 1, 2
-; GLOBAL-NEXT: fmr 1, 3
-; GLOBAL-NEXT: blr
%mul = fmul fast float %x, %y
%add = fadd fast float %mul, %z
ret float %add
@@ -179,9 +134,6 @@ define float @fmul_fadd_fast2(float %x, float %y, float %z) {
; FMFDEBUG: fmul reassoc {{t[0-9]+}},
; FMFDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fma_reassoc1:'
-; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'fmul_fma_reassoc1:'
-; GLOBALDEBUG: fmul reassoc {{t[0-9]+}}
-; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fma_reassoc1:'
define float @fmul_fma_reassoc1(float %x) {
; FMF-LABEL: fmul_fma_reassoc1:
@@ -190,13 +142,6 @@ define float @fmul_fma_reassoc1(float %x) {
; FMF-NEXT: lfs 0, .LCPI7_0 at toc@l(3)
; FMF-NEXT: xsmulsp 1, 1, 0
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: fmul_fma_reassoc1:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: addis 3, 2, .LCPI7_0 at toc@ha
-; GLOBAL-NEXT: lfs 0, .LCPI7_0 at toc@l(3)
-; GLOBAL-NEXT: xsmulsp 1, 1, 0
-; GLOBAL-NEXT: blr
%mul = fmul float %x, 42.0
%fma = call reassoc float @llvm.fma.f32(float %x, float 7.0, float %mul)
ret float %fma
@@ -208,9 +153,6 @@ define float @fmul_fma_reassoc1(float %x) {
; FMFDEBUG: fmul reassoc {{t[0-9]+}}
; FMFDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fma_reassoc2:'
-; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'fmul_fma_reassoc2:'
-; GLOBALDEBUG: fmul reassoc {{t[0-9]+}}
-; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fma_reassoc2:'
define float @fmul_fma_reassoc2(float %x) {
; FMF-LABEL: fmul_fma_reassoc2:
@@ -219,13 +161,6 @@ define float @fmul_fma_reassoc2(float %x) {
; FMF-NEXT: lfs 0, .LCPI8_0 at toc@l(3)
; FMF-NEXT: xsmulsp 1, 1, 0
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: fmul_fma_reassoc2:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: addis 3, 2, .LCPI8_0 at toc@ha
-; GLOBAL-NEXT: lfs 0, .LCPI8_0 at toc@l(3)
-; GLOBAL-NEXT: xsmulsp 1, 1, 0
-; GLOBAL-NEXT: blr
%mul = fmul reassoc float %x, 42.0
%fma = call reassoc float @llvm.fma.f32(float %x, float 7.0, float %mul)
ret float %fma
@@ -237,9 +172,6 @@ define float @fmul_fma_reassoc2(float %x) {
; FMFDEBUG: fmul nnan ninf nsz arcp contract afn reassoc {{t[0-9]+}}
; FMFDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fma_fast1:'
-; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'fmul_fma_fast1:'
-; GLOBALDEBUG: fmul nnan ninf nsz arcp contract afn reassoc {{t[0-9]+}}
-; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fma_fast1:'
define float @fmul_fma_fast1(float %x) {
; FMF-LABEL: fmul_fma_fast1:
@@ -248,13 +180,6 @@ define float @fmul_fma_fast1(float %x) {
; FMF-NEXT: lfs 0, .LCPI9_0 at toc@l(3)
; FMF-NEXT: xsmulsp 1, 1, 0
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: fmul_fma_fast1:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: addis 3, 2, .LCPI9_0 at toc@ha
-; GLOBAL-NEXT: lfs 0, .LCPI9_0 at toc@l(3)
-; GLOBAL-NEXT: xsmulsp 1, 1, 0
-; GLOBAL-NEXT: blr
%mul = fmul float %x, 42.0
%fma = call fast float @llvm.fma.f32(float %x, float 7.0, float %mul)
ret float %fma
@@ -266,9 +191,6 @@ define float @fmul_fma_fast1(float %x) {
; FMFDEBUG: fmul nnan ninf nsz arcp contract afn reassoc {{t[0-9]+}}
; FMFDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fma_fast2:'
-; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'fmul_fma_fast2:'
-; GLOBALDEBUG: fmul nnan ninf nsz arcp contract afn reassoc {{t[0-9]+}}
-; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fma_fast2:'
define float @fmul_fma_fast2(float %x) {
; FMF-LABEL: fmul_fma_fast2:
@@ -277,13 +199,6 @@ define float @fmul_fma_fast2(float %x) {
; FMF-NEXT: lfs 0, .LCPI10_0 at toc@l(3)
; FMF-NEXT: xsmulsp 1, 1, 0
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: fmul_fma_fast2:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: addis 3, 2, .LCPI10_0 at toc@ha
-; GLOBAL-NEXT: lfs 0, .LCPI10_0 at toc@l(3)
-; GLOBAL-NEXT: xsmulsp 1, 1, 0
-; GLOBAL-NEXT: blr
%mul = fmul fast float %x, 42.0
%fma = call fast float @llvm.fma.f32(float %x, float 7.0, float %mul)
ret float %fma
@@ -295,9 +210,6 @@ define float @fmul_fma_fast2(float %x) {
; FMFDEBUG: fmul ninf afn {{t[0-9]+}}
; FMFDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_afn_ieee:'
-; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'sqrt_afn_ieee:'
-; GLOBALDEBUG: fmul ninf afn {{t[0-9]+}}
-; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_afn_ieee:'
define float @sqrt_afn_ieee(float %x) #0 {
; FMF-LABEL: sqrt_afn_ieee:
@@ -322,25 +234,6 @@ define float @sqrt_afn_ieee(float %x) #0 {
; FMF-NEXT: .LBB11_2:
; FMF-NEXT: fmr 1, 0
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: sqrt_afn_ieee:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: xsrsqrtesp 0, 1
-; GLOBAL-NEXT: vspltisw 2, -3
-; GLOBAL-NEXT: addis 3, 2, .LCPI11_0 at toc@ha
-; GLOBAL-NEXT: xvcvsxwdp 3, 34
-; GLOBAL-NEXT: xsmulsp 2, 1, 0
-; GLOBAL-NEXT: xsabsdp 1, 1
-; GLOBAL-NEXT: xsmaddasp 3, 2, 0
-; GLOBAL-NEXT: lfs 0, .LCPI11_0 at toc@l(3)
-; GLOBAL-NEXT: addis 3, 2, .LCPI11_1 at toc@ha
-; GLOBAL-NEXT: xsmulsp 0, 2, 0
-; GLOBAL-NEXT: lfs 2, .LCPI11_1 at toc@l(3)
-; GLOBAL-NEXT: xssubsp 1, 1, 2
-; GLOBAL-NEXT: xxlxor 2, 2, 2
-; GLOBAL-NEXT: xsmulsp 0, 0, 3
-; GLOBAL-NEXT: fsel 1, 1, 0, 2
-; GLOBAL-NEXT: blr
%rt = call afn ninf float @llvm.sqrt.f32(float %x)
ret float %rt
}
@@ -350,11 +243,6 @@ define float @sqrt_afn_ieee_inf(float %x) #0 {
; FMF: # %bb.0:
; FMF-NEXT: xssqrtsp 1, 1
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: sqrt_afn_ieee_inf:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: xssqrtsp 1, 1
-; GLOBAL-NEXT: blr
%rt = call afn float @llvm.sqrt.f32(float %x)
ret float %rt
}
@@ -363,9 +251,6 @@ define float @sqrt_afn_ieee_inf(float %x) #0 {
; FMFDEBUG: fmul ninf afn {{t[0-9]+}}
; FMFDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_afn_preserve_sign:'
-; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'sqrt_afn_preserve_sign:'
-; GLOBALDEBUG: fmul ninf afn {{t[0-9]+}}
-; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_afn_preserve_sign:'
define float @sqrt_afn_preserve_sign(float %x) #1 {
; FMF-LABEL: sqrt_afn_preserve_sign:
@@ -387,23 +272,6 @@ define float @sqrt_afn_preserve_sign(float %x) #1 {
; FMF-NEXT: .LBB13_2:
; FMF-NEXT: fmr 1, 0
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: sqrt_afn_preserve_sign:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: xsrsqrtesp 0, 1
-; GLOBAL-NEXT: vspltisw 2, -3
-; GLOBAL-NEXT: addis 3, 2, .LCPI13_0 at toc@ha
-; GLOBAL-NEXT: xvcvsxwdp 3, 34
-; GLOBAL-NEXT: xsmulsp 2, 1, 0
-; GLOBAL-NEXT: xsmaddasp 3, 2, 0
-; GLOBAL-NEXT: lfs 0, .LCPI13_0 at toc@l(3)
-; GLOBAL-NEXT: xsmulsp 0, 2, 0
-; GLOBAL-NEXT: xxlxor 2, 2, 2
-; GLOBAL-NEXT: xsmulsp 0, 0, 3
-; GLOBAL-NEXT: fsel 2, 1, 2, 0
-; GLOBAL-NEXT: xsnegdp 1, 1
-; GLOBAL-NEXT: fsel 1, 1, 2, 0
-; GLOBAL-NEXT: blr
%rt = call afn ninf float @llvm.sqrt.f32(float %x)
ret float %rt
}
@@ -413,11 +281,6 @@ define float @sqrt_afn_preserve_sign_inf(float %x) #1 {
; FMF: # %bb.0:
; FMF-NEXT: xssqrtsp 1, 1
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: sqrt_afn_preserve_sign_inf:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: xssqrtsp 1, 1
-; GLOBAL-NEXT: blr
%rt = call afn float @llvm.sqrt.f32(float %x)
ret float %rt
}
@@ -428,9 +291,6 @@ define float @sqrt_afn_preserve_sign_inf(float %x) #1 {
; FMFDEBUG: fmul ninf contract afn reassoc {{t[0-9]+}}
; FMFDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_fast_ieee:'
-; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'sqrt_fast_ieee:'
-; GLOBALDEBUG: fmul ninf contract afn reassoc {{t[0-9]+}}
-; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_fast_ieee:'
define float @sqrt_fast_ieee(float %x) #0 {
; FMF-LABEL: sqrt_fast_ieee:
@@ -454,25 +314,6 @@ define float @sqrt_fast_ieee(float %x) #0 {
; FMF-NEXT: .LBB15_2:
; FMF-NEXT: fmr 1, 0
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: sqrt_fast_ieee:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: xsrsqrtesp 0, 1
-; GLOBAL-NEXT: vspltisw 2, -3
-; GLOBAL-NEXT: addis 3, 2, .LCPI15_0 at toc@ha
-; GLOBAL-NEXT: xvcvsxwdp 3, 34
-; GLOBAL-NEXT: xsmulsp 2, 1, 0
-; GLOBAL-NEXT: xsabsdp 1, 1
-; GLOBAL-NEXT: xsmaddasp 3, 2, 0
-; GLOBAL-NEXT: lfs 0, .LCPI15_0 at toc@l(3)
-; GLOBAL-NEXT: addis 3, 2, .LCPI15_1 at toc@ha
-; GLOBAL-NEXT: xsmulsp 0, 2, 0
-; GLOBAL-NEXT: lfs 2, .LCPI15_1 at toc@l(3)
-; GLOBAL-NEXT: xssubsp 1, 1, 2
-; GLOBAL-NEXT: xxlxor 2, 2, 2
-; GLOBAL-NEXT: xsmulsp 0, 0, 3
-; GLOBAL-NEXT: fsel 1, 1, 0, 2
-; GLOBAL-NEXT: blr
%rt = call contract reassoc afn ninf float @llvm.sqrt.f32(float %x)
ret float %rt
}
@@ -483,9 +324,6 @@ define float @sqrt_fast_ieee(float %x) #0 {
; FMFDEBUG: fmul ninf contract afn reassoc {{t[0-9]+}}
; FMFDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_fast_preserve_sign:'
-; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'sqrt_fast_preserve_sign:'
-; GLOBALDEBUG: fmul ninf contract afn reassoc {{t[0-9]+}}
-; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_fast_preserve_sign:'
define float @sqrt_fast_preserve_sign(float %x) #1 {
; FMF-LABEL: sqrt_fast_preserve_sign:
@@ -506,23 +344,6 @@ define float @sqrt_fast_preserve_sign(float %x) #1 {
; FMF-NEXT: .LBB16_2:
; FMF-NEXT: fmr 1, 0
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: sqrt_fast_preserve_sign:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: xsrsqrtesp 0, 1
-; GLOBAL-NEXT: vspltisw 2, -3
-; GLOBAL-NEXT: addis 3, 2, .LCPI16_0 at toc@ha
-; GLOBAL-NEXT: xvcvsxwdp 3, 34
-; GLOBAL-NEXT: xsmulsp 2, 1, 0
-; GLOBAL-NEXT: xsmaddasp 3, 2, 0
-; GLOBAL-NEXT: lfs 0, .LCPI16_0 at toc@l(3)
-; GLOBAL-NEXT: xsmulsp 0, 2, 0
-; GLOBAL-NEXT: xxlxor 2, 2, 2
-; GLOBAL-NEXT: xsmulsp 0, 0, 3
-; GLOBAL-NEXT: fsel 2, 1, 2, 0
-; GLOBAL-NEXT: xsnegdp 1, 1
-; GLOBAL-NEXT: fsel 1, 1, 2, 0
-; GLOBAL-NEXT: blr
%rt = call contract reassoc ninf afn float @llvm.sqrt.f32(float %x)
ret float %rt
}
@@ -533,9 +354,6 @@ define float @sqrt_fast_preserve_sign(float %x) #1 {
; FMFDEBUG: select_cc nnan {{t[0-9]+}}
; FMFDEBUG: Type-legalized selection DAG: %bb.0 'fcmp_nnan:'
-; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'fcmp_nnan:'
-; GLOBALDEBUG: select_cc nnan {{t[0-9]+}}
-; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'fcmp_nnan:'
define double @fcmp_nnan(double %a, double %y, double %z) {
; FMF-LABEL: fcmp_nnan:
@@ -548,17 +366,6 @@ define double @fcmp_nnan(double %a, double %y, double %z) {
; FMF-NEXT: .LBB17_2:
; FMF-NEXT: fmr 1, 3
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: fcmp_nnan:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: xxlxor 0, 0, 0
-; GLOBAL-NEXT: xscmpudp 0, 1, 0
-; GLOBAL-NEXT: blt 0, .LBB17_2
-; GLOBAL-NEXT: # %bb.1:
-; GLOBAL-NEXT: fmr 3, 2
-; GLOBAL-NEXT: .LBB17_2:
-; GLOBAL-NEXT: fmr 1, 3
-; GLOBAL-NEXT: blr
%cmp = fcmp nnan ult double %a, 0.0
%z.y = select i1 %cmp, double %z, double %y
ret double %z.y
@@ -572,11 +379,6 @@ define double @fcmp_nnan(double %a, double %y, double %z) {
; FMFDEBUG: f64,ch,glue = CopyFromReg [[T16:t[0-9]+]], Register:f64 $f1, [[T16]]:1
; FMFDEBUG: Type-legalized selection DAG: %bb.0 'log2_approx:'
-; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'log2_approx:'
-; GLOBALDEBUG: ch,glue = PPCISD::CALL_NOP {{t[0-9]+}}, TargetGlobalAddress:i64<ptr @log2>
-; GLOBALDEBUG: ch,glue = callseq_end [[T15:t[0-9]+]], TargetConstant:i64<32>, TargetConstant:i64<0>, [[T15]]:1
-; GLOBALDEBUG: f64,ch,glue = CopyFromReg [[T16:t[0-9]+]], Register:f64 $f1, [[T16]]:1
-; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'log2_approx:'
declare double @log2(double)
define double @log2_approx(double %x) nounwind {
@@ -591,18 +393,6 @@ define double @log2_approx(double %x) nounwind {
; FMF-NEXT: ld 0, 16(1)
; FMF-NEXT: mtlr 0
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: log2_approx:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: mflr 0
-; GLOBAL-NEXT: stdu 1, -32(1)
-; GLOBAL-NEXT: std 0, 48(1)
-; GLOBAL-NEXT: bl log2
-; GLOBAL-NEXT: nop
-; GLOBAL-NEXT: addi 1, 1, 32
-; GLOBAL-NEXT: ld 0, 16(1)
-; GLOBAL-NEXT: mtlr 0
-; GLOBAL-NEXT: blr
%r = call afn double @log2(double %x)
ret double %r
}
@@ -613,20 +403,12 @@ define double @log2_approx(double %x) nounwind {
; FMFDEBUG: fsub nsz {{t[0-9]+}}, {{t[0-9]+}}
; FMFDEBUG: Type-legalized selection DAG: %bb.0 'fneg_fsub_nozeros_1:'
-; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'fneg_fsub_nozeros_1:'
-; GLOBALDEBUG: fsub nsz {{t[0-9]+}}, {{t[0-9]+}}
-; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'fneg_fsub_nozeros_1:'
define float @fneg_fsub_nozeros_1(float %x, float %y, float %z) {
; FMF-LABEL: fneg_fsub_nozeros_1:
; FMF: # %bb.0:
; FMF-NEXT: xssubsp 1, 2, 1
; FMF-NEXT: blr
-;
-; GLOBAL-LABEL: fneg_fsub_nozeros_1:
-; GLOBAL: # %bb.0:
-; GLOBAL-NEXT: xssubsp 1, 2, 1
-; GLOBAL-NEXT: blr
%neg = fsub float %x, %y
%add = fsub nsz float 0.0, %neg
ret float %add
@@ -636,4 +418,3 @@ attributes #0 = { denormal_fpenv(ieee|ieee) }
attributes #1 = { denormal_fpenv(preservesign) }
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; FMFDEBUG: {{.*}}
-; GLOBALDEBUG: {{.*}}
More information about the llvm-commits
mailing list