[PATCH] D82820: [InstCombine] Fix mismatched attribute lists for combined calls

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 30 16:50:43 PDT 2020


eugenis added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:1459
+          .addAttributes(B.getContext(), AttributeList::FirstArgIndex + 0,
+                         Attrs.getAttributes(AttributeList::FirstArgIndex + 1));
   Module *Mod = Pow->getModule();
----------------
When transforming pow(exp(x), y) to exp(x *y), why is it the right behavior to copy the attributes from the "y" parameter, and drop the ones on "x" and on "exp(x)"? Why not union or intersection?

It feels like the safe default behavior should be to drop all attributes, and adds the ones that we know apply here, like "noundef".


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82820





More information about the llvm-commits mailing list