[all-commits] [llvm/llvm-project] 57a8ea: [InstCombine] Avoid infinite loop in insert/extrac...

Nikita Popov via All-commits all-commits at lists.llvm.org
Wed Jun 14 05:59:07 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 57a8ea85538503a35d1e04fd8c8ba32aa2ba3f2a
      https://github.com/llvm/llvm-project/commit/57a8ea85538503a35d1e04fd8c8ba32aa2ba3f2a
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-06-14 (Wed, 14 Jun 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
    M llvm/test/Transforms/InstCombine/insert-extract-shuffle-inseltpoison.ll
    M llvm/test/Transforms/InstCombine/insert-extract-shuffle.ll

  Log Message:
  -----------
  [InstCombine] Avoid infinite loop in insert/extract combine

Fix the infinite loop reported on https://reviews.llvm.org/D151807#4420467.

collectShuffleElements() will widen vectors and replace extracts
via replaceExtractElements(), to allow the next call of
collectShuffleElements() to fold. However, it's possible for another
fold to run first, and break the expected sequence again. To ensure
this does not happen, directly rerun the collectShuffleElements()
fold if we have adjusted extracts.




More information about the All-commits mailing list