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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 31 16:07:33 PDT 2018


spatel 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:
> 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.



Repository:
  rL LLVM

https://reviews.llvm.org/D50113





More information about the llvm-commits mailing list