[PATCH] D80907: [PowerPC] refactor convertToImmediateForm - NFC

Qing Shan Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 19:30:16 PDT 2020


steven.zhang added a comment.

This is something that we wanted to do early before. Thank you for doing this. Some minor comments.



================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:2659
   // If this is a reg+reg instruction that has a reg+imm form,
   // and one of the operands is produced by LI, convert it now.
   if (HasImmForm)
----------------
Please update the comments as it is NOT always LI now.


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:2660
   // and one of the operands is produced by LI, convert it now.
   if (HasImmForm)
+    return transformToImmFormFedByLI(MI, III, ForwardingOperand, *DefMI);
----------------
I think, it makes more sense to do it as follows so that, we can add more peephole for Imm form 
```
if (HasImmForm && transformToImmFormFedByLI) return true;
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80907





More information about the llvm-commits mailing list