[PATCH] D80744: DAGCombiner optimization for pow(x, 0.75) even in case massv function is asked

Qing Shan Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 20:57:25 PDT 2020


steven.zhang added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCLowerMASSVEntries.cpp:103
+  // Fast math flags is checked here.
+  if (!CI->hasNoSignedZeros() || !CI->hasNoInfs() || !CI->hasApproxFunc())
+    return false;
----------------
The flag nsz don't matter here. It is only used to handle the 0.25 case. But maybe, you can extend it to support both 0.75 and 0.25 as what we did in DAGCombine or remove the nsz check here.


================
Comment at: llvm/test/CodeGen/PowerPC/pow_massv_0.75exp.ll:48
+  %wide.load = load <4 x float>, <4 x float>* %0, align 4
+  %1 = call fast <4 x float> @__powf4_massv(<4 x float> %wide.load, <4 x float> <float 0x3FE851EB80000000, float 0x3FE851EB80000000, float 0x3FE851EB80000000, float 0x3FE851EB80000000>)
+  %2 = bitcast float* %next.gep to <4 x float>*
----------------
Don't add the flag fast as it is too general. But adding the ninf and afn and add another negative case that didn't have these to flags.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80744/new/

https://reviews.llvm.org/D80744





More information about the llvm-commits mailing list