[all-commits] [llvm/llvm-project] b03891: [PatternMatch] add tests for constant expression m...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Thu Jul 21 12:24:13 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b03891268cc378ce01a8da40483224aa1cfee5b6
      https://github.com/llvm/llvm-project/commit/b03891268cc378ce01a8da40483224aa1cfee5b6
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-07-21 (Thu, 21 Jul 2022)

  Changed paths:
    M llvm/unittests/IR/PatternMatch.cpp

  Log Message:
  -----------
  [PatternMatch] add tests for constant expression matcher; NFC


  Commit: 78c09f0f24b6af6d17aeef93c13c54e251e57e8c
      https://github.com/llvm/llvm-project/commit/78c09f0f24b6af6d17aeef93c13c54e251e57e8c
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-07-21 (Thu, 21 Jul 2022)

  Changed paths:
    M llvm/include/llvm/IR/PatternMatch.h
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/test/Transforms/InstCombine/sub-of-negatible.ll
    M llvm/unittests/IR/PatternMatch.cpp

  Log Message:
  -----------
  [PatternMatch][InstCombine] match a vector with constant expression element(s) as a constant expression

The InstCombine test is reduced from issue #56601. Without the more
liberal match for ConstantExpr, we try to rearrange constants in
Negator forever.

Alternatively, we could adjust the definition of m_ImmConstant to be
more conservative, but that's probably a larger patch, and I don't
see any downside to changing m_ConstantExpr. We never capture and
modify a ConstantExpr; transforms just want to avoid it.

Differential Revision: https://reviews.llvm.org/D130286


Compare: https://github.com/llvm/llvm-project/compare/04d398db4694...78c09f0f24b6


More information about the All-commits mailing list