[all-commits] [llvm/llvm-project] d1115c: [PowerPC] Optimize compare by using record form in...

Esme via All-commits all-commits at lists.llvm.org
Sun Oct 30 22:35:27 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d1115c2b84d42eefd1546463507ce84f45c6b7cd
      https://github.com/llvm/llvm-project/commit/d1115c2b84d42eefd1546463507ce84f45c6b7cd
  Author: esmeyi <esme.yi at ibm.com>
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
    M llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
    M llvm/lib/Target/PowerPC/PPCInstrInfo.h
    M llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp
    A llvm/test/CodeGen/PowerPC/opt-cmp-rec-postra.mir
    M llvm/test/CodeGen/PowerPC/ppc64-rop-protection.ll

  Log Message:
  -----------
  [PowerPC] Optimize compare by using record form in post-RA.

Summary: We currently optimize the comparison only in SSA, therefore we will miss some optimization opportunities where the input of comparison is lowered from COPY in post-RA.
Ie. ExpandPostRA::LowerCopy is called after PPCInstrInfo::optimizeCompareInstr.
This patch optimizes the comparison in post-RA and only the cases that compare against zero can be handled.
D131374 converts the comparison and its user to a compare against zero with the appropriate predicate on the branch, which creates additional opportunities for this patch.

Reviewed By: shchenz, lkail

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




More information about the All-commits mailing list