[all-commits] [llvm/llvm-project] 6f7797: [InstCombine] add tests for logical-and / logical-...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Wed Nov 2 06:01:48 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6f77979a4b1348d136995644c1f4ad37b50d6580
      https://github.com/llvm/llvm-project/commit/6f77979a4b1348d136995644c1f4ad37b50d6580
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-11-02 (Wed, 02 Nov 2022)

  Changed paths:
    M llvm/test/Transforms/InstCombine/select-safe-transforms.ll

  Log Message:
  -----------
  [InstCombine] add tests for logical-and / logical-or folds; NFC

Similar to 29661fe94bf12ced1 - there are matching
deficiencies and a potential crash lurking in
these patterns.


  Commit: b24e2f6ef6704652f52e1dc24e4e1cae5144fb7a
      https://github.com/llvm/llvm-project/commit/b24e2f6ef6704652f52e1dc24e4e1cae5144fb7a
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-11-02 (Wed, 02 Nov 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    M llvm/test/Transforms/InstCombine/select-safe-transforms.ll

  Log Message:
  -----------
  [InstCombine] use logical-and matcher to avoid crash

Follow-on to:
ec0b406e16c44f1554

This should prevent crashing for example like issue #58552
by not matching a select-of-vectors-with-scalar-condition.

The test that shows a regression seems unlikely to occur
in real code.

This also picks up an optimization in the case where a real
(bitwise) logic op is used. We could already convert some
similar select ops to real logic via impliesPoison(), so
we don't see more diffs on commuted tests. Using commutative
matchers (when safe) might also handle one of the TODO tests.


Compare: https://github.com/llvm/llvm-project/compare/d839f654586a...b24e2f6ef670


More information about the All-commits mailing list