[PATCH] D29849: AMDGPU: Don't promote arcp to unsafe math flag
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 10 14:25:00 PST 2017
arsenm created this revision.
Herald added subscribers: tpr, tony-tye, yaxunl, nhaehnle, wdng, kzhuravl.
If only arcp was allowed, this was enabling unsafe math on the
resulting nodes. Preserve the original unsafe math flags.
https://reviews.llvm.org/D29849
Files:
lib/Target/AMDGPU/SIISelLowering.cpp
Index: lib/Target/AMDGPU/SIISelLowering.cpp
===================================================================
--- lib/Target/AMDGPU/SIISelLowering.cpp
+++ lib/Target/AMDGPU/SIISelLowering.cpp
@@ -3191,14 +3191,11 @@
}
const SDNodeFlags *Flags = Op->getFlags();
-
if (Unsafe || Flags->hasAllowReciprocal()) {
// Turn into multiply by the reciprocal.
// x / y -> x * (1.0 / y)
- SDNodeFlags Flags;
- Flags.setUnsafeAlgebra(true);
SDValue Recip = DAG.getNode(AMDGPUISD::RCP, SL, VT, RHS);
- return DAG.getNode(ISD::FMUL, SL, VT, LHS, Recip, &Flags);
+ return DAG.getNode(ISD::FMUL, SL, VT, LHS, Recip, Flags);
}
return SDValue();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29849.88053.patch
Type: text/x-patch
Size: 675 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170210/57cb29b6/attachment.bin>
More information about the llvm-commits
mailing list