[PATCH] D95982: [CSSPGO] Unblock optimizations with pseudo probe instrumentation.
Wei Mi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 10 11:41:41 PST 2021
wmi accepted this revision.
wmi added a comment.
This revision is now accepted and ready to land.
LGTM.
================
Comment at: llvm/lib/Transforms/IPO/FunctionAttrs.cpp:152-157
+ // A pseudo probe call shouldn't change any function attribute since it
+ // doesn't translate to a real instruction. It comes with a memory access
+ // tag to prevent itself being removed by optimizations and not block
+ // other instructions being optimized.
+ if (isa<PseudoProbeInst>(I))
+ continue;
----------------
hoy wrote:
> wmi wrote:
> > Make it a little more general?
> >
> > if (auto *CB = dyn_cast<CallBase>(I))
> > if (CB->onlyAccessesInaccessibleMemory())
> > continue;
> I think we might want to be a bit conservative here, since in theory `onlyAccessesInaccessibleMemory` still accesses memory. This may lead to
> 1. Functions with `onlyAccessesInaccessibleMemory` calls may not be free to be removed.
> 2. Calls with `onlyAccessesInaccessibleMemory` may not be moved around across each other.
>
> Pseudo probe don't have such effects thus checking against pseudo probes here should have minimal impact. What do you think?
>
>
Right. It is better to be conservative here.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95982/new/
https://reviews.llvm.org/D95982
More information about the llvm-commits
mailing list