[PATCH] D81723: [PowerPC] fold addi's imm operand to its imm form consumer's displacement

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 18 20:43:42 PDT 2020


shchenz added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:2326
-  if (MRI.isSSA())
-    return;
 
----------------
steven.zhang wrote:
> Do we still need to fixup the kill/dead flags if it SSA ?
Yes, we need it. kill/dead flags exist even in SSA and machineverify will use these flags to do checking.
Without these fixup, we get LIT case failure.


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:3587
+  int64_t Imm = ImmOperandMI.getImm();
+  if (!isImmElgibleForForwarding(*ImmMO, DefMI, III, Imm))
+    return false;
----------------
steven.zhang wrote:
> We will initialize the Imm inside isImmElgibleForForwarding, and you don't need to initialize it with ImmOperandMI
The Imm initialized in `isImmElgibleForForwarding` is just for `DefMI`, here we need the sum of the imm in `DefMI` and imm in `MI`. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81723





More information about the llvm-commits mailing list