[PATCH] D102725: [SDAG] propagate FMF from target-specific IR intrinsics
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 19 04:52:41 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6025663578cd: [SDAG] propagate FMF from target-specific IR intrinsics (authored by spatel).
Changed prior to commit:
https://reviews.llvm.org/D102725?vs=346258&id=346407#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102725/new/
https://reviews.llvm.org/D102725
Files:
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/test/CodeGen/X86/fmf-propagation.ll
Index: llvm/test/CodeGen/X86/fmf-propagation.ll
===================================================================
--- llvm/test/CodeGen/X86/fmf-propagation.ll
+++ llvm/test/CodeGen/X86/fmf-propagation.ll
@@ -48,8 +48,8 @@
declare <16 x float> @llvm.x86.avx512.vfmadd.ps.512(<16 x float>, <16 x float>, <16 x float>, i32)
; CHECK-LABEL: Initial selection DAG: %bb.0 'fmf_target_intrinsic:'
-; CHECK: v16f32 = llvm.x86.avx512.vfmadd.ps.512 TargetConstant:i64<{{.*}}>
-; CHECK: v16f32 = llvm.x86.avx512.vfmadd.ps.512 TargetConstant:i64<{{.*}}>
+; CHECK: v16f32 = llvm.x86.avx512.vfmadd.ps.512 ninf nsz TargetConstant:i64<{{.*}}>
+; CHECK: v16f32 = llvm.x86.avx512.vfmadd.ps.512 nsz TargetConstant:i64<{{.*}}>
define <16 x float> @fmf_target_intrinsic(<16 x float> %a, <16 x float> %b, <16 x float> %c) nounwind {
%t0 = tail call ninf nsz <16 x float> @llvm.x86.avx512.vfmadd.ps.512(<16 x float> %a, <16 x float> %b, <16 x float> %c, i32 4)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -4803,6 +4803,12 @@
SDVTList VTs = DAG.getVTList(ValueVTs);
+ // Propagate fast-math-flags from IR to node(s).
+ SDNodeFlags Flags;
+ if (auto *FPMO = dyn_cast<FPMathOperator>(&I))
+ Flags.copyFMF(*FPMO);
+ SelectionDAG::FlagInserter FlagsInserter(DAG, Flags);
+
// Create the node.
SDValue Result;
if (IsTgtIntrinsic) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102725.346407.patch
Type: text/x-patch
Size: 1541 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210519/6ee2083b/attachment.bin>
More information about the llvm-commits
mailing list