[PATCH] D44415: [PM][FunctionAttrs] add NoUnwind attribute inference to PostOrderFunctionAttrs pass

Fedor Sergeev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 19 04:33:23 PDT 2018


fedor.sergeev marked 11 inline comments as done.
fedor.sergeev added inline comments.


================
Comment at: lib/Transforms/IPO/FunctionAttrs.cpp:1053
+  struct InferenceDescriptor {
+    /// Only "exact" definitions can be used to infer this attribute.
+    bool RequiresExactDefinition;
----------------
jlebar wrote:
> Can we expand upon what we mean by an "exact" definition?
I'm not sure how can I do that w/o duplicating a huge comment for GlobalValue::isDefinitionExact.


================
Comment at: lib/Transforms/IPO/FunctionAttrs.cpp:1056
+
+    /// Returns true if this function does not have to be scanned.
+    std::function<bool(const Function &)> SkipFunction;
----------------
jlebar wrote:
> Should we say this function can be null (and if so, all functions need to be scanned)?
SkipFunc is not intended to be null. Comment added below to clarify the intended use.


================
Comment at: lib/Transforms/IPO/FunctionAttrs.cpp:1236
+	 ++NumNoUnwind;
+       }});
+
----------------
jlebar wrote:
> Please re-clang-format
Err... clang-format behaves badly on this :(
It formats two calls of registerAttrInference differently.
So I took one format as is and hand-edited another invocation correspondingly.
Will repeat the same before integration as well.


Repository:
  rL LLVM

https://reviews.llvm.org/D44415





More information about the llvm-commits mailing list