Skip to content
  • Herbert Valerio Riedel's avatar
    Add ptr-eq short-cut to `compareByteArrays#` primitive · 309d632c
    Herbert Valerio Riedel authored and Ben Gamari's avatar Ben Gamari committed
    This is an obvious optimisation whose overhead is neglectable but
    which significantly simplifies the common uses of `compareByteArrays#`
    which would otherwise require to make *careful* use of
    `reallyUnsafePtrEquality#` or (equally fragile) `byteArrayContents#`
    which can result in less optimal assembler code being generated.
    
    Test Plan: carefully examined generated cmm/asm code; validate via phab
    
    Reviewers: alexbiehl, bgamari, simonmar
    
    Reviewed By: bgamari, simonmar
    
    Subscribers: rwbarton, thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D4319
    
    (cherry picked from commit 31c260f3)
    309d632c