[PATCH] D111434: [PowerPC] PPC backend optimization on conditional trap intrustions
Amy Kwan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 12 05:50:43 PST 2021
amyk added inline comments.
================
Comment at: llvm/lib/Target/PowerPC/PPCMIPeephole.cpp:1018
+ unsigned Opcode2 = LiMI2->getOpcode();
+ bool isOperand2Immeidate = MI.getOperand(2).isImm();
+ // We can only do the optimization for the "reg + reg" form.
----------------
================
Comment at: llvm/lib/Target/PowerPC/PPCMIPeephole.cpp:1020
+ // We can only do the optimization for the "reg + reg" form.
+ if (!(LiMI1 && (Opcode1 == PPC::LI || Opcode1 == PPC::LI8)))
+ break;
----------------
Do we still need to take into account of the lis+ori that Nemanja mentioned?
================
Comment at: llvm/lib/Target/PowerPC/PPCMIPeephole.cpp:1022
+ break;
+ if (!isOperand2Immeidate &&
+ !(LiMI2 && (Opcode2 == PPC::LI || Opcode2 == PPC::LI8)))
----------------
================
Comment at: llvm/lib/Target/PowerPC/PPCMIPeephole.cpp:1028
+ auto ImmOperand1 = LiMI1->getOperand(1).getImm();
+ auto ImmOperand2 = isOperand2Immeidate ? MI.getOperand(2).getImm()
+ : LiMI2->getOperand(1).getImm();
----------------
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111434/new/
https://reviews.llvm.org/D111434
More information about the llvm-commits
mailing list