[PATCH] D72885: [WIP] Add Query API for llvm.assume holding attributes

Tyker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 25 00:03:34 PST 2020


Tyker marked an inline comment as done.
Tyker added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/KnowledgeRetention.cpp:251
+  return true;
+}
+
----------------
jdoerfert wrote:
> Tyker wrote:
> > jdoerfert wrote:
> > > What is the use case for `IsOn = nullptr`? If there is none, we should make it a reference so it's obvious. 
> > currently `IsOn = nullptr` is for attributes that where on the call of a function or the declaration of a function.
> > 
> > this case only occurs when ShouldPreserveAllAttributes is set.
> I would have expected the IsOn to be the called value or respectively function then. Is there a reason for one or the other?
i am staring to think the attribute on call and function is perhaps too small of a use case to be worth supporting. i haven't yet found any other use case than the cold attribute that said i haven't be looking for it. 

but the idea was that Users of that API wouldn't need to care or know what function was called here. but just that this function has X attribute. i think it loose its last bit of usefulness if users need to know ahead of time that there was a calls to function F before querying it.


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

https://reviews.llvm.org/D72885





More information about the llvm-commits mailing list