[PATCH] D147022: inline global alias

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 28 11:44:34 PDT 2023


arsenm added a comment.

I thought calls to aliases were generally folded to direct calls at some point, so is there just an ordering issue?



================
Comment at: llvm/include/llvm/IR/InstrTypes.h:1409
   /// invocation or the function signature does not match the call signature.
   Function *getCalledFunction() const {
+    Value *V = getCalledOperand();
----------------
tra wrote:
> Are we sure that there are no users of these `getCalledFunction` functions that would expect them to return nullptr when we deal with an alias?
> 
> Unless someone familiar with the code says that it's OK to treat aliases as functions here, I would try to keep effect of the change limited to the area where we're making a decision to inline the function or alias.
I do think getCalledFunction is a hazardous function where most users do the wrong thing. This will continue to miss constantexpr casts. Could also stripPointerCastsAndAliases. I'm not sure if we want to change this or not


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

https://reviews.llvm.org/D147022



More information about the llvm-commits mailing list