[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 16:33:04 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:
> Saldivarcher wrote:
> > 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? 
> I left this case alone, so there wouldn't be a conflict. You can either name the variable "NoAttrs" or default construct it in the getSqrtCall(), and then we should be good. Do you have commit access?
Oops, I misread your commit, I thought you handled this case! But okay, I updated the code to use `AttributeList()`. No, I don't have commit access :( Can you commit this for me?


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