[PATCH] D122963: [X86] Extend the integer parameter if the function isn't local linked
Kan Shengchen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 7 01:56:31 PDT 2022
skan added inline comments.
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:3955
DAG.getValueType(VA.getValVT()));
- else if (VA.getLocInfo() == CCValAssign::ZExt)
+ else if (VA.getLocInfo() == CCValAssign::ZExt && F.hasLocalLinkage())
ArgValue = DAG.getNode(ISD::AssertZext, dl, RegVT, ArgValue,
----------------
LiuChen3 wrote:
> skan wrote:
> > If you check `hasLocalLinkage` here, I believe we also need to check `hasAddressTaken`...
> >
> > However, I think such optimizations should be done in `llvm/lib/Transforms/IPO/*.cpp`. instead of here.
> Sorry that I am not familiar with `hasAddressTaken`. I have one question, does `hasAddressTaken` also means `hasLocalLinkage `?
`hasLocalLinkage` does not implies `!hasAddressTaken`. If a function’s address is taken, then it could be called indirectly by libraries. You can see an example in `llvm/lib/Transforms/IPO/GlobalOpt.cpp`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122963/new/
https://reviews.llvm.org/D122963
More information about the llvm-commits
mailing list