[llvm] r260197 - Refactor PGO function naming and MD5 hashing support out of ProfileData

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 9 05:33:10 PST 2016


On Tue, Feb 9, 2016 at 2:07 AM, Joerg Sonnenberger via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> On Tue, Feb 09, 2016 at 05:12:44AM -0000, Teresa Johnson via llvm-commits
> wrote:
> > @@ -65,6 +66,18 @@ private:
> >    const uint8_t *body(ArrayRef<uint8_t> Data);
> >  };
> >
> > +/// Helper to compute and return a 64-bit MD5 Hash of a given string.
> > +inline uint64_t MD5Hash(StringRef Str) {
> > +  MD5 Hash;
> > +  Hash.update(Str);
> > +  llvm::MD5::MD5Result Result;
> > +  Hash.final(Result);
> > +  // Return the least significant 8 bytes. Our MD5 implementation
> returns the
> > +  // result in little endian, so we may need to swap bytes.
> > +  using namespace llvm::support;
> > +  return endian::read<uint64_t, little, unaligned>(Result);
> > +}
> > +
> >  }
> >
> >  #endif
>
> If you want to comment on what MD5Hash is doing, at least make it
> something sane please. There is nothing like a 64-bit MD5 Hash, but
> something like "the 64 least significant bits of the MD5 hash".
>

Good point, fixed in r260221.

Thanks,
Teresa


>
> Joerg
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>



-- 
Teresa Johnson |  Software Engineer |  tejohnson at google.com |  408-460-2413
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160209/9a3ea1f7/attachment.html>


More information about the llvm-commits mailing list