[PATCH] D104342: [IR] convert warn-stack-size from module attr to fn attr

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 15 17:48:49 PDT 2021


dblaikie added a comment.

what're the rules about module level attributes like this? For instance: Does this affect/hinder inlining (if the attributes don't match between the caller and callee)? Other situations that might matter?



================
Comment at: llvm/lib/CodeGen/PrologEpilogInserter.cpp:282
+        .getValueAsString()
+        .getAsInteger(0, Threshold);
   if (StackSize > Threshold) {
----------------
I guess the 0 value here is the default value if the value can't be parsed as an integer? Is that desirable? I guess maybe we should ignore it (use UINT_MAX here instead, maybe) and fail in the verifier.

But I guess if we fail in the verifier, then it doesn't really matter/shouldn't be tested what the behavior is here when presented with invalid IR.

(but this is a divergence from the module flag handling, which looks like it does silently ignore non-numeric values, by using UINT_MAX)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104342



More information about the cfe-commits mailing list