[PATCH] D50113: [SLC] Fix shrinking of pow()

Evandro Menezes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 2 09:10:56 PDT 2018


evandro added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/double-float-shrink-1.ll:363
+; CHECK-NEXT:    [[TMP1:%.*]] = fpext float [[POWF]] to double
+; CHECK-NEXT:    ret double [[TMP1]]
 ;
----------------
evandro wrote:
> spatel wrote:
> > evandro wrote:
> > > evandro wrote:
> > > > efriedma wrote:
> > > > > It looks like optimizeBinaryDoubleFP doesn't do all the same checks optimizeUnaryDoubleFP does?  optimizeUnaryDoubleFP intentionally chooses not to optimize operations where the result isn't truncated because the extra bits might actually be useful.
> > > > Arguably, this should not shrink.
> > > Besides here, `optimizeBinaryDoubleFP()` is also used for `f{min,max}()` and `copysign()`.  Neither of the latter functions need the extra bits in the result.
> > An argument in favor of shrinking: it may reduce the number of instructions as shown in this test.
> > 
> And the series in `powf()` is probably shorter and faster than in `pow()`.
On the other hand, this shrink is only performed when `-enable-double-float-shrink` is specified or with FMF, which implies the attribute `afn`.


https://reviews.llvm.org/D50113





More information about the llvm-commits mailing list