[PATCH] D111434: [PowerPC] PPC backend optimization on conditional trap intrustions

Amy Kwan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 26 07:44:00 PDT 2021


amyk added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCMIPeephole.cpp:1011
+      case PPC::TDI:
+      case PPC::TWI: {
+        MachineInstr *LiMIA = getVRegDefOrNull(&MI.getOperand(1), MRI);
----------------
nemanjai wrote:
> Seems that we should be able to handle all 4 in the same block:
> - Check that both operands are `LI[8]`/`LI[S][8]+ORI[8]` or an immediate
> - Set the variables for the three constants
> - Determine if this is an unconditional trap or never trap
> - Emit the correct instruction
+1


================
Comment at: llvm/lib/Target/PowerPC/PPCMIPeephole.cpp:1013
+        MachineInstr *LiMIA = getVRegDefOrNull(&MI.getOperand(1), MRI);
+        // will not optimize if no value set
+        if (!(LiMIA && (LiMIA->getOpcode() == PPC::LI ||
----------------
nit: Capitalize and add a period (and for all other comments).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111434



More information about the cfe-commits mailing list