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

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 2 00:31:23 PDT 2020


shchenz added a comment.

Thanks for your comments @lkail @steven.zhang

Patch updated.



================
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)
----------------
steven.zhang wrote:
> Please update the comments as it is NOT always LI now.
Not very clear about this comment.

`transformToImmFormFedByLI` will check LI opcode inside it like other functions `transformToImmFormFedByLI` & `simplifyToLI`


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:3294
+  // Sign-extend to 64-bits.
+  int64_t SExtImm = ((uint64_t)Immediate & ~0x7FFFuLL) != 0
+                        ? (Immediate | 0xFFFFFFFFFFFF0000)
----------------
lkail wrote:
> Can we use `SignExtend64<16>(Imm)` in `MathExtra.h` to simplify?
good idea


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