[PATCH] D38941: [PowerPC] Use record-form instruction for Less-or-Equal -1 and Greater-or-Equal 1

Hiroshi Inoue via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 02:02:04 PDT 2017


inouehrs marked an inline comment as done.
inouehrs added inline comments.


================
Comment at: lib/Target/PowerPC/PPCInstrInfo.cpp:1740-1743
     bool Success = false;
     if (!equalityOnly && MRI->hasOneUse(CRReg)) {
       MachineInstr *UseMI = &*MRI->use_instr_begin(CRReg);
       if (UseMI->getOpcode() == PPC::BCC) {
----------------
sfertile wrote:
> It seems to me this would be cleaner if we get rid of the 'Success' variable and convert the 2 ifs to check the opposite conditions and early return on failure.
is this better?


================
Comment at: test/CodeGen/PowerPC/opt-cmp-inst-cr0-live.ll:83
+
+; This test cconfirms record-form instructions are emitted for comparison
+; against a non-zero value.
----------------
sfertile wrote:
> cconfirms --> confirms
Good catch. Fixed.


https://reviews.llvm.org/D38941





More information about the llvm-commits mailing list