[PATCH] D109033: [InlineCost] Introduce attributes to override InlineCost for inliner testing

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 1 12:29:29 PDT 2021


aeubanks added a comment.

this is a very nice feature :)



================
Comment at: llvm/include/llvm/IR/InstrTypes.h:2282
 
+  template <typename AttrKind> Attribute getFnAttrImpl(AttrKind Kind) const {
+    Attribute CallAttr = Attrs.getFnAttr(Kind);
----------------
I'd rather not change the semantics of `getFnAttr`, can this be in InlineCost instead?


================
Comment at: llvm/lib/Analysis/InlineCost.cpp:138
 
+template <typename IntTy> Optional<IntTy> stringAttrAsInt(Attribute Attr) {
+  static_assert(std::is_integral<IntTy>::value, "Expected integer type!");
----------------
making this a template seems unnecessary, just use `int`? that's what all the callers are using anyway


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

https://reviews.llvm.org/D109033



More information about the llvm-commits mailing list