[PATCH] D50035: [SLC] Expand simplification of pow() for vector types

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 1 15:12:24 PDT 2018


spatel added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:1186
   // pow(1.0, x) -> 1.0
-  if (match(Base, m_SpecificFP(1.0)))
+  if (match(Base, m_FPOne()))
     return Base;
----------------
IIUC, this is NFC, so you could just commit that before the other changes


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:1263-1265
+  // pow(x, n) -> x * x * x * ...
+  const APFloat *ExpoF;
+  if (Pow->isFast() && match(Expo, m_APFloat(ExpoF))) {
----------------
Is there a test for this transform?


https://reviews.llvm.org/D50035





More information about the llvm-commits mailing list