[PATCH] D124118: [Peephole-Opt] For one kind of test-after-add pattern, eliminates test if it's correct to do so.

Mingming Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 9 20:40:07 PDT 2022


mingmingl updated this revision to Diff 428279.
mingmingl marked an inline comment as done.
mingmingl added a comment.

Replied the comments.

Besides, in `findRedundantFlagInstr`, change from

    const MachineOperand& MO1 = CmpValDefInstr.getOperand(1);
  // As seen in X86 td files, MO1 is typically
    // 0.
    if (.MO1.getImm() != 0)
      return false;

to

  // As seen in X86 td files, CmpValDefInstr.getOperand(1).getImm() is typically
    // 0.
    if (CmpValDefInstr.getOperand(1).getImm() != 0)
      return false;

Same for MO2 and MO3.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124118/new/

https://reviews.llvm.org/D124118

Files:
  llvm/lib/Target/X86/X86InstrInfo.cpp
  llvm/test/CodeGen/X86/peephole-test-after-add.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124118.428279.patch
Type: text/x-patch
Size: 14538 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220510/789a5a64/attachment.bin>


More information about the llvm-commits mailing list