[llvm-commits] [llvm] r46393 - in /llvm/trunk: lib/Transforms/Utils/InlineFunction.cpp test/CFrontend/2008-01-26-ReadOnlyByVal.c
Duncan Sands
baldrick at free.fr
Sat Jan 26 02:15:15 PST 2008
> > Create an explicit copy for byval parameters even
> > when inlining a readonly function.
>
> Are you sure this is correct? There is a difference between 'const',
> 'pure' and readnone/readonly. Further, isn't it always safe to elide
> the copy for readnone functions?
A readnone function could write to a byval parameter, using it as local
storage (which it is). If you don't make an explicit copy when inlining,
these become writes to the storage that the caller passed in. I'm pretty
sure this is correct.
D.
More information about the llvm-commits
mailing list