[PATCH] D67248: [InstCombine] pow(x, +/- 0.0) -> 1.0

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 5 17:33:01 PDT 2019


arsenm added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:1566-1567
+  // pow(x, +/- 0.0) -> 1.0
+  if (match(Expo, m_SpecificFP(0.0)) ||
+      match(Expo, m_SpecificFP(-0.0)))
     return ConstantFP::get(Ty, 1.0);
----------------
arsenm wrote:
> You can use m_AnyZeroFP
Also gives free vector support


================
Comment at: llvm/test/Transforms/InstCombine/pow-0.ll:30
+}
+
+declare double @llvm.pow.f64(double, double)
----------------
Can you add some vectors?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67248





More information about the llvm-commits mailing list