[PATCH] D63038: [SimplifyLibCalls] powf(x, sitofp(n)) -> powi(x, n)

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 15:48:30 PDT 2019


efriedma added inline comments.


================
Comment at: test/Transforms/InstCombine/pow_fp_int.ll:176
+; CHECK-LABEL: @pow_uitofp_const_base_no_fast(
+; CHECK-NEXT:    [[SUBFP:%.*]] = uitofp i32 [[X:%.*]] to float
+; CHECK-NEXT:    [[POWI:%.*]] = tail call float @llvm.pow.f32(float 7.000000e+00, float [[SUBFP]])
----------------
xbolva00 wrote:
> xbolva00 wrote:
> > efriedma wrote:
> > > I don't think this is right; consider, for example , `pow(.999999999,4000000000)`.
> > This is a negative test, nothing was changed here.
> Yeah, I should change variable naming in negative tests
Accidentally commented on the wrong test.


================
Comment at: test/Transforms/InstCombine/pow_fp_int.ll:90
+; CHECK-LABEL: @pow_uitofp_double_base_fast(
+; CHECK-NEXT:    [[TMP1:%.*]] = call fast double @llvm.powi.f64(double [[BASE:%.*]], i32 [[X:%.*]])
+; CHECK-NEXT:    ret double [[TMP1]]
----------------
Meant to write a comment on this.  Treating "uitofp" like this means you're converting `pow(.999999999,4000000000)` into `pow(.999999999,-294967296)`.


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

https://reviews.llvm.org/D63038





More information about the llvm-commits mailing list