[PATCH] D13308: Value profiling - remaining LLVM changes

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 12 17:34:36 PST 2015


This version looks good to me. Please make sure all tests are properly
updated and watch out for test breakages from buildbots.

David

On Wed, Nov 11, 2015 at 6:33 PM, David Li <davidxl at google.com> wrote:

> davidxl added inline comments.
>
> ================
> Comment at: lib/ProfileData/InstrProfReader.cpp:286
> @@ +285,3 @@
> +std::error_code RawInstrProfReader<IntPtrT>::readValueData(
> +    InstrProfRecord &Record) {
> +
> ----------------
> This function will become only a couple of lines long if ValueProfileData
> is used as the format for Raw format too. Something like:
>
>
> support::endian::Endianess SrcEndianness =
> getDataEndianess(shouldSwapBytes, getHostEndianNess());
> .. VDataOrError = ValueProfData::getValueProfData(Data->Values, End,
> SrcEndianness);
> if (std::error_code EC = VDataOrError.getError())
>         return EC;
> VDataOrErr.get()->deserializeTo(Record, ...);
>
>
>
> ================
> Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:331
> @@ +330,3 @@
> +                           ConstantExpr::getBitCast(Fn, Int8PtrTy) :
> +                           ConstantPointerNull::get(Int8PtrTy);
> +
> ----------------
> Move the whole expression into the .inc file for clarity. If it is too
> long, more this out of the function as an inline helper function and call
> the function in .inc file. The expression does not fit here (without
> context how it is used).
>
> inline Constant *getFuncAddr(..Fn) {
> }
>
> ================
> Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:335
> @@ +334,3 @@
> +  for (uint32_t Kind = IPVK_First; Kind <= IPVK_Last; ++Kind)
> +    Int16ArrayVals[Kind] = ConstantInt::get(Int16Ty,
> PD.NumValueSites[Kind]);
> +
> ----------------
> Wrap the above and ConstantArray::get(Int16ArrayTy, Int16ArrayVals)) into
> one helper function, and reference the function call in .inc file.
>
>
> http://reviews.llvm.org/D13308
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151112/b629bb4a/attachment.html>


More information about the llvm-commits mailing list