[all-commits] [llvm/llvm-project] c4b757: Revert BCmp Loop Idiom recognition transform (PR43...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Sat Nov 2 02:48:41 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c4b757be026150eee32050e120026b03d92eb421
      https://github.com/llvm/llvm-project/commit/c4b757be026150eee32050e120026b03d92eb421
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2019-11-02 (Sat, 02 Nov 2019)

  Changed paths:
    M llvm/docs/ReleaseNotes.rst
    M llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
    R llvm/test/Transforms/LoopIdiom/bcmp-basic.ll
    R llvm/test/Transforms/LoopIdiom/bcmp-debugify-remarks.ll
    R llvm/test/Transforms/LoopIdiom/bcmp-negative-tests.ll
    R llvm/test/Transforms/LoopIdiom/bcmp-widening.ll

  Log Message:
  -----------
  Revert BCmp Loop Idiom recognition transform (PR43870)

As discussed in https://bugs.llvm.org/show_bug.cgi?id=43870,
this transform is missing a crucial legality check:
the old (non-countable) loop would early-return upon first mismatch,
but there is no such guarantee for bcmp/memcmp.

We'd need to ensure that [PtrA, PtrA+NBytes) and [PtrB, PtrB+NBytes)
are fully dereferenceable memory regions. But that would limit
the transform to constant loop trip counts and would further
cripple it because dereferenceability analysis is *very* partial.

Furthermore, even if all that is done, every single test
would need to be rewritten from scratch.

So let's just give up.




More information about the All-commits mailing list