[PATCH] D58694: LLVM: Optimization Pass: Remove conflicting attribute, if any, before adding new read attribute to an argument

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 28 13:27:55 PDT 2019


jdoerfert added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/FunctionAttrs.cpp:684
+    A->removeAttr(Attribute::ReadNone);
+    --NumReadNoneArg;
+  }
----------------
Why do you decrement the statistics here?


================
Comment at: llvm/lib/Transforms/IPO/FunctionAttrs.cpp:685
+    --NumReadNoneArg;
+  }
+  A->addAttr(R);
----------------
There is no need to check if an attribute is present before removing it.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D58694





More information about the llvm-commits mailing list