[PATCH] D137454: [InstCombine] Avoid passing pow attributes to sqrt

Miguel Saldivar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 6 10:56:10 PST 2022


Saldivarcher added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:2165
+      AttributeList Attrs;
+      Sqrt = getSqrtCall(Base, Attrs, Pow->doesNotAccessMemory(), M, B, TLI);
       if (!Sqrt)
----------------
spatel wrote:
> spatel wrote:
> > Do we need to name the default/empty AttributeList if this is the only use? 
> > Ie, can the code be shorter? 
> >       Sqrt = getSqrtCall(Base, AttributeList(), Pow->doesNotAccessMemory(), M, B, TLI);
> I tried to make the existing code around here easier to understand with:
> bff6880a5f89
Your changes LGTM, I like the `Attrs` -> `NoAttrs` change, really helps with readability. The `AttributeList()` change is alright as well. Should this change just include the test then? Or should I close it completely? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137454



More information about the llvm-commits mailing list