[PATCH] D31852: [PowerPC] Convert reg/reg instructions fed by constants to reg/imm instructions (pre and post RA)
Nemanja Ivanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 13 06:51:03 PST 2017
nemanjai added inline comments.
================
Comment at: lib/Target/PowerPC/PPCInstrInfo.cpp:2314
+ unsigned ConstantOperand = ~0U;
+ MachineInstr *DefMI = getConstantDefMI(MI, ConstantOperand,
+ SeenIntermediateUse);
----------------
hfinkel wrote:
> I see why you did this, but I don't like the interface to this function: it is unintuitive that it might return non-null, and yet, you also need to check that the ConstantOp is not -1 to know if the return value is valid. Can you please change this so that it uniformly returns non-null only if it succeeds (and, thus, the constant is valid).
That is a really good point. I'll change it to return non-null only if the constant operand is a valid operand of the instruction.
Repository:
rL LLVM
https://reviews.llvm.org/D31852
More information about the llvm-commits
mailing list