[PATCH] D34209: [PowerPC] fix potential verification errors
Nemanja Ivanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 21 05:32:18 PDT 2017
nemanjai accepted this revision.
nemanjai added a comment.
This revision is now accepted and ready to land.
Aside from the inline stylistic nit, this LGTM.
================
Comment at: lib/Target/PowerPC/PPCRegisterInfo.cpp:378
if (MaxAlign < TargetAlign && isInt<16>(FrameSize)) {
- BuildMI(MBB, II, dl, TII.get(PPC::ADDI), Reg)
- .addReg(PPC::R31)
- .addImm(FrameSize);
+ if (LP64) {
+ BuildMI(MBB, II, dl, TII.get(PPC::ADDI8), Reg)
----------------
Just a stylistic nit:
- No braces in conditionals with a single statement
In fact, I'd probably define something like `unsigned FramePtrReg = LP64 ? PPC::X31 : PPC::R31` just after line 375 and just use it (along with a ternary expression for the opcode) in this call to `BuildMI()`.
https://reviews.llvm.org/D34209
More information about the llvm-commits
mailing list