[all-commits] [llvm/llvm-project] ac74e7: [InstSimplify] Only check self-simplify in simplif...

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Oct 17 06:52:58 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ac74e7a7806480a000c9a3502405c3dedd8810de
      https://github.com/llvm/llvm-project/commit/ac74e7a7806480a000c9a3502405c3dedd8810de
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-10-17 (Mon, 17 Oct 2022)

  Changed paths:
    M llvm/lib/Analysis/InstructionSimplify.cpp

  Log Message:
  -----------
  [InstSimplify] Only check self-simplify in simplifyInstruction()

InstSimplify currently checks whether the instruction simplifies
back to itself, and returns undef in that case. Generally, this
should only occur in unreachable code.

However, this was also done for the simplifyInstructionWithOperands()
API. In that case, the instruction only serves as a template that
provides the opcode and other non-operand data. In this case,
simplifying back to the same "instruction" may be expected. This
caused PR58401 in conjunction with D134954.

As such, move this check into simplifyInstruction() only. The only
other caller of simplifyInstructionWithOperands() also handles the
self-simplification case explicitly.




More information about the All-commits mailing list